mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-03 19:01:25 +02:00
- weather: add WEATHER_DEFAULT defines
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -113,8 +113,8 @@ int CWeatherSetup::showSelectWeatherLocation()
|
||||
{
|
||||
// TODO: localize hint
|
||||
ShowHint("Warning", "Failed to load weather-favorites.xml or weather-locations.xml\nPlease press any key or wait some seconds! ...", 700, 10, NULL, NEUTRINO_ICON_HINT_IMAGEINFO, CComponentsHeader::CC_BTN_EXIT);
|
||||
g_settings.weather_location = "52.52,13.40";
|
||||
g_settings.weather_city = "Berlin";
|
||||
g_settings.weather_location = WEATHER_DEFAULT_LOCATION;
|
||||
g_settings.weather_city = WEATHER_DEFAULT_CITY;
|
||||
CWeather::getInstance()->setCoords(g_settings.weather_location, g_settings.weather_city);
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
@@ -157,7 +157,8 @@ int CWeatherSetup::showSelectWeatherLocation()
|
||||
int CWeatherSetup::findLocation()
|
||||
{
|
||||
int ret = menu_return::RETURN_REPAINT;
|
||||
int postcode = 10178;
|
||||
|
||||
int postcode = WEATHER_DEFAULT_POSTCODE;
|
||||
CIntInput zipcode(LOCALE_WEATHER_LOCATION_POSTCODE, &postcode, (unsigned int)5);
|
||||
ret = zipcode.exec(NULL, "");
|
||||
zipcode.hide();
|
||||
|
@@ -21,6 +21,10 @@
|
||||
|
||||
#define WEATHERDIR DATADIR "/neutrino/weather/"
|
||||
|
||||
#define WEATHER_DEFAULT_CITY "Berlin"
|
||||
#define WEATHER_DEFAULT_LOCATION "52.52,13.40"
|
||||
#define WEATHER_DEFAULT_POSTCODE 10178
|
||||
|
||||
#include <gui/widget/menue.h>
|
||||
|
||||
#include <string>
|
||||
|
@@ -104,6 +104,7 @@
|
||||
#include "gui/videosettings.h"
|
||||
#include "gui/audio_select.h"
|
||||
#include "gui/weather.h"
|
||||
#include "gui/weather_setup.h"
|
||||
#include "gui/webchannels_setup.h"
|
||||
|
||||
#include "gui/widget/hintbox.h"
|
||||
@@ -1111,8 +1112,8 @@ int CNeutrinoApp::loadSetup(const char *fname)
|
||||
g_settings.weather_enabled = configfile.getInt32("weather_enabled", 1);
|
||||
g_settings.weather_enabled = g_settings.weather_enabled && CApiKey::check_weather_api_key();
|
||||
|
||||
g_settings.weather_location = configfile.getString("weather_location", "52.52,13.40");
|
||||
g_settings.weather_city = configfile.getString("weather_city", "Berlin");
|
||||
g_settings.weather_city = configfile.getString("weather_city", WEATHER_DEFAULT_CITY);
|
||||
g_settings.weather_location = configfile.getString("weather_location", WEATHER_DEFAULT_LOCATION);
|
||||
|
||||
g_settings.youtube_dev_id = YT_DEV_KEY;
|
||||
#if ENABLE_YOUTUBE_KEY_MANAGE
|
||||
@@ -2103,8 +2104,8 @@ void CNeutrinoApp::saveSetup(const char *fname)
|
||||
#endif
|
||||
configfile.setInt32("weather_enabled", g_settings.weather_enabled);
|
||||
|
||||
configfile.setString("weather_location", g_settings.weather_location);
|
||||
configfile.setString("weather_city", g_settings.weather_city);
|
||||
configfile.setString("weather_location", g_settings.weather_location);
|
||||
|
||||
#if ENABLE_YOUTUBE_KEY_MANAGE
|
||||
configfile.setString("youtube_dev_id", g_settings.youtube_dev_id);
|
||||
|
@@ -909,8 +909,8 @@ struct SNeutrinoSettings
|
||||
std::string weather_api_key;
|
||||
int weather_enabled;
|
||||
|
||||
std::string weather_location;
|
||||
std::string weather_city;
|
||||
std::string weather_location;
|
||||
|
||||
std::string youtube_dev_id;
|
||||
int youtube_enabled;
|
||||
|
Reference in New Issue
Block a user