From e97e33532b2adea7bc0c9eaabe8862acf38d775b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 10 Dec 2013 02:38:43 +0100 Subject: [PATCH] - infoclock: add some features * add shadow to infoclock * rename some locals * change default height of clock * add option to switch bachground on/off (default off) * add option to switch seconds on/off (default on) --- data/locale/deutsch.locale | 8 ++++++-- data/locale/english.locale | 8 ++++++-- src/gui/infoclock.cpp | 10 +++++++++- src/gui/osd_setup.cpp | 10 ++++++++++ src/neutrino.cpp | 6 +++++- src/system/locals.h | 4 ++++ src/system/locals_intern.h | 4 ++++ src/system/settings.h | 2 ++ 8 files changed, 46 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bcc3522e3..9b3d6a51f 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_background Hintergrund anzeigen +clock_seconds Sekunden anzeigen clock_size_height Höhe der Anzeige clock_switch_off Uhr ausblenden clock_switch_on Uhr einblenden @@ -811,8 +813,10 @@ 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_background Lassen Sie die Uhr mit Hintergrund anzeigen menu.hint_clock_mode Schalten Sie die Uhr ein oder aus -menu.hint_clock_size Stellen Sie die Größe der Info Uhr ein. +menu.hint_clock_seconds Legen Sie fest, ob die Sekunden angezeigt werden sollen +menu.hint_clock_size Stellen Sie die Größe der 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 @@ -1244,7 +1248,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.infoclock 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 91497394d..b7cade51e 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_background Show background +clock_seconds Show seconds clock_size_height Display height clock_switch_off Clock off clock_switch_on Clock on @@ -811,8 +813,10 @@ 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_background Show clock with theme's background color menu.hint_clock_mode Switch clock on or off -menu.hint_clock_size Set the size of the info clock. +menu.hint_clock_seconds Show time format with seconds +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 @@ -1244,7 +1248,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.infoclock 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 e7d690546..d566f6981 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -36,7 +36,7 @@ -CInfoClock::CInfoClock():CComponentsFrmClock( 0, 0, 0, 50, "%H:%M:%S", true, CC_SHADOW_OFF, COL_LIGHT_GRAY, COL_MENUCONTENT_PLUS_0,COL_MENUCONTENTDARK_PLUS_0) +CInfoClock::CInfoClock():CComponentsFrmClock( 0, 0, 0, 50, "%H:%M:%S", true, CC_SHADOW_ON, COL_LIGHT_GRAY, COL_MENUCONTENT_PLUS_0,COL_MENUCONTENTDARK_PLUS_0) { initVarInfoClock(); } @@ -65,6 +65,14 @@ void CInfoClock::Init() //use current theme colors syncSysColors(); + paint_bg = g_settings.infoClockBackground; + + if (g_settings.infoClockSeconds) + setClockFormat("%H:%M:%S"); + else + setClockFormat("%H:%M"); + + 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 a294d58d8..4dc6d19c1 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1016,6 +1016,16 @@ void COsdSetup::showOsdInfoclockSetup(CMenuWidget *menu_infoclock) 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); + + // clock with seconds + CMenuOptionChooser *mc = new CMenuOptionChooser(LOCALE_CLOCK_SECONDS, &g_settings.infoClockSeconds, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CLOCK_SECONDS); + menu_infoclock->addItem(mc); + + // clock with background + mc = new CMenuOptionChooser(LOCALE_CLOCK_BACKGROUND, &g_settings.infoClockBackground, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CLOCK_BACKGROUND); + menu_infoclock->addItem(mc); } bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 014b184b7..a88f3ad7f 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -822,7 +822,9 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.pip_height = configfile.getInt32("pip_height", 200); #endif - g_settings.infoClockFontSize = configfile.getInt32("infoClockFontSize", 34); + g_settings.infoClockFontSize = configfile.getInt32("infoClockFontSize", 30); + g_settings.infoClockBackground = configfile.getInt32("infoClockBackground", 0); + g_settings.infoClockSeconds = configfile.getInt32("infoClockSeconds", 1); if(erg) configfile.setModifiedFlag(true); @@ -1241,6 +1243,8 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("pip_height", g_settings.pip_height); #endif configfile.setInt32("infoClockFontSize", g_settings.infoClockFontSize); + configfile.setInt32("infoClockBackground", g_settings.infoClockBackground); + configfile.setInt32("infoClockSeconds", g_settings.infoClockSeconds); configfile.setInt32("easymenu", g_settings.easymenu); if(strcmp(fname, NEUTRINO_SETTINGS_FILE)) configfile.saveConfig(fname); diff --git a/src/system/locals.h b/src/system/locals.h index 00081fbb1..cfc304ca6 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_BACKGROUND, + LOCALE_CLOCK_SECONDS, LOCALE_CLOCK_SIZE_HEIGHT, LOCALE_CLOCK_SWITCH_OFF, LOCALE_CLOCK_SWITCH_ON, @@ -838,7 +840,9 @@ typedef enum LOCALE_MENU_HINT_CHANNELLIST_SETUP, LOCALE_MENU_HINT_CHANNELS, LOCALE_MENU_HINT_CI, + LOCALE_MENU_HINT_CLOCK_BACKGROUND, LOCALE_MENU_HINT_CLOCK_MODE, + LOCALE_MENU_HINT_CLOCK_SECONDS, LOCALE_MENU_HINT_CLOCK_SIZE, LOCALE_MENU_HINT_COLORS, LOCALE_MENU_HINT_CONTENT_BACK, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e739247ea..ea8497b7b 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_background", + "clock_seconds", "clock_size_height", "clock_switch_off", "clock_switch_on", @@ -838,7 +840,9 @@ const char * locale_real_names[] = "menu.hint_channellist_setup", "menu.hint_channels", "menu.hint_ci", + "menu.hint_clock_background", "menu.hint_clock_mode", + "menu.hint_clock_seconds", "menu.hint_clock_size", "menu.hint_colors", "menu.hint_content_back", diff --git a/src/system/settings.h b/src/system/settings.h index 150c80006..10aec2a58 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -539,6 +539,8 @@ struct SNeutrinoSettings }; int infoClockFontSize; + int infoClockSeconds; + int infoClockBackground; // lcdd enum LCD_SETTINGS {