diff --git a/configure.ac b/configure.ac index 7d7af1394..7d770ea96 100644 --- a/configure.ac +++ b/configure.ac @@ -448,6 +448,7 @@ data/themes/Neutrino-3.0/icons/buttons/Makefile data/themes/Olive-3.0/Makefile data/themes/Olive-3.0/icons/Makefile data/themes/Olive-3.0/icons/buttons/Makefile +data/weather/Makefile data/webradio/Makefile data/webtv/Makefile data/y-web/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index 76e210395..b816ff3d1 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -12,6 +12,7 @@ SUBDIRS = \ policy \ scripts \ themes \ + weather \ webradio \ webtv \ y-web \ diff --git a/data/config/Makefile.am b/data/config/Makefile.am index 9ab7f62b7..ddca88619 100644 --- a/data/config/Makefile.am +++ b/data/config/Makefile.am @@ -11,8 +11,7 @@ install_DATA = \ providermap.xml \ satellites.xml \ terrestrial.xml \ - tobackup.conf \ - weather_locations.xml + tobackup.conf if ENABLE_EXTUPDATE EXTRA_DIST += \ diff --git a/data/weather/Makefile.am b/data/weather/Makefile.am new file mode 100644 index 000000000..8c03d08a1 --- /dev/null +++ b/data/weather/Makefile.am @@ -0,0 +1,9 @@ +configdir = $(CONFIGDIR) + +config_DATA = \ + weather_favorites.xml + +weatherdir = $(DATADIR)/neutrino/weather + +weather_DATA = \ + weather_locations.xml diff --git a/data/weather/weather_favorites.xml b/data/weather/weather_favorites.xml new file mode 100644 index 000000000..a77217fa6 --- /dev/null +++ b/data/weather/weather_favorites.xml @@ -0,0 +1,6 @@ + + + + diff --git a/data/config/weather_locations.xml b/data/weather/weather_locations.xml similarity index 100% rename from data/config/weather_locations.xml rename to data/weather/weather_locations.xml diff --git a/src/gui/weather_setup.cpp b/src/gui/weather_setup.cpp index e5223bf10..6cafa4b3f 100644 --- a/src/gui/weather_setup.cpp +++ b/src/gui/weather_setup.cpp @@ -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; } diff --git a/src/gui/weather_setup.h b/src/gui/weather_setup.h index 27cc61231..19ea079ea 100644 --- a/src/gui/weather_setup.h +++ b/src/gui/weather_setup.h @@ -19,6 +19,8 @@ #ifndef __weather_setup__ #define __weather_setup__ +#define WEATHERDIR DATADIR "/neutrino/weather/" + #include #include @@ -41,7 +43,7 @@ class CWeatherSetup : public CMenuTarget, CChangeObserver int showWeatherSetup(); int showSelectWeatherLocation(); - void loadLocations(); + void loadLocations(std::string filename); public: CWeatherSetup();