mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 01:41:12 +02:00
weather_setup: formatting code using astyle
Origin commit data
------------------
Branch: ni/coolstream
Commit: 40b5b553a3
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-01-18 (Tue, 18 Jan 2022)
Origin message was:
------------------
- weather_setup: formatting code using astyle
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -47,21 +47,21 @@ CWeatherSetup::~CWeatherSetup()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int CWeatherSetup::exec(CMenuTarget* parent, const std::string &actionKey)
|
int CWeatherSetup::exec(CMenuTarget *parent, const std::string &actionKey)
|
||||||
{
|
{
|
||||||
dprintf(DEBUG_DEBUG, "init weather setup menu\n");
|
dprintf(DEBUG_DEBUG, "init weather setup menu\n");
|
||||||
int res = menu_return::RETURN_REPAINT;
|
int res = menu_return::RETURN_REPAINT;
|
||||||
|
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->hide();
|
parent->hide();
|
||||||
|
|
||||||
if(actionKey == "select_location")
|
if (actionKey == "select_location")
|
||||||
{
|
{
|
||||||
return showSelectWeatherLocation();
|
return showSelectWeatherLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
res = showWeatherSetup();
|
res = showWeatherSetup();
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ int CWeatherSetup::showWeatherSetup()
|
|||||||
mf_wl->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_WEATHER_LOCATION);
|
mf_wl->setHint(NEUTRINO_ICON_HINT_SETTINGS, LOCALE_MENU_HINT_WEATHER_LOCATION);
|
||||||
ms_oservices->addItem(mf_wl);
|
ms_oservices->addItem(mf_wl);
|
||||||
|
|
||||||
int res = ms_oservices->exec (NULL, "");
|
int res = ms_oservices->exec(NULL, "");
|
||||||
selected = ms_oservices->getSelected();
|
selected = ms_oservices->getSelected();
|
||||||
delete ms_oservices;
|
delete ms_oservices;
|
||||||
return res;
|
return res;
|
||||||
@@ -101,11 +101,11 @@ int CWeatherSetup::showSelectWeatherLocation()
|
|||||||
if (WEATHER_LOCATION_OPTION_COUNT > 1)
|
if (WEATHER_LOCATION_OPTION_COUNT > 1)
|
||||||
{
|
{
|
||||||
CMenuWidget *m = new CMenuWidget(LOCALE_WEATHER_LOCATION, NEUTRINO_ICON_LANGUAGE);
|
CMenuWidget *m = new CMenuWidget(LOCALE_WEATHER_LOCATION, NEUTRINO_ICON_LANGUAGE);
|
||||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
CMenuSelectorTarget *selector = new CMenuSelectorTarget(&select);
|
||||||
|
|
||||||
m->addItem(GenericMenuSeparator);
|
m->addItem(GenericMenuSeparator);
|
||||||
|
|
||||||
CMenuForwarder* mf;
|
CMenuForwarder *mf;
|
||||||
for (size_t i = 0; i < WEATHER_LOCATION_OPTION_COUNT; i++)
|
for (size_t i = 0; i < WEATHER_LOCATION_OPTION_COUNT; i++)
|
||||||
{
|
{
|
||||||
mf = new CMenuForwarder(WEATHER_LOCATION_OPTIONS[i].key, true, NULL, selector, to_string(i).c_str());
|
mf = new CMenuForwarder(WEATHER_LOCATION_OPTIONS[i].key, true, NULL, selector, to_string(i).c_str());
|
||||||
@@ -121,9 +121,11 @@ int CWeatherSetup::showSelectWeatherLocation()
|
|||||||
|
|
||||||
delete selector;
|
delete selector;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_settings.weather_location = WEATHER_LOCATION_OPTIONS[select].value;
|
g_settings.weather_location = WEATHER_LOCATION_OPTIONS[select].value;
|
||||||
g_settings.weather_city = std::string(WEATHER_LOCATION_OPTIONS[select].key);
|
g_settings.weather_city = std::string(WEATHER_LOCATION_OPTIONS[select].key);
|
||||||
CWeather::getInstance()->setCoords(g_settings.weather_location, g_settings.weather_city);
|
CWeather::getInstance()->setCoords(g_settings.weather_location, g_settings.weather_city);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -28,19 +28,17 @@ class CWeatherSetup : public CMenuTarget, CChangeObserver
|
|||||||
private:
|
private:
|
||||||
int width, selected;
|
int width, selected;
|
||||||
|
|
||||||
CMenuOptionChooser * weather_onoff;
|
CMenuOptionChooser *weather_onoff;
|
||||||
std::string weather_api_key_short;
|
std::string weather_api_key_short;
|
||||||
|
|
||||||
int showWeatherSetup();
|
int showWeatherSetup();
|
||||||
int showSelectWeatherLocation();
|
int showSelectWeatherLocation();
|
||||||
|
|
||||||
|
public:
|
||||||
public:
|
|
||||||
CWeatherSetup();
|
CWeatherSetup();
|
||||||
~CWeatherSetup();
|
~CWeatherSetup();
|
||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
int exec(CMenuTarget *parent, const std::string &actionKey);
|
||||||
bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/);
|
bool changeNotify(const neutrino_locale_t OptionName, void */*data*/);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user