summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2016-02-14 15:06:30 +0100
committerlouis <louis.braun@gmx.de>2016-02-14 15:06:30 +0100
commit7d20e87973db6115c9dad00cce3658a1f0583fe8 (patch)
treed2693f8283ce5d3d8906254484268c70476ea1b3
parent6eda200228fc410d16bdfb78dcafaef24c7a757b (diff)
downloadvdr-plugin-skindesigner-7d20e87973db6115c9dad00cce3658a1f0583fe8.tar.gz
vdr-plugin-skindesigner-7d20e87973db6115c9dad00cce3658a1f0583fe8.tar.bz2
fixed themes handling
-rw-r--r--config.c11
-rw-r--r--config.h4
-rw-r--r--designer.c2
-rw-r--r--designer.h2
-rw-r--r--skindesigner.c4
5 files changed, 17 insertions, 6 deletions
diff --git a/config.c b/config.c
index 497e849..0f58331 100644
--- a/config.c
+++ b/config.c
@@ -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);
diff --git a/config.h b/config.h
index 0960b9b..3300a84 100644
--- a/config.h
+++ b/config.h
@@ -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
diff --git a/designer.c b/designer.c
index b3b5052..b6f35b1 100644
--- a/designer.c
+++ b/designer.c
@@ -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;
diff --git a/designer.h b/designer.h
index 18c94d2..8870392 100644
--- a/designer.h
+++ b/designer.h
@@ -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) {