From 0001a72793bf52707c029740f1b1d89e18f8f97e Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 14 Jan 2022 22:43:24 +0100 Subject: [PATCH] - miscsettings-menu: align to Tango Signed-off-by: Thilo Graf --- src/gui/miscsettings_menu.cpp | 37 ++++++----------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 48f20b49d..6f81c7fbc 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -35,8 +35,6 @@ #include #include #include -#include -#include #include #include @@ -187,13 +185,6 @@ 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 } -}; - #define MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT 2 const CMenuOptionChooser::keyval MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTIONS[MISCSETTINGS_FILESYSTEM_IS_UTF8_OPTION_COUNT] = { @@ -648,9 +639,6 @@ 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); @@ -752,20 +740,7 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation() int select = 0; int res = 0; - 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) + if (WEATHER_LOCATION_OPTION_COUNT > 1) { CMenuWidget *m = new CMenuWidget(LOCALE_WEATHER_LOCATION, NEUTRINO_ICON_LANGUAGE); CMenuSelectorTarget *selector = new CMenuSelectorTarget(&select); @@ -773,10 +748,10 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation() m->addItem(GenericMenuSeparator); CMenuForwarder *mf; - for (int i = 0; i < location_option_count; i++) + for (size_t i = 0; i < WEATHER_LOCATION_OPTION_COUNT; i++) { - 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()); + 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()); m->addItem(mf); } @@ -788,8 +763,8 @@ int CMiscMenue::showMiscSettingsSelectWeatherLocation() if (!m->gotAction()) return res; } - g_settings.weather_location = location[select].value; - g_settings.weather_city = std::string(location[select].key); + g_settings.weather_location = WEATHER_LOCATION_OPTIONS[select].value; + g_settings.weather_city = std::string(WEATHER_LOCATION_OPTIONS[select].key); CWeather::getInstance()->setCoords(g_settings.weather_location, g_settings.weather_city); return res; }