diff options
author | louis <louis.braun@gmx.de> | 2014-10-18 10:28:38 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2014-10-18 10:28:38 +0200 |
commit | 762115bf818fb11b5f03525d115adad1f40c480d (patch) | |
tree | 3c1f6eeb697b36b58ebb722f8232829180a10614 | |
parent | 3d1a2f1090e5e2a1a2f69ec7fe518245078b6527 (diff) | |
download | vdr-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-- | HISTORY | 1 | ||||
-rw-r--r-- | config.c | 26 | ||||
-rw-r--r-- | config.h | 5 | ||||
-rw-r--r-- | designer.c | 16 |
4 files changed, 46 insertions, 2 deletions
@@ -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 @@ -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) == '/')) @@ -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; @@ -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"); + } } } |