diff options
author | Martin Prochnow <nordlicht@martins-kabuff.de> | 2008-03-22 16:45:02 +0100 |
---|---|---|
committer | Andreas Mair <andreas@vdr-developer.org> | 2008-03-22 16:45:02 +0100 |
commit | 23f4f2114e7d48bb4bbe5e50aa6ddce0f1c21bd2 (patch) | |
tree | 65ec19823baa6f900495290b9d0e8497f12115ee /tools.c | |
parent | 3b617b561f901e8f7a5f8991bc1d51e1ee800142 (diff) | |
download | vdr-plugin-extrecmenu-1.2-test1.tar.gz vdr-plugin-extrecmenu-1.2-test1.tar.bz2 |
Version 1.2-test1v1.2-test1
- added italian translation; thanks to Diego
- added support for GraphTFT-plugin; thanks to Jörg Wendel for the patch
- added support for true type fonts and UTF-8; thanks to Andreas Mair for the true type font and the patch
- removed patch font routine because it is useless now
- added true type font containing the needed icons
- changed i18n support to gettext
Diffstat (limited to 'tools.c')
-rw-r--r-- | tools.c | 49 |
1 files changed, 36 insertions, 13 deletions
@@ -37,12 +37,12 @@ string myStrEscape(string S,const char *Chars) return S; } -string myStrReplace(string S,char C1,char C2) +string myStrReplace(string S,char C1,const char* C2) { string::size_type i=0; while((i=S.find(C1,i))!=string::npos) { - S.replace(i,1,1,C2); + S.replace(i,1,C2); i++; } return S; @@ -69,23 +69,23 @@ void SortList::ReadConfigFile() void SortList::WriteConfigFile() { - string configfile(cPlugin::ConfigDirectory()); - configfile+=CONFIGFILE; + string configfile(cPlugin::ConfigDirectory()); + configfile+=CONFIGFILE; - ofstream outfile(configfile.c_str()); + ofstream outfile(configfile.c_str()); - for(SortListItem *item=First();item;item=Next(item)) - outfile << item->Path() << endl; + for(SortListItem *item=First();item;item=Next(item)) + outfile << item->Path() << endl; } bool SortList::Find(string Path) { - for(SortListItem *item=First();item;item=Next(item)) - { - if(item->Path()==Path) - return true; - } - return false; + for(SortListItem *item=First();item;item=Next(item)) + { + if(item->Path()==Path) + return true; + } + return false; } // --- MoveRename ------------------------------------------------------------- @@ -683,3 +683,26 @@ bool WorkerThread::Move(string From,string To) return false; } +// --- Icons ------------------------------------------------------------------ +bool Icons::IsUTF8=false; + +void Icons::InitCharSet() +{ + // Taken from VDR's vdr.c + char *CodeSet=NULL; + if(setlocale(LC_CTYPE, "")) + CodeSet=nl_langinfo(CODESET); + else + { + char *LangEnv=getenv("LANG"); // last resort in case locale stuff isn't installed + if(LangEnv) + { + CodeSet=strchr(LangEnv,'.'); + if(CodeSet) + CodeSet++; // skip the dot + } + } + + if(CodeSet && strcasestr(CodeSet,"UTF-8")!=0) + IsUTF8=true; +} |