mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
- weather: introduce weather_favorites.xml
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -448,6 +448,7 @@ data/themes/Neutrino-3.0/icons/buttons/Makefile
|
|||||||
data/themes/Olive-3.0/Makefile
|
data/themes/Olive-3.0/Makefile
|
||||||
data/themes/Olive-3.0/icons/Makefile
|
data/themes/Olive-3.0/icons/Makefile
|
||||||
data/themes/Olive-3.0/icons/buttons/Makefile
|
data/themes/Olive-3.0/icons/buttons/Makefile
|
||||||
|
data/weather/Makefile
|
||||||
data/webradio/Makefile
|
data/webradio/Makefile
|
||||||
data/webtv/Makefile
|
data/webtv/Makefile
|
||||||
data/y-web/Makefile
|
data/y-web/Makefile
|
||||||
|
@@ -12,6 +12,7 @@ SUBDIRS = \
|
|||||||
policy \
|
policy \
|
||||||
scripts \
|
scripts \
|
||||||
themes \
|
themes \
|
||||||
|
weather \
|
||||||
webradio \
|
webradio \
|
||||||
webtv \
|
webtv \
|
||||||
y-web \
|
y-web \
|
||||||
|
@@ -11,8 +11,7 @@ install_DATA = \
|
|||||||
providermap.xml \
|
providermap.xml \
|
||||||
satellites.xml \
|
satellites.xml \
|
||||||
terrestrial.xml \
|
terrestrial.xml \
|
||||||
tobackup.conf \
|
tobackup.conf
|
||||||
weather_locations.xml
|
|
||||||
|
|
||||||
if ENABLE_EXTUPDATE
|
if ENABLE_EXTUPDATE
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
|
9
data/weather/Makefile.am
Normal file
9
data/weather/Makefile.am
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
configdir = $(CONFIGDIR)
|
||||||
|
|
||||||
|
config_DATA = \
|
||||||
|
weather_favorites.xml
|
||||||
|
|
||||||
|
weatherdir = $(DATADIR)/neutrino/weather
|
||||||
|
|
||||||
|
weather_DATA = \
|
||||||
|
weather_locations.xml
|
6
data/weather/weather_favorites.xml
Normal file
6
data/weather/weather_favorites.xml
Normal 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>
|
@@ -41,8 +41,10 @@ CWeatherSetup::CWeatherSetup()
|
|||||||
{
|
{
|
||||||
width = 40;
|
width = 40;
|
||||||
selected = -1;
|
selected = -1;
|
||||||
|
|
||||||
locations.clear();
|
locations.clear();
|
||||||
loadLocations();
|
loadLocations(CONFIGDIR "/weather_favorites.xml");
|
||||||
|
loadLocations(WEATHERDIR "/weather_locations.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
CWeatherSetup::~CWeatherSetup()
|
CWeatherSetup::~CWeatherSetup()
|
||||||
@@ -155,13 +157,13 @@ bool CWeatherSetup::changeNotify(const neutrino_locale_t OptionName, void */*dat
|
|||||||
return ret;
|
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)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,6 +19,8 @@
|
|||||||
#ifndef __weather_setup__
|
#ifndef __weather_setup__
|
||||||
#define __weather_setup__
|
#define __weather_setup__
|
||||||
|
|
||||||
|
#define WEATHERDIR DATADIR "/neutrino/weather/"
|
||||||
|
|
||||||
#include <gui/widget/menue.h>
|
#include <gui/widget/menue.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@@ -41,7 +43,7 @@ class CWeatherSetup : public CMenuTarget, CChangeObserver
|
|||||||
|
|
||||||
int showWeatherSetup();
|
int showWeatherSetup();
|
||||||
int showSelectWeatherLocation();
|
int showSelectWeatherLocation();
|
||||||
void loadLocations();
|
void loadLocations(std::string filename);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CWeatherSetup();
|
CWeatherSetup();
|
||||||
|
Reference in New Issue
Block a user