From a9fab1322015d546483a3bae9755e9203fb4e5a4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 21 Oct 2024 21:44:57 +0200 Subject: [PATCH] infoviewer: enable weather data Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f988d129b59d898a923d9bca607e35e08b83211d Author: vanhofen Date: 2024-10-21 (Mon, 21 Oct 2024) Origin message was: ------------------ - infoviewer: enable weather data ------------------ 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/infoviewer.cpp | 14 +++++++------- src/gui/osd_setup.cpp | 5 +++++ src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 8 files changed, 23 insertions(+), 7 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index d7975a6b9..130cebd25 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1500,6 +1500,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_infobar_weather Zeigt aktuelle Wetterdaten menu.hint_infoclock_setup Wählen Sie die Anzeigeoptionen für die Info Uhr menu.hint_infoicons_background Legt fest, ob die Infoicons mit oder ohne Hintergrund gezeigt werden sollen menu.hint_infoicons_flag_all Alle Benachrichtigungen zurücksetzen @@ -2038,6 +2039,7 @@ miscsettings.infobar_show_res Auflösung anzeigen miscsettings.infobar_show_res_simple einfach miscsettings.infobar_show_sysfs_hdd Füllstandsanzeige (SysFS und HDD) miscsettings.infobar_show_tuner Aktiven Tuner anzeigen +miscsettings.infobar_weather Wetter miscsettings.infoclock Uhr miscsettings.onlineservices Online-Dienste miscsettings.progressbar Fortschrittsbalken diff --git a/data/locale/english.locale b/data/locale/english.locale index ca0703d92..b2ce87ccc 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1500,6 +1500,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_infobar_weather Shows current weather data menu.hint_infoclock_setup Configure info clock GUI options menu.hint_infoicons_background Determines whether the Infoicons should be shown with or without background menu.hint_infoicons_flag_all Reset all flagfiles @@ -2038,6 +2039,7 @@ miscsettings.infobar_show_res Show resolution on infobar miscsettings.infobar_show_res_simple simple miscsettings.infobar_show_sysfs_hdd Fill level (SysFS and HDD) miscsettings.infobar_show_tuner Display active tuner +miscsettings.infobar_weather Weather miscsettings.infoclock Clock miscsettings.onlineservices Online services miscsettings.progressbar Progressbar diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 47ac66235..27af5bcca 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -530,8 +530,6 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (!zap_mode) infoViewerBB->paintshowButtonBar(); - //weather->show(BoxStartX, g_settings.screen_StartY + OFFSET_INNER_MID); - int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8; int ChannelLogoMode = 0; if (g_settings.infobar_show_channellogo > 1) @@ -718,12 +716,14 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap if (!g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_INFOVIEWER) CInfoIcons::getInstance()->paintIcons(true); + // Weather below InfoIcons + if (g_settings.weather_enabled && g_settings.infobar_weather) + weather->show(BoxStartX, CInfoIcons::getInstance()->getHeightRel() + OFFSET_INNER_SMALL); + if (showButtonBar) { infoViewerBB->paintshowButtonBar(noTimer); } - //weather->show(BoxStartX, g_settings.screen_StartY + OFFSET_INNER_MID); - int ChanNumWidth = 0; int ChannelLogoMode = 0; bool logo_ok = false; @@ -2084,13 +2084,13 @@ void CInfoViewer::killTitle() is_visible = false; infoViewerBB->is_visible = false; - if (weather) - weather->hide(); - //NI InfoIcons if (!g_settings.mode_icons && g_settings.mode_icons_skin == INFOICONS_INFOVIEWER) CInfoIcons::getInstance()->hideIcons(); + if (weather) + weather->hide(); + //NI hide ecm.info if (g_settings.show_ecm) ecmInfoBox_hide(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index be389027f..8ccf5af40 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1307,6 +1307,11 @@ void COsdSetup::showOsdInfobarSetup(CMenuWidget *menu_infobar) mc->setHint("", LOCALE_MENU_HINT_INFOBAR_ANALOGCLOCK); menu_infobar->addItem(mc); + // weather + mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_INFOBAR_WEATHER, &g_settings.infobar_weather, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.weather_enabled); + mc->setHint("", LOCALE_MENU_HINT_INFOBAR_WEATHER); + menu_infobar->addItem(mc); + menu_infobar->addItem(GenericMenuSeparator); // display options diff --git a/src/neutrino.cpp b/src/neutrino.cpp index a5b626e4d..336dfa6ac 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1283,6 +1283,7 @@ int CNeutrinoApp::loadSetup(const char *fname) g_settings.infobar_show_sysfs_hdd = configfile.getBool("infobar_show_sysfs_hdd", false); g_settings.infobar_show_tuner = configfile.getInt32("infobar_show_tuner", 1); g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos", 4); + g_settings.infobar_weather = configfile.getInt32("infobar_weather", 0); g_settings.scrambled_message = configfile.getBool("scrambled_message", false); @@ -2178,6 +2179,7 @@ void CNeutrinoApp::saveSetup(const char *fname) configfile.setBool("infobar_show_sysfs_hdd", g_settings.infobar_show_sysfs_hdd); configfile.setInt32("infobar_show_tuner", g_settings.infobar_show_tuner); configfile.setInt32("infobar_subchan_disp_pos", g_settings.infobar_subchan_disp_pos); + configfile.setInt32("infobar_weather", g_settings.infobar_weather); configfile.setBool("scrambled_message", g_settings.scrambled_message); diff --git a/src/system/locals.h b/src/system/locals.h index 89070f826..7debe6cc6 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1527,6 +1527,7 @@ typedef enum LOCALE_MENU_HINT_INFOBAR_SETUP, LOCALE_MENU_HINT_INFOBAR_TEXTCOLOR, LOCALE_MENU_HINT_INFOBAR_TUNER, + LOCALE_MENU_HINT_INFOBAR_WEATHER, LOCALE_MENU_HINT_INFOCLOCK_SETUP, LOCALE_MENU_HINT_INFOICONS_BACKGROUND, LOCALE_MENU_HINT_INFOICONS_FLAG_ALL, @@ -2065,6 +2066,7 @@ typedef enum LOCALE_MISCSETTINGS_INFOBAR_SHOW_RES_SIMPLE, LOCALE_MISCSETTINGS_INFOBAR_SHOW_SYSFS_HDD, LOCALE_MISCSETTINGS_INFOBAR_SHOW_TUNER, + LOCALE_MISCSETTINGS_INFOBAR_WEATHER, LOCALE_MISCSETTINGS_INFOCLOCK, LOCALE_MISCSETTINGS_ONLINESERVICES, LOCALE_MISCSETTINGS_PROGRESSBAR, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e9e6e2872..e86170d88 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1527,6 +1527,7 @@ const char * locale_real_names[] = "menu.hint_infobar_setup", "menu.hint_infobar_textcolor", "menu.hint_infobar_tuner", + "menu.hint_infobar_weather", "menu.hint_infoclock_setup", "menu.hint_infoicons_background", "menu.hint_infoicons_flag_all", @@ -2065,6 +2066,7 @@ const char * locale_real_names[] = "miscsettings.infobar_show_res_simple", "miscsettings.infobar_show_sysfs_hdd", "miscsettings.infobar_show_tuner", + "miscsettings.infobar_weather", "miscsettings.infoclock", "miscsettings.onlineservices", "miscsettings.progressbar", diff --git a/src/system/settings.h b/src/system/settings.h index 1e913a187..e51013e97 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -1098,6 +1098,7 @@ struct SNeutrinoSettings int infobar_show_sysfs_hdd; int infobar_show_tuner; int infobar_subchan_disp_pos; + int infobar_weather; int scrambled_message;