weather: introduce weather_favorites.xml

Origin commit data
------------------
Branch: ni/coolstream
Commit: 9d8eb37ec6
Author: vanhofen <vanhofen@gmx.de>
Date: 2022-01-18 (Tue, 18 Jan 2022)

Origin message was:
------------------
- weather: introduce weather_favorites.xml

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2022-01-18 23:31:53 +01:00
parent 972e0d606f
commit adacccb63b
8 changed files with 27 additions and 7 deletions

View File

@@ -452,6 +452,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

View File

@@ -12,6 +12,7 @@ SUBDIRS = \
policy \
scripts \
themes \
weather \
webradio \
webtv \
y-web \

View File

@@ -11,8 +11,7 @@ install_DATA = \
providermap.xml \
satellites.xml \
terrestrial.xml \
tobackup.conf \
weather_locations.xml
tobackup.conf
if ENABLE_EXTUPDATE
EXTRA_DIST += \

9
data/weather/Makefile.am Normal file
View File

@@ -0,0 +1,9 @@
configdir = $(CONFIGDIR)
config_DATA = \
weather_favorites.xml
weatherdir = $(DATADIR)/neutrino/weather
weather_DATA = \
weather_locations.xml

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<weather>
<!--
<location country="Country" city="City" latitude="xx.xxx" longitude="yy.yyy"/>
-->
</weather>

View File

@@ -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;
}

View File

@@ -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();