mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
update glcd
Origin commit data
------------------
Branch: ni/coolstream
Commit: 0c2dcc9eb1
Author: redblue-pkt <redblue-pkt@orange.pl>
Date: 2020-06-19 (Fri, 19 Jun 2020)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -36,6 +36,8 @@
|
||||
#include <gui/miscsettings_menu.h>
|
||||
#include <gui/weather.h>
|
||||
#include <gui/weather_locations.h>
|
||||
#include <gui/weather_deutschland_locations.h>
|
||||
#include <gui/weather_norway_locations.h>
|
||||
#include <gui/cec_setup.h>
|
||||
#include <gui/filebrowser.h>
|
||||
#include <gui/infoicons_setup.h>
|
||||
@@ -177,6 +179,13 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
return showMiscSettingsMenu();
|
||||
}
|
||||
|
||||
#define WEATHER_COUNTRY_OPTION_COUNT 2
|
||||
const CMenuOptionChooser::keyval WEATHER_COUNTRY_OPTIONS[WEATHER_COUNTRY_OPTION_COUNT] =
|
||||
{
|
||||
{ 0, LOCALE_WEATHER_COUNTRY_DEUTSCHLAND },
|
||||
{ 1, LOCALE_WEATHER_COUNTRY_NORWAY }
|
||||
};
|
||||
|
||||
#if 0 //not used
|
||||
#define MISCSETTINGS_FB_DESTINATION_OPTION_COUNT 3
|
||||
const CMenuOptionChooser::keyval MISCSETTINGS_FB_DESTINATION_OPTIONS[MISCSETTINGS_FB_DESTINATION_OPTION_COUNT] =
|
||||
@@ -618,6 +627,9 @@ int CMiscMenue::showMiscSettingsMenuOnlineServices()
|
||||
mf_we->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_WEATHER_API_KEY);
|
||||
ms_oservices->addItem(mf_we);
|
||||
#endif
|
||||
CMenuOptionChooser *mf_wc = new CMenuOptionChooser(LOCALE_WEATHER_COUNTRY, &g_settings.weather_country, WEATHER_COUNTRY_OPTIONS, WEATHER_COUNTRY_OPTION_COUNT, true);
|
||||
mf_wc->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_WEATHER_COUNTRY);
|
||||
ms_oservices->addItem(mf_wc);
|
||||
|
||||
CMenuForwarder *mf_wl = new CMenuForwarder(LOCALE_WEATHER_LOCATION, g_settings.weather_enabled, g_settings.weather_city, this, "select_location");
|
||||
mf_wl->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_WEATHER_LOCATION);
|
||||
@@ -719,7 +731,17 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation()
|
||||
int select = 0;
|
||||
int res = 0;
|
||||
|
||||
if (WEATHER_LOCATION_OPTION_COUNT > 1)
|
||||
int location_option_count = 0;
|
||||
const struct weather_loc *location = NULL;
|
||||
if (g_settings.weather_country == DEUTSCHLAND) {
|
||||
location_option_count = WEATHER_DEUTSCHLAND_LOCATION_OPTION_COUNT;
|
||||
location = WEATHER_DEUTSCHLAND_LOCATION_OPTIONS;
|
||||
} else if (g_settings.weather_country == NORWAY) {
|
||||
location_option_count = WEATHER_NORWAY_LOCATION_OPTION_COUNT;
|
||||
location = WEATHER_NORWAY_LOCATION_OPTIONS;
|
||||
}
|
||||
|
||||
if (location_option_count > 1)
|
||||
{
|
||||
CMenuWidget *m = new CMenuWidget(LOCALE_WEATHER_LOCATION, NEUTRINO_ICON_LANGUAGE);
|
||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
||||
@@ -727,10 +749,10 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation()
|
||||
m->addItem(GenericMenuSeparator);
|
||||
|
||||
CMenuForwarder* mf;
|
||||
for (size_t i = 0; i < WEATHER_LOCATION_OPTION_COUNT; i++)
|
||||
for (int i = 0; i < location_option_count; i++)
|
||||
{
|
||||
mf = new CMenuForwarder(WEATHER_LOCATION_OPTIONS[i].key, true, NULL, selector, to_string(i).c_str());
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, WEATHER_LOCATION_OPTIONS[i].value.c_str());
|
||||
mf = new CMenuForwarder(location[i].key, true, NULL, selector, to_string(i).c_str());
|
||||
mf->setHint(NEUTRINO_ICON_HINT_SETTINGS, location[i].value.c_str());
|
||||
m->addItem(mf);
|
||||
}
|
||||
|
||||
@@ -742,8 +764,8 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation()
|
||||
|
||||
delete selector;
|
||||
}
|
||||
g_settings.weather_location = WEATHER_LOCATION_OPTIONS[select].value;
|
||||
g_settings.weather_city = std::string(WEATHER_LOCATION_OPTIONS[select].key);
|
||||
g_settings.weather_location = location[select].value;
|
||||
g_settings.weather_city = std::string(location[select].key);
|
||||
CWeather::getInstance()->setCoords(g_settings.weather_location, g_settings.weather_city);
|
||||
return res;
|
||||
}
|
||||
|
Reference in New Issue
Block a user