mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-31 09:21:18 +02:00
- weather: introduce weather_favorites.xml
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -41,8 +41,10 @@ CWeatherSetup::CWeatherSetup()
|
||||
{
|
||||
width = 40;
|
||||
selected = -1;
|
||||
|
||||
locations.clear();
|
||||
loadLocations();
|
||||
loadLocations(CONFIGDIR "/weather_favorites.xml");
|
||||
loadLocations(WEATHERDIR "/weather_locations.xml");
|
||||
}
|
||||
|
||||
CWeatherSetup::~CWeatherSetup()
|
||||
@@ -155,13 +157,13 @@ bool CWeatherSetup::changeNotify(const neutrino_locale_t OptionName, void */*dat
|
||||
return ret;
|
||||
}
|
||||
|
||||
void CWeatherSetup::loadLocations()
|
||||
void CWeatherSetup::loadLocations(std::string filename)
|
||||
{
|
||||
xmlDocPtr parser = parseXmlFile(CONFIGDIR "/weather_locations.xml");
|
||||
xmlDocPtr parser = parseXmlFile(filename.c_str());
|
||||
|
||||
if (parser == NULL)
|
||||
{
|
||||
dprintf(DEBUG_INFO, "failed to load weather_locations.xml\n");
|
||||
dprintf(DEBUG_INFO, "failed to load %s\n", filename.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -19,6 +19,8 @@
|
||||
#ifndef __weather_setup__
|
||||
#define __weather_setup__
|
||||
|
||||
#define WEATHERDIR DATADIR "/neutrino/weather/"
|
||||
|
||||
#include <gui/widget/menue.h>
|
||||
|
||||
#include <string>
|
||||
@@ -41,7 +43,7 @@ class CWeatherSetup : public CMenuTarget, CChangeObserver
|
||||
|
||||
int showWeatherSetup();
|
||||
int showSelectWeatherLocation();
|
||||
void loadLocations();
|
||||
void loadLocations(std::string filename);
|
||||
|
||||
public:
|
||||
CWeatherSetup();
|
||||
|
Reference in New Issue
Block a user