diff options
| author | louis <louis.braun@gmx.de> | 2016-02-14 15:06:30 +0100 |
|---|---|---|
| committer | louis <louis.braun@gmx.de> | 2016-02-14 15:06:30 +0100 |
| commit | 7d20e87973db6115c9dad00cce3658a1f0583fe8 (patch) | |
| tree | d2693f8283ce5d3d8906254484268c70476ea1b3 | |
| parent | 6eda200228fc410d16bdfb78dcafaef24c7a757b (diff) | |
| download | vdr-plugin-skindesigner-7d20e87973db6115c9dad00cce3658a1f0583fe8.tar.gz vdr-plugin-skindesigner-7d20e87973db6115c9dad00cce3658a1f0583fe8.tar.bz2 | |
fixed themes handling
| -rw-r--r-- | config.c | 11 | ||||
| -rw-r--r-- | config.h | 4 | ||||
| -rw-r--r-- | designer.c | 2 | ||||
| -rw-r--r-- | designer.h | 2 | ||||
| -rw-r--r-- | skindesigner.c | 4 |
5 files changed, 17 insertions, 6 deletions
@@ -31,6 +31,9 @@ cDesignerConfig::cDesignerConfig() { cDesignerConfig::~cDesignerConfig() { ClearSkinSetups(); + for (vector<cTheme*>::iterator it = themes.begin(); it != themes.end(); it++) { + delete *it; + } } void cDesignerConfig::SetPathes(void) { @@ -81,6 +84,10 @@ bool cDesignerConfig::GetThemeColor(string &name, tColor &col) { return tmplGlobals->GetColor(name, col); } +void cDesignerConfig::StoreTheme(cTheme *theme) { + themes.push_back(theme); +} + void cDesignerConfig::ReadSkinFolder(cString &skinFolder, vector<string> *container) { DIR *folder = NULL; struct dirent *dirEntry; @@ -171,7 +178,9 @@ cString cDesignerConfig::GetSkinPath(string skin) { } void cDesignerConfig::AddNewSkinRef(string skin) { - cSkinDesigner *newSkin = new cSkinDesigner(skin); + cTheme *theme = new cTheme(); + StoreTheme(theme); + cSkinDesigner *newSkin = new cSkinDesigner(skin, theme); AddSkin(newSkin); skins.push_back(skin); installerSkins.push_back(skin); @@ -35,6 +35,7 @@ private: string osdLanguage; cGlobals *tmplGlobals; vector<cSkinDesigner*> skinRefs; + vector<cTheme*> themes; vector<cSkinDesigner*>::iterator skinRefsIterator; vector<string> deliveredSkins; vector<string> installerSkins; @@ -56,6 +57,7 @@ public: void SetLogoPath(cString path); void SetEpgImagePath(cString path); bool GetThemeColor(string &name, tColor &col); + void StoreTheme(cTheme *theme); void ReadSkins(void); void ReadSkinSetup(string skin); void InitSkinIterator(void) { skinIterator = skins.begin(); }; @@ -121,14 +123,12 @@ public: cSDPluginManager *plgManager = NULL; cFontManager *fontManager = NULL; cImageCache *imgCache = NULL; - cTheme Theme; cRecordingsFolderInfo recFolderInfo(Recordings); #else extern cDesignerConfig config; extern cSDPluginManager *plgManager; extern cFontManager *fontManager; extern cImageCache *imgCache; - extern cTheme Theme; extern cRecordingsFolderInfo recFolderInfo; #endif @@ -1,7 +1,7 @@ #include "designer.h" #include "extensions/helpers.h" -cSkinDesigner::cSkinDesigner(string skin) : cSkin(skin.c_str(), &::Theme) { +cSkinDesigner::cSkinDesigner(string skin, cTheme *theme) : cSkin(skin.c_str(), theme) { init = true; this->skin = skin; @@ -41,7 +41,7 @@ private: void LoadPluginViews(void); void CacheViews(void); public: - cSkinDesigner(string skin); + cSkinDesigner(string skin, cTheme *theme); virtual ~cSkinDesigner(void); virtual const char *Description(void); virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo); diff --git a/skindesigner.c b/skindesigner.c index 722de6c..a2138b3 100644 --- a/skindesigner.c +++ b/skindesigner.c @@ -140,7 +140,9 @@ bool cPluginSkinDesigner::Start(void) { bool skinAvailable = false; while (config.GetSkin(skin)) { config.ReadSkinSetup(skin); - cSkinDesigner *newSkin = new cSkinDesigner(skin); + cTheme *theme = new cTheme(); + config.StoreTheme(theme); + cSkinDesigner *newSkin = new cSkinDesigner(skin, theme); config.AddSkin(newSkin); skinAvailable = true; if (!trueColorAvailable) { |
