mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
using VDRs OSD Language instead of system language
This commit is contained in:
parent
77368ebbd1
commit
a3d636ce92
1
HISTORY
1
HISTORY
@ -93,3 +93,4 @@ Version 0.0.6
|
|||||||
|
|
||||||
- fixed Bug that channel info was not shown when displaying reruns with
|
- fixed Bug that channel info was not shown when displaying reruns with
|
||||||
epgsearch
|
epgsearch
|
||||||
|
- using VDRs OSD Language instead of system language
|
||||||
|
9
config.c
9
config.c
@ -23,6 +23,7 @@ cDesignerConfig::cDesignerConfig() {
|
|||||||
SetSkin();
|
SetSkin();
|
||||||
SetOSDSize();
|
SetOSDSize();
|
||||||
SetOSDFonts();
|
SetOSDFonts();
|
||||||
|
osdLanguage = Setup.OSDLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
cDesignerConfig::~cDesignerConfig() {
|
cDesignerConfig::~cDesignerConfig() {
|
||||||
@ -157,6 +158,14 @@ bool cDesignerConfig::OsdFontsChanged(void) {
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool cDesignerConfig::OsdLanguageChanged(void) {
|
||||||
|
if (osdLanguage.compare(Setup.OSDLanguage)) {
|
||||||
|
osdLanguage = Setup.OSDLanguage;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
cString cDesignerConfig::GetSkinRessourcePath(void) {
|
cString cDesignerConfig::GetSkinRessourcePath(void) {
|
||||||
return cString::sprintf("%s%s", *skinPath, osdSkin.c_str());
|
return cString::sprintf("%s%s", *skinPath, osdSkin.c_str());
|
||||||
}
|
}
|
||||||
|
2
config.h
2
config.h
@ -23,6 +23,7 @@ private:
|
|||||||
string fontFix;
|
string fontFix;
|
||||||
string fontOsd;
|
string fontOsd;
|
||||||
string fontSml;
|
string fontSml;
|
||||||
|
string osdLanguage;
|
||||||
map < string, map < int, string > > plugins;
|
map < string, map < int, string > > plugins;
|
||||||
map < string, map < int, string > >::iterator plugIt;
|
map < string, map < int, string > >::iterator plugIt;
|
||||||
public:
|
public:
|
||||||
@ -43,6 +44,7 @@ public:
|
|||||||
bool OsdSizeChanged(void);
|
bool OsdSizeChanged(void);
|
||||||
void SetOSDFonts(void);
|
void SetOSDFonts(void);
|
||||||
bool OsdFontsChanged(void);
|
bool OsdFontsChanged(void);
|
||||||
|
bool OsdLanguageChanged(void);
|
||||||
cString GetSkinRessourcePath(void);
|
cString GetSkinRessourcePath(void);
|
||||||
void AddPlugin(string name, map < int, string > &menus);
|
void AddPlugin(string name, map < int, string > &menus);
|
||||||
void InitPluginIterator(void);
|
void InitPluginIterator(void);
|
||||||
|
@ -168,7 +168,7 @@ void cSkinDesigner::ListCustomTokens(void) {
|
|||||||
* PRIVATE FUNCTIONS
|
* PRIVATE FUNCTIONS
|
||||||
*********************************************************************************/
|
*********************************************************************************/
|
||||||
void cSkinDesigner::Init(void) {
|
void cSkinDesigner::Init(void) {
|
||||||
if (init || config.OsdSizeChanged() || config.SkinChanged()) {
|
if (init || config.OsdSizeChanged() || config.SkinChanged() || config.OsdLanguageChanged()) {
|
||||||
|
|
||||||
if (init) {
|
if (init) {
|
||||||
config.SetSkin();
|
config.SetSkin();
|
||||||
|
@ -6,18 +6,7 @@ cGlobals::cGlobals(void) {
|
|||||||
fonts.insert(pair<string, string>("vdrOsd", Setup.FontOsd));
|
fonts.insert(pair<string, string>("vdrOsd", Setup.FontOsd));
|
||||||
fonts.insert(pair<string, string>("vdrFix", Setup.FontFix));
|
fonts.insert(pair<string, string>("vdrFix", Setup.FontFix));
|
||||||
fonts.insert(pair<string, string>("vdrSml", Setup.FontSml));
|
fonts.insert(pair<string, string>("vdrSml", Setup.FontSml));
|
||||||
|
language = Setup.OSDLanguage;
|
||||||
string loc = setlocale(LC_NAME, NULL);
|
|
||||||
size_t index = loc.find_first_of(".");
|
|
||||||
string langISO = "";
|
|
||||||
if (index > 0) {
|
|
||||||
langISO = loc.substr(0, index);
|
|
||||||
}
|
|
||||||
if (langISO.size() == 5) {
|
|
||||||
language = langISO.c_str();
|
|
||||||
} else {
|
|
||||||
language = "en_EN";
|
|
||||||
}
|
|
||||||
dsyslog("skindesigner: using language %s", language.c_str());
|
dsyslog("skindesigner: using language %s", language.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user