From 435d25c0ce8e96cc61d14bbdb986f327b4c62d77 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 27 Nov 2013 04:02:01 +0100 Subject: [PATCH] CInfoClock: Use dynamic font for display --- data/locale/deutsch.locale | 5 +++++ data/locale/english.locale | 5 +++++ src/gui/infoclock.cpp | 6 +++++- src/gui/osd_setup.cpp | 37 ++++++++++++++++++++++++++++++++++ src/gui/osd_setup.h | 1 + src/neutrino.cpp | 4 ++++ src/neutrino_menue.h | 1 + src/system/locals.h | 5 +++++ src/system/locals_intern.h | 5 +++++ src/system/setting_helpers.cpp | 5 ----- src/system/settings.h | 2 ++ 11 files changed, 70 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 2c9bd0457..07348386e 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -256,6 +256,8 @@ ci.reset_standby Reset nach Standby ci.settings Zugangskontrolle ci.timeout CAM antwortet nicht ci.waiting Warte auf CAM-Antwort +clock_size Info Uhr +clock_size_height Höhe der Anzeige clock_switch_off Uhr ausblenden clock_switch_on Uhr einblenden colorchooser.alpha alpha @@ -810,6 +812,7 @@ menu.hint_channellist_foot Definiert, welche Informationen im unteren Sendungsfe menu.hint_channellist_setup Wählen Sie die Anzeigeoptionen für die Kanalliste menu.hint_channels Kanalliste öffnen menu.hint_ci Conditional-Access-Menü zum Einrichten Ihres CI-Moduls oder der eingebetteten Conax-Karte +menu.hint_clock_size Stellen Sie die Größe der Info Uhr ein. menu.hint_colors Konfigurieren Sie die Menü-Farben menu.hint_content_back Ändern Sie die Hintergrundfarbe für den Fensterinhalt menu.hint_content_textcolor Ändern Sie die Textfarbe für den Fensterinhalt @@ -874,6 +877,7 @@ menu.hint_infobar_sat Zeigt die aktuellen Satelliten- oder Kabel-Provider menu.hint_infobar_setup Wählen Sie die Anzeigeoptionen für die Infobar aus menu.hint_infobar_textcolor Ändern Sie die Textfarbe für die Infobar menu.hint_infobar_tuner Zeigt den aktiven Tuner als Nummernicon +menu.hint_infoclock_setup Wählen Sie die Anzeigeoptionen für die Info Uhr menu.hint_keep_numbers Mit der Aktivierung werden den Sendern feste/dauerhafte Kanalnummern zugewiesen menu.hint_key_addrecord Weisen Sie eine Taste für das Starten und Markieren von Aufnahmen im EPG zu menu.hint_key_addremind Weisen Sie eine Taste für das Umschalten im EPG über den Timer zu @@ -1240,6 +1244,7 @@ miscsettings.infobar_show_res Auflösung anzeigen miscsettings.infobar_show_res_simple einfach miscsettings.infobar_show_sysfs_hdd Füllstandanzeige (sysFS & hdd) miscsettings.infobar_show_tuner Aktiven Tuner anzeigen +miscsettings.infoclock Info Uhr miscsettings.progressbar Fortschrittsbalken miscsettings.progressbar_color Farbe miscsettings.progressbar_design Design diff --git a/data/locale/english.locale b/data/locale/english.locale index e2c3bed7f..03da9eb02 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -256,6 +256,8 @@ ci.reset_standby Reset after standby ci.settings Conditional access ci.timeout Timeout waiting CI menu ready ci.waiting Waiting for CI answer +clock_size Info clock +clock_size_height Display height clock_switch_off Clock off clock_switch_on Clock on colorchooser.alpha alpha @@ -810,6 +812,7 @@ menu.hint_channellist_foot Show additional information\nin bottom box menu.hint_channellist_setup Configure channel list GUI options menu.hint_channels Open channel list menu.hint_ci Conditional access menu\nto setup your CI CAM or embeded Conax card +menu.hint_clock_size Set the size of the info clock. menu.hint_colors Configure GUI colors menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color @@ -874,6 +877,7 @@ menu.hint_infobar_sat Show current satellite or cable provider menu.hint_infobar_setup Configure infobar options menu.hint_infobar_textcolor Change infobar text color menu.hint_infobar_tuner Show active tuner number icon +menu.hint_infoclock_setup Configure info clock GUI options menu.hint_keep_numbers Keep channel numbers over next scans\nand bouquets editing menu.hint_key_addrecord Assign button to add record timer\nfrom event list menu.hint_key_addremind Assign button to add zap timer\nfrom event list @@ -1240,6 +1244,7 @@ miscsettings.infobar_show_res show resolution on infobar miscsettings.infobar_show_res_simple simple miscsettings.infobar_show_sysfs_hdd Fill level (sysFS & hdd) miscsettings.infobar_show_tuner Display active tuner +miscsettings.infoclock Info clock miscsettings.progressbar Progressbar miscsettings.progressbar_color Color miscsettings.progressbar_design Design diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index 75e063064..e7d3d5aee 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -51,12 +51,16 @@ CInfoClock* CInfoClock::getInstance() void CInfoClock::initVarInfoClock() { - setClockFont(SNeutrinoSettings::FONT_TYPE_MENU_TITLE); Init(); } void CInfoClock::Init() { + static int oldSize = 0; + if (oldSize != g_settings.infoClockFontSize) { + oldSize = g_settings.infoClockFontSize; + setClockFontSize(g_settings.infoClockFontSize); + } int x_old = x, y_old = y, width_old = width, height_old = height; CVolumeHelper::getInstance()->refresh(cl_font); CVolumeHelper::getInstance()->getInfoClockDimensions(&x, &y, &width, &height); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 9760ea225..7d5a0662e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -45,6 +45,8 @@ #include "filebrowser.h" #include "osd_progressbar_setup.h" +#include +#include #include #include #include @@ -545,6 +547,13 @@ int COsdSetup::showOsdSetup() mf->setHint("", LOCALE_MENU_HINT_VOLUME); osd_menu->addItem(mf); + //info clock + CMenuWidget osd_menu_infoclock(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_INFOCLOCK); + showOsdInfoclockSetup(&osd_menu_infoclock); + mf = new CMenuForwarder(LOCALE_MISCSETTINGS_INFOCLOCK, true, NULL, &osd_menu_infoclock, NULL, CRCInput::convertDigitToKey(shortcut++)); + mf->setHint("", LOCALE_MENU_HINT_INFOCLOCK_SETUP); + osd_menu->addItem(mf); + //screenshot CMenuWidget osd_menu_screenshot(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_SCREENSHOT); showOsdScreenShotSetup(&osd_menu_screenshot); @@ -590,12 +599,22 @@ int COsdSetup::showOsdSetup() osd_menu->addItem(mc); int oldVolumeSize = g_settings.volume_size; + int oldInfoClockSize = g_settings.infoClockFontSize; int res = osd_menu->exec(NULL, ""); if (oldVolumeSize != g_settings.volume_size) CVolumeHelper::getInstance()->refresh(); + if (oldInfoClockSize != g_settings.infoClockFontSize) { + CInfoClock::getInstance()->setClockFontSize(g_settings.infoClockFontSize); + CVolumeHelper::getInstance()->refresh(); + if (CNeutrinoApp::getInstance()->isMuted()) { + CAudioMute::getInstance()->enableMuteIcon(false); + CAudioMute::getInstance()->enableMuteIcon(true); + } + } + delete osd_menu; return res; } @@ -785,6 +804,13 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) fontSettings->addItem(mf); w_index++; } +#if 0 + // size of info clock + fontSettings->addItem(GenericMenuSeparatorLine); + CMenuOptionNumberChooser* mn = new CMenuOptionNumberChooser(LOCALE_CLOCK_SIZE, &g_settings.infoClockFontSize, true, 30, 120); + mn->setHint("", LOCALE_MENU_HINT_CLOCK_SIZE); + fontSettings->addItem(mn); +#endif } //osd timeouts @@ -982,6 +1008,17 @@ void COsdSetup::showOsdVolumeSetup(CMenuWidget *menu_volume) menu_volume->addItem(mc); } +//info clock +void COsdSetup::showOsdInfoclockSetup(CMenuWidget *menu_infoclock) +{ + menu_infoclock->addIntroItems(LOCALE_MISCSETTINGS_INFOCLOCK); + + // size of info clock + CMenuOptionNumberChooser* mn = new CMenuOptionNumberChooser(LOCALE_CLOCK_SIZE_HEIGHT, &g_settings.infoClockFontSize, true, 30, 120); + mn->setHint("", LOCALE_MENU_HINT_CLOCK_SIZE); + menu_infoclock->addItem(mn); +} + bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) { if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_CONTRAST_FONTS)) diff --git a/src/gui/osd_setup.h b/src/gui/osd_setup.h index 68ab6ad17..2d30c064e 100644 --- a/src/gui/osd_setup.h +++ b/src/gui/osd_setup.h @@ -68,6 +68,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver void showOsdChanlistSetup(CMenuWidget *menu_chanlist); void showOsdEventlistSetup(CMenuWidget *menu_eventlist); void showOsdVolumeSetup(CMenuWidget *menu_volume); + void showOsdInfoclockSetup(CMenuWidget *menu_infoclock); void showOsdScreenShotSetup(CMenuWidget *menu_screenshot); void paintWindowSize(int w, int h); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 00c84dfda..412494b76 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -821,6 +821,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.pip_width = configfile.getInt32("pip_width", 365); g_settings.pip_height = configfile.getInt32("pip_height", 200); #endif + + g_settings.infoClockFontSize = configfile.getInt32("infoClockFontSize", 34); + if(erg) configfile.setModifiedFlag(true); return erg; @@ -1237,6 +1240,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("pip_width", g_settings.pip_width); configfile.setInt32("pip_height", g_settings.pip_height); #endif + configfile.setInt32("infoClockFontSize", g_settings.infoClockFontSize); configfile.setInt32("easymenu", g_settings.easymenu); if(strcmp(fname, NEUTRINO_SETTINGS_FILE)) configfile.saveConfig(fname); diff --git a/src/neutrino_menue.h b/src/neutrino_menue.h index db23a4254..8a466f5a5 100644 --- a/src/neutrino_menue.h +++ b/src/neutrino_menue.h @@ -64,6 +64,7 @@ enum MN_WIDGET_ID MN_WIDGET_ID_OSDSETUP_TIMEOUT, MN_WIDGET_ID_OSDSETUP_SCREENSHOT, MN_WIDGET_ID_OSDSETUP_VOLUME, + MN_WIDGET_ID_OSDSETUP_INFOCLOCK, //actually it does not matter, but these 6 entries must be the same order as in menu MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU, MN_WIDGET_ID_OSDSETUP_FONTSIZE_CHANNELLIST, diff --git a/src/system/locals.h b/src/system/locals.h index e21369699..8677c2965 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -283,6 +283,8 @@ typedef enum LOCALE_CI_SETTINGS, LOCALE_CI_TIMEOUT, LOCALE_CI_WAITING, + LOCALE_CLOCK_SIZE, + LOCALE_CLOCK_SIZE_HEIGHT, LOCALE_CLOCK_SWITCH_OFF, LOCALE_CLOCK_SWITCH_ON, LOCALE_COLORCHOOSER_ALPHA, @@ -837,6 +839,7 @@ typedef enum LOCALE_MENU_HINT_CHANNELLIST_SETUP, LOCALE_MENU_HINT_CHANNELS, LOCALE_MENU_HINT_CI, + LOCALE_MENU_HINT_CLOCK_SIZE, LOCALE_MENU_HINT_COLORS, LOCALE_MENU_HINT_CONTENT_BACK, LOCALE_MENU_HINT_CONTENT_TEXTCOLOR, @@ -901,6 +904,7 @@ typedef enum LOCALE_MENU_HINT_INFOBAR_SETUP, LOCALE_MENU_HINT_INFOBAR_TEXTCOLOR, LOCALE_MENU_HINT_INFOBAR_TUNER, + LOCALE_MENU_HINT_INFOCLOCK_SETUP, LOCALE_MENU_HINT_KEEP_NUMBERS, LOCALE_MENU_HINT_KEY_ADDRECORD, LOCALE_MENU_HINT_KEY_ADDREMIND, @@ -1267,6 +1271,7 @@ typedef enum LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES_SIMPLE, LOCALE_MISCSETTINGS_INFOBAR_SHOW_SYSFS_HDD, LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, + LOCALE_MISCSETTINGS_INFOCLOCK, LOCALE_MISCSETTINGS_PROGRESSBAR, LOCALE_MISCSETTINGS_PROGRESSBAR_COLOR, LOCALE_MISCSETTINGS_PROGRESSBAR_DESIGN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index a57c08737..71f95daab 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -283,6 +283,8 @@ const char * locale_real_names[] = "ci.settings", "ci.timeout", "ci.waiting", + "clock_size", + "clock_size_height", "clock_switch_off", "clock_switch_on", "colorchooser.alpha", @@ -837,6 +839,7 @@ const char * locale_real_names[] = "menu.hint_channellist_setup", "menu.hint_channels", "menu.hint_ci", + "menu.hint_clock_size", "menu.hint_colors", "menu.hint_content_back", "menu.hint_content_textcolor", @@ -901,6 +904,7 @@ const char * locale_real_names[] = "menu.hint_infobar_setup", "menu.hint_infobar_textcolor", "menu.hint_infobar_tuner", + "menu.hint_infoclock_setup", "menu.hint_keep_numbers", "menu.hint_key_addrecord", "menu.hint_key_addremind", @@ -1267,6 +1271,7 @@ const char * locale_real_names[] = "miscsettings.infobar_show_res_simple", "miscsettings.infobar_show_sysfs_hdd", "miscsettings.infobar_show_tuner", + "miscsettings.infoclock", "miscsettings.progressbar", "miscsettings.progressbar_color", "miscsettings.progressbar_design", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 8e8dde7f9..b2ca12c00 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include @@ -322,10 +321,6 @@ bool CFontSizeNotifier::changeNotify(const neutrino_locale_t, void *) hintBox.hide(); /* recalculate infoclock/muteicon/volumebar */ CVolumeHelper::getInstance()->refresh(); - if (CNeutrinoApp::getInstance()->isMuted()) { - CAudioMute::getInstance()->enableMuteIcon(false); - CAudioMute::getInstance()->enableMuteIcon(true); - } return true; } diff --git a/src/system/settings.h b/src/system/settings.h index 5d73ae098..150c80006 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -538,6 +538,8 @@ struct SNeutrinoSettings FONT_TYPE_COUNT }; + int infoClockFontSize; + // lcdd enum LCD_SETTINGS { LCD_BRIGHTNESS = 0,