From 7c0a99b35d139df9d6a5706b014574a3ebc46f8b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 24 May 2016 10:32:02 +0200 Subject: [PATCH] lcd4linux: allow to switch umlauts conversion Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4a7696b404713750a86a8add24af9babadb1e5c7 Author: vanhofen Date: 2016-05-24 (Tue, 24 May 2016) Origin message was: ------------------ - lcd4linux: allow to switch umlauts conversion ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/bouquetlist.cpp | 2 +- src/gui/channellist.cpp | 2 +- src/gui/lcd4l.cpp | 4 ++-- src/gui/lcd4l.h | 2 +- src/gui/ni_menu.cpp | 6 ++++++ src/gui/widget/menue.cpp | 4 ++-- src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 12 files changed, 24 insertions(+), 7 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ec31499de..3b4b48321 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -950,6 +950,7 @@ languagesetup.head Sprache und Zeitzonen languagesetup.osd Menüsprache languagesetup.select Sprache lcd4l_clock_a Analog-Uhr im Standby-Modus +lcd4l_convert Konvertiere Umlaute lcd4l_logodir Senderlogo-Verzeichnis lcd4l_skin Display-Style lcd4l_skin_0 Standard @@ -1283,6 +1284,7 @@ menu.hint_last_radio Wählen Sie den Start-Sender im Radio-Modus menu.hint_last_tv Wählen Sie den Start-Sender im TV-Modus menu.hint_last_use Speichert den aktuellen Kanal beim Herunterfahren der Box menu.hint_lcd4l_clock_a Zeigt im Standby-Betrieb eine Analog-Uhr anstatt einer Digital-Uhr +menu.hint_lcd4l_convert Konvertiert Umlaute für die eingebaute LCD4Linux-Schriftart menu.hint_lcd4l_logodir Verzeichnis für Senderlogos\nBei ungültigem Eintrag Fallback auf Standard-Logoverzeichnis menu.hint_lcd4l_skin Auswahl der verfügbaren Darstellungsarten\nStandard, Groß, SysInfo, d-box2, Benutzerdefiniert menu.hint_lcd4l_skin_radio Wechselt die Darstellungsart, wenn der Radio-Modus aktiviert wird diff --git a/data/locale/english.locale b/data/locale/english.locale index 6b2c680ed..974f90872 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -950,6 +950,7 @@ languagesetup.head Language / Timezone languagesetup.osd OSD Language languagesetup.select OSD Language lcd4l_clock_a Analog clock in Standby-Mode +lcd4l_convert Convert umlauts lcd4l_logodir Channellogo-Directory lcd4l_skin Display-Style lcd4l_skin_0 Standard @@ -1283,6 +1284,7 @@ menu.hint_last_radio Start box on selected channel\nif last mode is Radio menu.hint_last_tv Start box on selected channel\nif last mode is TV menu.hint_last_use Start box on last used channel menu.hint_lcd4l_clock_a Shows an analog clock instead of a digital clock on display at standby +menu.hint_lcd4l_convert Convert umlauts for the built-in LCD4Linux font menu.hint_lcd4l_logodir Logo directory.\nFallback to default on invalid entry. menu.hint_lcd4l_skin Switch between modes\nDefault, Big, SysInfo, d-box2, User Defined menu.hint_lcd4l_skin_radio Switch the mode, when Radio-Mode is activated diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index c1e60833d..240b7482a 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -641,7 +641,7 @@ void CBouquetList::paintItem(int pos) CVFD::getInstance()->showMenuText(0, lname, -1, true); //NI lcd4l-support if(g_settings.lcd4l_support) - LCD4l->CreateFile("/tmp/lcd/menu", lname); + LCD4l->CreateFile("/tmp/lcd/menu", lname, g_settings.lcd4l_convert); } else { if(!favonly && (npos < (int) Bouquets.size())) iscurrent = !Bouquets[npos]->channelList->isEmpty(); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index b1cc1a1b4..a1c55a802 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2069,7 +2069,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) updateVfd(); //NI lcd4l-support if(g_settings.lcd4l_support) - LCD4l->CreateFile("/tmp/lcd/menu", chan->getName().c_str()); + LCD4l->CreateFile("/tmp/lcd/menu", chan->getName().c_str(), g_settings.lcd4l_convert); } } diff --git a/src/gui/lcd4l.cpp b/src/gui/lcd4l.cpp index 67cb65727..34a532ab3 100644 --- a/src/gui/lcd4l.cpp +++ b/src/gui/lcd4l.cpp @@ -730,7 +730,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) if (m_Event.compare(Event)) { - WriteFile(EVENT, Event, true); + WriteFile(EVENT, Event, g_settings.lcd4l_convert); m_Event = Event; } @@ -768,7 +768,7 @@ bool CLCD4l::WriteFile(const char *file, std::string content, bool convert) { bool ret = true; - if (convert) + if (convert) // align to internal lcd4linux font { strReplace(content, "ä", "á"); strReplace(content, "ö", "ï"); diff --git a/src/gui/lcd4l.h b/src/gui/lcd4l.h index 983ee8c47..21f10fcb7 100644 --- a/src/gui/lcd4l.h +++ b/src/gui/lcd4l.h @@ -47,7 +47,7 @@ class CLCD4l void StopLCD4l(); void SwitchLCD4l(); - int CreateFile(const char *file, std::string content = "", bool convert = true); + int CreateFile(const char *file, std::string content = "", bool convert = false); int RemoveFile(const char *file); private: diff --git a/src/gui/ni_menu.cpp b/src/gui/ni_menu.cpp index 7eb1c458b..c099d4fa3 100644 --- a/src/gui/ni_menu.cpp +++ b/src/gui/ni_menu.cpp @@ -538,6 +538,12 @@ int CNIMenu::show() mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_CLOCK_A); lcd4lMenu->addItem(mc); + lcd4lMenu->addItem(GenericMenuSeparator); + + mc = new CMenuOptionChooser(LOCALE_LCD4L_CONVERT, &g_settings.lcd4l_convert, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(lcd4l_shortcut++)); + mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_CONVERT); + lcd4lMenu->addItem(mc); + mf = new CMenuForwarder(LOCALE_LCD4L_SUPPORT, true, NULL, lcd4lMenu, "", CRCInput::convertDigitToKey(shortcut++)); mf->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_SUPPORT); ni_menu->addItem(mf); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 2550b4681..fc9c005d4 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -222,14 +222,14 @@ void CMenuItem::paintItemCaption(const bool select_mode, const char * right_text CVFD::getInstance()->showMenuText(0, str, -1, true); //NI lcd4l-support if(g_settings.lcd4l_support) - LCD4l->CreateFile("/tmp/lcd/menu", str); + LCD4l->CreateFile("/tmp/lcd/menu", str, g_settings.lcd4l_convert); } else { CVFD::getInstance()->showMenuText(0, left_text, -1, true); //NI lcd4l-support if(g_settings.lcd4l_support) - LCD4l->CreateFile("/tmp/lcd/menu", left_text); + LCD4l->CreateFile("/tmp/lcd/menu", left_text, g_settings.lcd4l_convert); } } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 191e1549e..0e6f5f65d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -357,6 +357,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.lcd4l_logodir = configfile.getString("lcd4l_logodir", LOGODIR); g_settings.lcd4l_skin = configfile.getInt32("lcd4l_skin" , 0); g_settings.lcd4l_skin_radio = configfile.getInt32("lcd4l_skin_radio" , 0); + g_settings.lcd4l_convert = configfile.getInt32("lcd4l_convert", 1); g_settings.show_menu_hints_line = configfile.getBool("show_menu_hints_line", false); g_settings.infoviewer_icons = configfile.getInt32("infoviewer_icons" , 1); g_settings.mode_icons = configfile.getInt32( "mode_icons", 0); @@ -1008,6 +1009,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString("lcd4l_logodir" , g_settings.lcd4l_logodir); configfile.setInt32("lcd4l_skin" , g_settings.lcd4l_skin); configfile.setInt32("lcd4l_skin_radio" , g_settings.lcd4l_skin_radio); + configfile.setInt32("lcd4l_convert" , g_settings.lcd4l_convert); configfile.setBool("show_menu_hints_line" , g_settings.show_menu_hints_line); configfile.setInt32("infoviewer_icons" , g_settings.infoviewer_icons); configfile.setInt32("mode_icons", g_settings.mode_icons ); diff --git a/src/system/locals.h b/src/system/locals.h index 1c718d5c8..29bd4ae9d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -977,6 +977,7 @@ typedef enum LOCALE_LANGUAGESETUP_OSD, LOCALE_LANGUAGESETUP_SELECT, LOCALE_LCD4L_CLOCK_A, + LOCALE_LCD4L_CONVERT, LOCALE_LCD4L_LOGODIR, LOCALE_LCD4L_SKIN, LOCALE_LCD4L_SKIN_0, @@ -1310,6 +1311,7 @@ typedef enum LOCALE_MENU_HINT_LAST_TV, LOCALE_MENU_HINT_LAST_USE, LOCALE_MENU_HINT_LCD4L_CLOCK_A, + LOCALE_MENU_HINT_LCD4L_CONVERT, LOCALE_MENU_HINT_LCD4L_LOGODIR, LOCALE_MENU_HINT_LCD4L_SKIN, LOCALE_MENU_HINT_LCD4L_SKIN_RADIO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 258cd2297..4e5e52f30 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -977,6 +977,7 @@ const char * locale_real_names[] = "languagesetup.osd", "languagesetup.select", "lcd4l_clock_a", + "lcd4l_convert", "lcd4l_logodir", "lcd4l_skin", "lcd4l_skin_0", @@ -1310,6 +1311,7 @@ const char * locale_real_names[] = "menu.hint_last_tv", "menu.hint_last_use", "menu.hint_lcd4l_clock_a", + "menu.hint_lcd4l_convert", "menu.hint_lcd4l_logodir", "menu.hint_lcd4l_skin", "menu.hint_lcd4l_skin_radio", diff --git a/src/system/settings.h b/src/system/settings.h index 2a62ba03c..5da98790b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -765,6 +765,7 @@ struct SNeutrinoSettings std::string lcd4l_logodir; int lcd4l_skin; int lcd4l_skin_radio; + int lcd4l_convert; int ca_init; int show_menu_hints_line; int inetradio_autostart;