summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-10-18 10:28:38 +0200
committerlouis <louis.braun@gmx.de>2014-10-18 10:28:38 +0200
commit762115bf818fb11b5f03525d115adad1f40c480d (patch)
tree3c1f6eeb697b36b58ebb722f8232829180a10614
parent3d1a2f1090e5e2a1a2f69ec7fe518245078b6527 (diff)
downloadvdr-plugin-skindesigner-762115bf818fb11b5f03525d115adad1f40c480d.tar.gz
vdr-plugin-skindesigner-762115bf818fb11b5f03525d115adad1f40c480d.tar.bz2
fixed bug that new font was displayed first after VDR restart when font was changed in OSD Setup menu
-rw-r--r--HISTORY1
-rw-r--r--config.c26
-rw-r--r--config.h5
-rw-r--r--designer.c16
4 files changed, 46 insertions, 2 deletions
diff --git a/HISTORY b/HISTORY
index 8572342..2ec76d5 100644
--- a/HISTORY
+++ b/HISTORY
@@ -25,3 +25,4 @@ Version 0.0.2
- introduced new viewelement audioinfo in displaychannel
- added setup option to choose Menu Item display method between "at one go" and "after one another"
- fixed bug that new skin was not properly loaded sometimes when skin was changed in OSD Setup menu
+- fixed bug that new font was displayed first after VDR restart when font was changed in OSD Setup menu
diff --git a/config.c b/config.c
index 45d8d3a..34b489d 100644
--- a/config.c
+++ b/config.c
@@ -23,10 +23,10 @@ cDesignerConfig::cDesignerConfig() {
//menu display style, display menu items
//one after each other or in one step
blockFlush = 1;
- //remember current skin and theme
+ //remember current skin and theme, osd size and osd fonts
SetSkin();
- //remember osd size
SetOSDSize();
+ SetOSDFonts();
}
cDesignerConfig::~cDesignerConfig() {
@@ -146,6 +146,28 @@ bool cDesignerConfig::OsdSizeChanged(void) {
return false;
}
+void cDesignerConfig::SetOSDFonts(void) {
+ fontFix = Setup.FontFix;
+ fontOsd = Setup.FontOsd;
+ fontSml = Setup.FontSml;
+}
+
+bool cDesignerConfig::OsdFontsChanged(void) {
+ bool changed = false;
+ if (fontFix.compare(Setup.FontFix) != 0) {
+ changed = true;
+ }
+ if (fontOsd.compare(Setup.FontOsd) != 0) {
+ changed = true;
+ }
+ if (fontSml.compare(Setup.FontSml) != 0) {
+ changed = true;
+ }
+ if (changed)
+ SetOSDFonts();
+ return changed;
+}
+
cString cDesignerConfig::CheckSlashAtEnd(std::string path) {
try {
if (!(path.at(path.size()-1) == '/'))
diff --git a/config.h b/config.h
index 4ff9aa9..3763bf9 100644
--- a/config.h
+++ b/config.h
@@ -19,6 +19,9 @@ private:
cRect osdSize;
string osdSkin;
string osdTheme;
+ string fontFix;
+ string fontOsd;
+ string fontSml;
public:
cDesignerConfig();
~cDesignerConfig();
@@ -36,6 +39,8 @@ public:
bool SkinChanged(void);
void SetOSDSize(void);
bool OsdSizeChanged(void);
+ void SetOSDFonts(void);
+ bool OsdFontsChanged(void);
cString logoExtension;
cString skinPath;
cString logoPath;
diff --git a/designer.c b/designer.c
index 6f07a00..2ab7dc0 100644
--- a/designer.c
+++ b/designer.c
@@ -163,6 +163,7 @@ void cSkinDesigner::Init(void) {
if (init) {
config.SetSkin();
config.SetOSDSize();
+ config.SetOSDFonts();
}
dsyslog("skindesigner: initializing skin %s", skin.c_str());
@@ -188,6 +189,21 @@ void cSkinDesigner::Init(void) {
watch.Stop("templates loaded and cache created");
}
init = false;
+ } else if (config.OsdFontsChanged()) {
+ dsyslog("skindesigner: reloading fonts");
+ if (fontManager)
+ delete fontManager;
+ fontManager = new cFontManager();
+ cStopWatch watch;
+ bool ok = LoadTemplates();
+ if (!ok) {
+ esyslog("skindesigner: error during loading of templates - using LCARS as backup");
+ backupSkin = new cSkinLCARS();
+ useBackupSkin = true;
+ } else {
+ CacheTemplates();
+ watch.Stop("templates loaded and cache created");
+ }
}
}