summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-01-14 14:20:22 +0100
committerlouis <louis.braun@gmx.de>2015-01-14 14:20:22 +0100
commit3de7f8f13d2cef164b52a8dc1f5b09b3d4e12278 (patch)
tree9618d7f34091562f332a49e9396d24d1e21874fa
parent645f625d79f8181e043fffc5bcbf4ad2a86f036a (diff)
downloadvdr-plugin-skindesigner-3de7f8f13d2cef164b52a8dc1f5b09b3d4e12278.tar.gz
vdr-plugin-skindesigner-3de7f8f13d2cef164b52a8dc1f5b09b3d4e12278.tar.bz2
added weather viewelement to metrix main menu
-rw-r--r--dtd/displaymenu.dtd7
-rw-r--r--libtemplate/templateview.c5
-rw-r--r--skins/metrixhd/themes/default/globals.xml4
-rw-r--r--skins/metrixhd/xmlfiles/displaymenumain.xml47
-rw-r--r--skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml29
-rw-r--r--skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml28
-rw-r--r--skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml3
-rw-r--r--skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml3
-rw-r--r--skinskeleton/xmlfiles/displaymenumain.xml21
-rw-r--r--views/displaychannelview.c5
-rw-r--r--views/displaymenuview.c16
-rw-r--r--views/displaymenuview.h1
-rw-r--r--views/viewhelpers.c7
-rw-r--r--views/viewhelpers.h2
14 files changed, 138 insertions, 40 deletions
diff --git a/dtd/displaymenu.dtd b/dtd/displaymenu.dtd
index 5dc80ef..b14c3da 100644
--- a/dtd/displaymenu.dtd
+++ b/dtd/displaymenu.dtd
@@ -75,6 +75,11 @@
debug CDATA #IMPLIED
>
+<!ELEMENT currentweather (area|areascroll)*>
+<!ATTLIST currentweather
+ debug CDATA #IMPLIED
+>
+
<!ELEMENT customtokens (area|areascroll)*>
<!ATTLIST customtokens
debug CDATA #IMPLIED
@@ -109,7 +114,7 @@
>
<!ELEMENT menumain (background | header | datetime | time | colorbuttons | scrollbar | timers |
- discusage | devices | systemload | temperatures | currentschedule | customtokens | menuitems)*>
+ discusage | devices | systemload | temperatures | currentschedule | currentweather | customtokens | menuitems)*>
<!ATTLIST menumain
x CDATA #REQUIRED
y CDATA #REQUIRED
diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c
index 2db31d9..4b1376a 100644
--- a/libtemplate/templateview.c
+++ b/libtemplate/templateview.c
@@ -381,10 +381,8 @@ void cTemplateView::Translate(void) {
//Translate Plugin Views
for (map < string, map< int, cTemplateView*> >::iterator it = pluginViews.begin(); it != pluginViews.end(); it++) {
- esyslog("skindesigner: translating plugin %s", (it->first).c_str());
map< int, cTemplateView*> plugViews = it->second;
for (map< int, cTemplateView*>::iterator it2 = plugViews.begin(); it2 != plugViews.end(); it2++) {
- esyslog("skindesigner: translating view %d", (int)it2->first);
cTemplateView *pluginView = it2->second;
pluginView->Translate();
}
@@ -1178,6 +1176,9 @@ string cTemplateViewMenu::GetViewElementName(eViewElement ve) {
case veCurrentSchedule:
name = "Current Schedule";
break;
+ case veCurrentWeather:
+ name = "Current Weather";
+ break;
case veCustomTokens:
name = "Custom Tokens";
break;
diff --git a/skins/metrixhd/themes/default/globals.xml b/skins/metrixhd/themes/default/globals.xml
index 006eb5a..1eae5f1 100644
--- a/skins/metrixhd/themes/default/globals.xml
+++ b/skins/metrixhd/themes/default/globals.xml
@@ -270,6 +270,10 @@
<trans lang="en_EN">max</trans>
<trans lang="de_DE">max</trans>
</token>
+ <token name="tr(for)">
+ <trans lang="en_EN">for</trans>
+ <trans lang="de_DE">für</trans>
+ </token>
</translations>
<!--
The three Fonts FontOSD, FontFix and FontSml configured in VDR
diff --git a/skins/metrixhd/xmlfiles/displaymenumain.xml b/skins/metrixhd/xmlfiles/displaymenumain.xml
index 877b736..0556a2b 100644
--- a/skins/metrixhd/xmlfiles/displaymenumain.xml
+++ b/skins/metrixhd/xmlfiles/displaymenumain.xml
@@ -175,17 +175,52 @@
{vdrusagestring} localized VDR internal usage string
-->
<discusage>
- <area x="75%" y="15%" width="25%" height="10%" layer="1">
+ <area x="75%" y="26%" width="25%" height="10%" layer="1">
<fill condition="not{discalert}" color="{clrTransBlack}"/>
<fill condition="{discalert}" color="{clrRed}"/>
</area>
- <area x="75%" y="15%" width="25%" height="10%" layer="2">
+ <area x="75%" y="26%" width="25%" height="10%" layer="2">
<drawimage imagetype="icon" path="ico_discusage" x="1%" valign="center" width="{areaheight}*0.9" height="{areaheight}*0.9"/>
<drawtext x="{areaheight}+10" y="0" font="{light}" fontsize="55%" color="{clrWhite}" text="{tr(disc)}: {freepercent}% {tr(free)}" />
<drawtext x="{areaheight}+10" y="45%" font="{light}" fontsize="55%" color="{clrWhite}" text="{freetime} {tr(hours)}" />
</area>
</discusage>
+ <!-- Available Variables currentweather:
+ {timestamp} timestamp of forecast in dd.mm hh:mm
+ {temperature} current temperature in °C
+ {apparenttemperature} apparent (feeled) temperature
+ {summary} short weather summary
+ {icon} weather icon
+ {precipitationintensity} precipitation intensity in l/m2
+ {precipitationprobability} precipitation probability in %
+ {precipitationtype} precipitation type
+ {humidity} humidity in %
+ {windspeed} windspeed in km/h
+ {windbearing} wind bearing in °
+ {windbearingstring} wind bearing (N, NE, ...)
+ {visibility} visibility in km
+ {cloudcover} cloud cover in %
+ {pressure} pressure in HPo
+ {ozone} ozone value in DU
+ -->
+ <currentweather>
+ <area x="75%" y="13%" width="25%" height="10%" layer="2">
+ <drawrectangle x="0" y="0" width="53%" height="100%" color="{clrTransBlueLight}" />
+ <drawrectangle x="53%" y="0" width="47%" height="100%" color="{clrTransBlack}" />
+ </area>
+ <area x="75%" y="13%" width="12%" height="10%" layer="2">
+ <drawimage imagetype="icon" path="{icon}" align="center" valign="center" width="{areaheight}*0.9" height="{areaheight}*0.9"/>
+ </area>
+ <area x="89%" y="13%" width="10%" height="10%" layer="2">
+ <drawtext x="0" y="0" font="{light}" fontsize="25%" color="{clrWhite}" text="{mintemperature}°C" />
+ <drawtext x="0" y="75%" font="{light}" fontsize="25%" color="{clrWhite}" text="{maxtemperature}°C" />
+ </area>
+ <area x="89%" y="13%" width="10%" height="10%" layer="3">
+ <drawtext align="right" valign="center" font="{light}" fontsize="60%" color="{clrWhite}" text="{temperature}°C" />
+ </area>
+ </currentweather>
+
<!-- Available Variables devices:
{numdevices} number of available devices
{devices[]} array with available devices
@@ -204,10 +239,10 @@
{devices[source]} source of the currently tuned channel
-->
<devices>
- <area x="75%" y="40%" width="25%" height="{areaheight}/12 * {numdevices}" layer="1">
+ <area x="75%" y="48%" width="25%" height="{areaheight}/12 * {numdevices}" layer="1">
<fill color="{clrTransBlack}"/>
</area>
- <area x="75%" y="40%" width="25%" height="{areaheight}/12 * {numdevices}" layer="2">
+ <area x="75%" y="48%" width="25%" height="{areaheight}/12 * {numdevices}" layer="2">
<loop name="devices" x="0" y="0" orientation="vertical" columnwidth="{areawidth}" rowheight="{areaheight} / {numdevices}" overflow="cut">
<drawtext name="label" x="5" y="0" font="{light}" fontsize="{rowheight}*0.4" color="{clrWhite}" text="{devices[num]}: {devices[type]}" />
<drawtext condition="{devices[hascam]}" x="{width(label)} + 15" y="0" font="{light}" fontsize="{rowheight}*0.40" color="{clrWhite}" text="(CAM {devices[cam]})" />
@@ -225,10 +260,10 @@
{load} current system load
-->
<systemload>
- <area x="75%" y="30%" width="25%" height="5%" layer="1">
+ <area x="75%" y="40%" width="25%" height="5%" layer="1">
<fill color="{clrTransBlack}"/>
</area>
- <area x="75%" y="30%" width="25%" height="5%" layer="2">
+ <area x="75%" y="40%" width="25%" height="5%" layer="2">
<drawtext x="5" valign="center" font="{light}" fontsize="100%" color="{clrWhite}" text="System Load: {load}" />
</area>
</systemload>
diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml
index 9190266..b77899a 100644
--- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml
+++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecast.xml
@@ -45,6 +45,9 @@
{iscurrent} true if item is "Current Weather"
{ishourly} true if item is "Next 48 hours"
{isdaily} true if item is "Next 7 days"
+ {city} configured city to display weather for
+ {latitude} latitude
+ {longitude} longitude
If {iscurrent} is true, the following tokens are set:
{timestamp} timestamp in hh:mm dd.mm of current forecast
@@ -125,20 +128,18 @@
<!-- All Tokens from listelement are available -->
<currentelement delay="100" fadetime="0">
<area condition="{iscurrent}" x="51%" y="0" width="48%" height="100%" layer="3">
- <drawimage name="weathericon" imagetype="icon" path="{icon}" x="2%" y="0" width="{areawidth}*0.3" height="{areawidth}*0.3"/>
- <drawtext align="right" y="0" font="{light}" fontsize="8%" color="{clrWhite}" text="{timestamp}" />
- <drawtext align="right" y="6%" font="{light}" fontsize="16%" color="{clrWhite}" text="{temperature}°C" />
- <drawtext align="right" y="20%" font="{light}" fontsize="8%" color="{clrWhite}" text="{summary}" />
- <drawtext x="0" y="34%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(apparenttemp)}: {apparenttemperature} °C" />
- <drawtext x="0" y="40%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(precipitationprobability)}: {precipitationprobability} %" />
- <drawtext x="0" y="46%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(precipitationintensity)}: {precipitationintensity} l/qm" />
- <drawtext x="0" y="52%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(humidity)}: {humidity} %" />
- <drawtext x="0" y="58%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(apparenttemp)}: {windspeed} km/h" />
- <drawtext x="0" y="64%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(windbearing)}: {windbearingstring} ({windbearing} °)" />
- <drawtext x="0" y="70%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(cloudcover)}: {cloudcover} %" />
- <drawtext x="0" y="76%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(pressure)}: {pressure} HPa" />
- <drawtext x="0" y="82%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(ozone)}: {ozone} DU" />
- <drawtext x="0" y="88%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(visibility)}: {visibility} km" />
+ <drawimage name="weathericon" imagetype="icon" path="{icon}" x="2%" y="0" width="{areawidth}*0.4" height="{areawidth}*0.4"/>
+ <drawtext align="right" y="0" font="{semibold}" fontsize="8%" color="{clrWhite}" text="{city}" />
+ <drawtext align="right" y="7%" font="{light}" fontsize="8%" color="{clrWhite}" text="{timestamp}" />
+ <drawtext align="right" y="13%" font="{light}" fontsize="18%" color="{clrWhite}" text="{temperature}°C" />
+ <drawtext align="right" y="28%" font="{light}" fontsize="8%" color="{clrWhite}" text="{summary}" />
+ <drawtext x="0" y="40%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(apparenttemp)}: {apparenttemperature} °C" />
+ <drawtext x="0" y="46%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(precipitationprobability)}: {precipitationprobability} %" />
+ <drawtext x="0" y="52%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(precipitationintensity)}: {precipitationintensity} l/qm" />
+ <drawtext x="0" y="58%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(humidity)}: {humidity} %" />
+ <drawtext x="0" y="64%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(windspeed)}: {windspeed} km/h" />
+ <drawtext x="0" y="70%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(windbearing)}: {windbearingstring} ({windbearing} °)" />
+ <drawtext x="0" y="76%" font="{light}" fontsize="6%" color="{clrWhite}" text="{tr(cloudcover)}: {cloudcover} %" />
</area>
<area condition="{ishourly}" x="51%" y="0" width="48%" height="100%" layer="3">
<loop name="hourly" x="0" y="0" orientation="vertical" columnwidth="{areawidth}" rowheight="{areaheight}/12" overflow="cut">
diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml
index f1b07e2..4932759 100644
--- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml
+++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailcurrent.xml
@@ -35,6 +35,9 @@
</scrollbar>
<!-- Available Variables in detailheader and tab:
{menuheader} "Current Weather"
+ {city} configured city to display weather for
+ {latitude} latitude
+ {longitude} longitude
{timestamp} timestamp in hh:mm dd.mm of current forecast
{temperature} current temperature in °C
{apparenttemperature} apparent (felt) temperature in °C
@@ -70,17 +73,18 @@
</detailheader>
<tab name="current" x="2%" y="20%" width="94%" height="65%" layer="2" scrollheight="{areaheight}/4">
- <drawtext x="0" y="0" font="{semibold}" fontsize="10%" color="{clrWhite}" text="{tr(conditions)}: {summary}" />
- <drawtext x="0" y="10%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(temp)}: {temperature}°C" />
- <drawtext x="0" y="20%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(apparenttemp)}: {apparenttemperature}°C" />
- <drawtext x="0" y="30%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(todaymin)}: {mintemperature}°C, {tr(todaymax)}: {maxtemperature}°C" />
- <drawtext x="0" y="40%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(precipitationprobability)}: {precipitationprobability} %" />
- <drawtext x="0" y="50%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(precipitationintensity)}: {precipitationintensity} l/qm" />
- <drawtext x="0" y="60%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(humidity)}: {humidity} %" />
- <drawtext x="0" y="70%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(windspeed)}: {windspeed} km/h aus {windbearingstring}" />
- <drawtext x="0" y="80%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(visibility)}: {visibility} km" />
- <drawtext x="0" y="90%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(cloudcover)}: {cloudcover} %" />
- <drawtext x="0" y="100%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(pressure)}: {pressure} HPa" />
- <drawtext x="0" y="110%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(ozone)}: {ozone} DU" />
+ <drawtext x="0" y="0" font="{semibold}" fontsize="10%" color="{clrWhite}" text="{tr(conditions)} {tr(for)} {city} ({latitude}, {longitude}):" />
+ <drawtext x="0" y="10%" font="{semibold}" fontsize="10%" color="{clrWhite}" text="{summary}" />
+ <drawtext x="0" y="25%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(temp)}: {temperature}°C" />
+ <drawtext x="0" y="35%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(apparenttemp)}: {apparenttemperature}°C" />
+ <drawtext x="0" y="45%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(todaymin)}: {mintemperature}°C, {tr(todaymax)}: {maxtemperature}°C" />
+ <drawtext x="0" y="55%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(precipitationprobability)}: {precipitationprobability} %" />
+ <drawtext x="0" y="65%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(precipitationintensity)}: {precipitationintensity} l/qm" />
+ <drawtext x="0" y="75%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(humidity)}: {humidity} %" />
+ <drawtext x="0" y="85%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(windspeed)}: {windspeed} km/h aus {windbearingstring}" />
+ <drawtext x="0" y="95%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(visibility)}: {visibility} km" />
+ <drawtext x="0" y="105%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(cloudcover)}: {cloudcover} %" />
+ <drawtext x="0" y="115%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(pressure)}: {pressure} HPa" />
+ <drawtext x="0" y="125%" font="{light}" fontsize="10%" color="{clrWhite}" text="{tr(ozone)}: {ozone} DU" />
</tab>
</menuplugin>
diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml
index 72b98a6..10b588c 100644
--- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml
+++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml
@@ -37,6 +37,9 @@
<!-- Available Variables in detailheader and tab:
{summary} short summary of weather
{icon} path to use in <drawimage> to display appropriate weather icon
+ {city} configured city to display weather for
+ {latitude} latitude
+ {longitude} longitude
{daily[day]} day of forecast in dd.mm
{daily[dayname]} three letter abbrivated day name
diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml
index f90e34f..c21c62a 100644
--- a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml
+++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml
@@ -37,6 +37,9 @@
<!-- Available Variables in detailheader and tab:
{summary} short summary of weather
{icon} path to use in <drawimage> to display appropriate weather icon
+ {city} configured city to display weather for
+ {latitude} latitude
+ {longitude} longitude
{hourly[]} array with up to 48 hourly forecasts
{hourly[num]} number of forecast, starting at 1
diff --git a/skinskeleton/xmlfiles/displaymenumain.xml b/skinskeleton/xmlfiles/displaymenumain.xml
index 7d372cc..15c2f4a 100644
--- a/skinskeleton/xmlfiles/displaymenumain.xml
+++ b/skinskeleton/xmlfiles/displaymenumain.xml
@@ -86,6 +86,27 @@
<currentschedule>
</currentschedule>
+ <!-- Available Variables currentweather:
+ {timestamp} timestamp of forecast in dd.mm hh:mm
+ {temperature} current temperature in °C
+ {apparenttemperature} apparent (feeled) temperature
+ {summary} short weather summary
+ {icon} weather icon
+ {precipitationintensity} precipitation intensity in l/m2
+ {precipitationprobability} precipitation probability in %
+ {precipitationtype} precipitation type
+ {humidity} humidity in %
+ {windspeed} windspeed in km/h
+ {windbearing} wind bearing in °
+ {windbearingstring} wind bearing (N, NE, ...)
+ {visibility} visibility in km
+ {cloudcover} cloud cover in %
+ {pressure} pressure in HPo
+ {ozone} ozone value in DU
+ -->
+ <currentweather>
+ </currentweather>
+
<!-- Available Variables customtokens:
all custom tokens set by the svdrp command SCTK are available in this viewelement
For instance, use an appropriate script which runs periodically as cronjob and
diff --git a/views/displaychannelview.c b/views/displaychannelview.c
index 6526530..83e7ef3 100644
--- a/views/displaychannelview.c
+++ b/views/displaychannelview.c
@@ -545,7 +545,10 @@ void cDisplayChannelView::DrawCurrentWeather(void) {
}
map < string, string > stringTokens;
map < string, int > intTokens;
- SetCurrentWeatherTokens(stringTokens, intTokens);
+ if (!SetCurrentWeatherTokens(stringTokens, intTokens)){
+ ClearViewElement(veCurrentWeather);
+ return;
+ }
ClearViewElement(veCurrentWeather);
DrawViewElement(veCurrentWeather, &stringTokens, &intTokens);
diff --git a/views/displaymenuview.c b/views/displaymenuview.c
index 1f6c69f..0b9c5a8 100644
--- a/views/displaymenuview.c
+++ b/views/displaymenuview.c
@@ -237,6 +237,7 @@ void cDisplayMenuMainView::DrawStaticViewElements(void) {
DrawDiscUsage();
DrawTemperatures();
DrawCurrentSchedule();
+ DrawCurrentWeather();
DrawCustomTokens();
}
@@ -581,6 +582,21 @@ void cDisplayMenuMainView::DrawCurrentSchedule(void) {
DrawViewElement(veCurrentSchedule, &stringTokens, &intTokens);
}
+void cDisplayMenuMainView::DrawCurrentWeather(void) {
+ if (!ViewElementImplemented(veCurrentWeather)) {
+ return;
+ }
+ map < string, string > stringTokens;
+ map < string, int > intTokens;
+ if (!SetCurrentWeatherTokens(stringTokens, intTokens)){
+ ClearViewElement(veCurrentWeather);
+ return;
+ }
+
+ ClearViewElement(veCurrentWeather);
+ DrawViewElement(veCurrentWeather, &stringTokens, &intTokens);
+}
+
void cDisplayMenuMainView::DrawCustomTokens(void) {
if (!ViewElementImplemented(veCustomTokens)) {
return;
diff --git a/views/displaymenuview.h b/views/displaymenuview.h
index 8463301..c7aa7eb 100644
--- a/views/displaymenuview.h
+++ b/views/displaymenuview.h
@@ -44,6 +44,7 @@ private:
void DrawTemperatures(void);
bool DrawDevices(void);
void DrawCurrentSchedule(void);
+ void DrawCurrentWeather(void);
void DrawCustomTokens(void);
public:
cDisplayMenuMainView(cTemplateView *tmplView, bool menuInit);
diff --git a/views/viewhelpers.c b/views/viewhelpers.c
index 8fdffaf..e10798f 100644
--- a/views/viewhelpers.c
+++ b/views/viewhelpers.c
@@ -427,13 +427,13 @@ bool cViewHelpers::SetDate(map < string, string > &stringTokens, map < string, i
return true;
}
-void cViewHelpers::SetCurrentWeatherTokens(map < string, string > &stringTokens, map < string, int > &intTokens) {
+bool cViewHelpers::SetCurrentWeatherTokens(map < string, string > &stringTokens, map < string, int > &intTokens) {
static cPlugin *pWeatherForecast = cPluginManager::GetPlugin("weatherforecast");
if (!pWeatherForecast)
- return;
+ return false;
cServiceCurrentWeather currentWeather;
if (!pWeatherForecast->Service("GetCurrentWeather", &currentWeather)) {
- return;
+ return false;
}
stringTokens.insert(pair<string,string>("timestamp", currentWeather.timeStamp));
stringTokens.insert(pair<string,string>("temperature", currentWeather.temperature));
@@ -453,4 +453,5 @@ void cViewHelpers::SetCurrentWeatherTokens(map < string, string > &stringTokens,
intTokens.insert(pair<string,int>("cloudcover", currentWeather.cloudCover));
stringTokens.insert(pair<string,string>("pressure", currentWeather.pressure));
stringTokens.insert(pair<string,string>("ozone", currentWeather.ozone));
+ return true;
}
diff --git a/views/viewhelpers.h b/views/viewhelpers.h
index 82dd7c9..8e49554 100644
--- a/views/viewhelpers.h
+++ b/views/viewhelpers.h
@@ -16,7 +16,7 @@ protected:
void SetScraperTokens(const cEvent *event, const cRecording *recording, map < string, string > &stringTokens, map < string, int > &intTokens, map < string, vector< map< string, string > > > &loopTokens);
bool SetTime(map < string, string > &stringTokens, map < string, int > &intTokens);
bool SetDate(map < string, string > &stringTokens, map < string, int > &intTokens);
- void SetCurrentWeatherTokens(map < string, string > &stringTokens, map < string, int > &intTokens);
+ bool SetCurrentWeatherTokens(map < string, string > &stringTokens, map < string, int > &intTokens);
public:
cViewHelpers(void);
virtual ~cViewHelpers(void);