summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-10-03 15:54:23 +0200
committerlouis <louis.braun@gmx.de>2014-10-03 15:54:23 +0200
commit91a0681ab8b2752b5ebd7cfebdd1456708d6ed69 (patch)
tree24c0d8bb48829882bdec0ec7717cc0cba91551c6 /config.c
parent7766972eece16b450621d0e5c72f35733af5b238 (diff)
downloadvdr-plugin-skindesigner-91a0681ab8b2752b5ebd7cfebdd1456708d6ed69.tar.gz
vdr-plugin-skindesigner-91a0681ab8b2752b5ebd7cfebdd1456708d6ed69.tar.bz2
changed skin handling and added themes support for skins
Diffstat (limited to 'config.c')
-rw-r--r--config.c38
1 files changed, 37 insertions, 1 deletions
diff --git a/config.c b/config.c
index 3b88b8e..e4d52c6 100644
--- a/config.c
+++ b/config.c
@@ -5,6 +5,7 @@
cDesignerConfig::cDesignerConfig() {
epgImagePathSet = false;
skinPathSet = false;
+ logoPathSet = false;
//Common
logoExtension = "png";
numLogosPerSizeInitial = 30;
@@ -23,12 +24,14 @@ cDesignerConfig::~cDesignerConfig() {
void cDesignerConfig::SetPathes(void) {
if (!skinPathSet)
skinPath = cString::sprintf("%s/skins/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
+ if (!logoPathSet)
+ logoPath = cString::sprintf("%s/logos/", cPlugin::ResourceDirectory(PLUGIN_NAME_I18N));
if (!epgImagePathSet)
epgImagePath = cString::sprintf("%s/epgimages/", cPlugin::CacheDirectory(PLUGIN_NAME_I18N));
dsyslog("skindesigner: using Skin Directory %s", *skinPath);
+ dsyslog("skindesigner: using common ChannelLogo Directory %s", *logoPath);
dsyslog("skindesigner: using EPG Images Directory %s", *epgImagePath);
-
}
void cDesignerConfig::SetSkinPath(cString path) {
@@ -36,11 +39,44 @@ void cDesignerConfig::SetSkinPath(cString path) {
skinPathSet = true;
}
+void cDesignerConfig::SetLogoPath(cString path) {
+ logoPath = CheckSlashAtEnd(*path);
+ logoPathSet = true;
+}
+
void cDesignerConfig::SetEpgImagePath(cString path) {
epgImagePath = CheckSlashAtEnd(*path);
epgImagePathSet = true;
}
+void cDesignerConfig::ReadSkins(void) {
+ DIR *folder = NULL;
+ struct dirent *dirEntry;
+ folder = opendir(skinPath);
+ if (!folder) {
+ esyslog("skindesigner: no skins found in %s", *skinPath);
+ return;
+ }
+ while (dirEntry = readdir(folder)) {
+ string dirEntryName = dirEntry->d_name;
+ int dirEntryType = dirEntry->d_type;
+ if (!dirEntryName.compare(".") || !dirEntryName.compare("..") || dirEntryType != DT_DIR)
+ continue;
+ skins.push_back(dirEntryName);
+ }
+ dsyslog("skindesigner %d skins found in %s", skins.size(), *skinPath);
+}
+
+bool cDesignerConfig::GetSkin(string &skin) {
+ if (skinIterator == skins.end()) {
+ return false;
+ }
+ skin = *skinIterator;
+ skinIterator++;
+ return true;
+}
+
+
void cDesignerConfig::SetChannelLogoSize(void) {
cImageLoader imgLoader;
imgLoader.DeterminateChannelLogoSize(logoWidth, logoHeight);