summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-01-13 14:49:36 +0100
committerlouis <louis.braun@gmx.de>2015-01-13 14:49:36 +0100
commit8c6a83b72aab225ae1b446590ccb44ff475742cc (patch)
tree6d47ded65ef008450b198ceb3b14f215f0c29e1b
parent604ae1c8ccc14fd991a535106316f9eff90ae8ac (diff)
downloadvdr-plugin-skindesigner-8c6a83b72aab225ae1b446590ccb44ff475742cc.tar.gz
vdr-plugin-skindesigner-8c6a83b72aab225ae1b446590ccb44ff475742cc.tar.bz2
fixed bug in displaying plugin detail pages
-rw-r--r--skindesclient-0.0.1/libskindesigner/services.h2
-rw-r--r--skindesclient-0.0.1/libskindesigner/skindesignerosdbase.c9
-rw-r--r--skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml66
-rw-r--r--skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml63
-rw-r--r--views/displaymenurootview.c7
5 files changed, 140 insertions, 7 deletions
diff --git a/skindesclient-0.0.1/libskindesigner/services.h b/skindesclient-0.0.1/libskindesigner/services.h
index 2ae188d..0a016fa 100644
--- a/skindesclient-0.0.1/libskindesigner/services.h
+++ b/skindesclient-0.0.1/libskindesigner/services.h
@@ -4,6 +4,7 @@
using namespace std;
#include <string>
+#include <vector>
#include <map>
enum eMenuType {
@@ -13,6 +14,7 @@ enum eMenuType {
class cSDDisplayMenu : public cSkinDisplayMenu {
public:
+ virtual void SetTitle(const char *Title);
virtual void SetPluginMenu(string name, int menu, int type, bool init);
virtual bool SetItemPlugin(map<string,string> *stringTokens, map<string,int> *intTokens, map<string,vector<map<string,string> > > *loopTokens, int Index, bool Current, bool Selectable);
virtual bool SetPluginText(map<string,string> *stringTokens, map<string,int> *intTokens, map<string,vector<map<string,string> > > *loopTokens);
diff --git a/skindesclient-0.0.1/libskindesigner/skindesignerosdbase.c b/skindesclient-0.0.1/libskindesigner/skindesignerosdbase.c
index f23f2a6..821efdc 100644
--- a/skindesclient-0.0.1/libskindesigner/skindesignerosdbase.c
+++ b/skindesclient-0.0.1/libskindesigner/skindesignerosdbase.c
@@ -142,27 +142,30 @@ void cSkindesignerOsdMenu::TextKeyDown(void) {
void cSkindesignerOsdMenu::Display(void) {
if (displayText) {
if (sdDisplayMenu) {
+ sdDisplayMenu->SetTitle(Title());
if (sdDisplayMenu->SetPluginText(&stringTokens, &intTokens, &loopTokens)) {
- esyslog("skindesclient: template found");
sdDisplayMenu->Flush();
} else {
- esyslog("skindesclient: no template found, drawing default");
DisplayMenu()->Clear();
+ DisplayMenu()->SetTitle(Title());
DisplayMenu()->SetText(text.c_str(), false);
DisplayMenu()->Flush();
}
} else {
DisplayMenu()->Clear();
+ DisplayMenu()->SetTitle(Title());
DisplayMenu()->SetText(text.c_str(), false);
DisplayMenu()->Flush();
}
return;
}
if (sdDisplayMenu) {
+ sdDisplayMenu->SetTitle(Title());
for (cOsdItem *item = First(); item; item = Next(item)) {
cSkindesignerOsdItem *sdItem = dynamic_cast<cSkindesignerOsdItem*>(item);
- if (sdItem)
+ if (sdItem) {
sdItem->SetDisplayMenu(sdDisplayMenu);
+ }
}
}
cOsdMenu::Display();
diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml
new file mode 100644
index 0000000..42026d5
--- /dev/null
+++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetaildaily.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE menuplugin SYSTEM "../../../dtd/displaymenuplugin.dtd">
+
+<menuplugin x="0" y="0" width="100%" height="100%" fadetime="0">
+ <background>
+ <area x="0" y="0" width="100%" height="100%" layer="1">
+ <fill color="{clrTransBlack}" />
+ </area>
+ </background>
+
+ <header>
+ <area x="0" y="0" width="1" height="1" layer="1">
+ <fill color="{clrTransparent}" />
+ </area>
+ </header>
+
+ <detailheader>
+ <area x="0" y="0" width="100%" height="20%" layer="2">
+ <fill color="{clrTransBlueLight}" />
+ </area>
+ <area x="0" y="0" width="100%" height="20%" layer="3">
+ <drawtext x="20" valign="center" font="{light}" fontsize="40%" color="{clrWhite}" text="{menuheader}" />
+ </area>
+ <area x="{areawidth} - {areaheight}*0.2" y="0" width="{areaheight}*0.2" height="20%" layer="4">
+ <drawimage imagetype="icon" path="{icon}" align="center" valign="center" width="90%" height="90%"/>
+ </area>
+ <area x="{areawidth} - {areaheight}*0.6" y="0" width="{areaheight}*0.35" height="20%" layer="4">
+ <drawtext align="right" valign="center" font="{light}" fontsize="90%" color="{clrWhite}" text="{temperature}°C" />
+ </area>
+ </detailheader>
+
+ <datetime>
+ <area x="0" y="0" width="1" height="1" layer="1">
+ <fill color="{clrTransparent}" />
+ </area>
+ </datetime>
+
+ <colorbuttons>
+ <area x="0" y="0" width="1" height="1" layer="1">
+ <fill color="{clrTransparent}" />
+ </area>
+ </colorbuttons>
+
+ <scrollbar>
+ <area x="98%" y="20%" width="2%" height="65%" layer="3">
+ <fill color="{clrWhite}" />
+ <drawrectangle x="2" y="2" width="{areawidth} - 4" height="{areaheight} - 4" color="{clrTransparent}" />
+ <drawrectangle x="4" y="4 + {areaheight} * {offset} / 1000" width="{areawidth} - 8" height="{areaheight} * {height} / 1000 - 8" color="{clrWhite}" />
+ </area>
+ </scrollbar>
+
+ <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="Wetterlage: {summary}" />
+ <drawtext x="0" y="10%" font="{light}" fontsize="10%" color="{clrWhite}" text="Aktuelle Temperatur: {temperature}°C" />
+ <drawtext x="0" y="20%" font="{light}" fontsize="10%" color="{clrWhite}" text="Gefühlte Temperatur: {apparenttemperature}°C" />
+ <drawtext x="0" y="30%" font="{light}" fontsize="10%" color="{clrWhite}" text="heutiges Minimum: {mintemperature}°C, heutiges Maximum: {maxtemperature}°C" />
+ <drawtext x="0" y="40%" font="{light}" fontsize="10%" color="{clrWhite}" text="Niederschlagswahrscheinlichkeit: {precipitationprobability} %" />
+ <drawtext x="0" y="50%" font="{light}" fontsize="10%" color="{clrWhite}" text="Niederschlagsmenge: {precipitationintensity} l/qm" />
+ <drawtext x="0" y="60%" font="{light}" fontsize="10%" color="{clrWhite}" text="Luftfeuchtigkeit: {humidity} %" />
+ <drawtext x="0" y="70%" font="{light}" fontsize="10%" color="{clrWhite}" text="Windgeschwindigkeit: {windspeed} km/h aus {windbearingstring}" />
+ <drawtext x="0" y="80%" font="{light}" fontsize="10%" color="{clrWhite}" text="Sicht: {visibility} km" />
+ <drawtext x="0" y="90%" font="{light}" fontsize="10%" color="{clrWhite}" text="Bewölkung: {cloudcover} %" />
+ <drawtext x="0" y="100%" font="{light}" fontsize="10%" color="{clrWhite}" text="Luftdruck: {pressure} HPa" />
+ <drawtext x="0" y="110%" font="{light}" fontsize="10%" color="{clrWhite}" text="Ozon: {ozone} DU" />
+ </tab>
+</menuplugin>
diff --git a/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml
new file mode 100644
index 0000000..c7e41e8
--- /dev/null
+++ b/skins/metrixhd/xmlfiles/plug-weatherforecast-weatherforecastdetailhourly.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE menuplugin SYSTEM "../../../dtd/displaymenuplugin.dtd">
+
+<menuplugin x="0" y="0" width="100%" height="100%" fadetime="0">
+ <background>
+ <area x="0" y="0" width="100%" height="100%" layer="1">
+ <fill color="{clrTransBlack}" />
+ </area>
+ </background>
+
+ <header>
+ <area x="0" y="0" width="1" height="1" layer="1">
+ <fill color="{clrTransparent}" />
+ </area>
+ </header>
+
+ <detailheader>
+ <area x="0" y="0" width="100%" height="20%" layer="2">
+ <fill color="{clrTransBlueLight}" />
+ </area>
+ <area x="0" y="0" width="100%" height="20%" layer="3">
+ <drawtext x="20" valign="center" font="{light}" fontsize="40%" color="{clrWhite}" text="{menuheader}" />
+ </area>
+ <area x="{areawidth} - {areaheight}*0.2" y="5" width="{areaheight}*0.2" height="20%" layer="4">
+ <drawimage imagetype="icon" path="{icon}" align="center" y="0" width="70%" height="70%"/>
+ </area>
+ <area x="0" y="0" width="100%" height="20%" layer="4">
+ <drawtext align="right" valign="bottom" font="{light}" fontsize="25%" color="{clrWhite}" text="{summary}" />
+ </area>
+ </detailheader>
+
+ <datetime>
+ <area x="0" y="0" width="1" height="1" layer="1">
+ <fill color="{clrTransparent}" />
+ </area>
+ </datetime>
+
+ <colorbuttons>
+ <area x="0" y="0" width="1" height="1" layer="1">
+ <fill color="{clrTransparent}" />
+ </area>
+ </colorbuttons>
+
+ <scrollbar>
+ <area x="98%" y="20%" width="2%" height="65%" layer="3">
+ <fill color="{clrWhite}" />
+ <drawrectangle x="2" y="2" width="{areawidth} - 4" height="{areaheight} - 4" color="{clrTransparent}" />
+ <drawrectangle x="4" y="4 + {areaheight} * {offset} / 1000" width="{areawidth} - 8" height="{areaheight} * {height} / 1000 - 8" color="{clrWhite}" />
+ </area>
+ </scrollbar>
+
+ <tab name="current" x="2%" y="20%" width="94%" height="65%" layer="2" scrollheight="{areaheight}/4">
+ <loop name="hourly" x="0" y="0" orientation="vertical" columnwidth="{areawidth}" rowheight="{areaheight}/5">
+ <drawtext x="0" font="{semibold}" fontsize="9%" valign="center" color="{clrWhite}" text="{hourly[timestamp]}" />
+ <drawimage imagetype="icon" path="{hourly[icon]}" x="{rowheight}" valign="center" width="{rowheight}*0.8" height="{rowheight}*0.8"/>
+ <drawtext name="temp" x="2*{rowheight} + 0.75*{rowheight} - {width(temp)}/2" font="{light}" fontsize="13%" y="0" color="{clrWhite}" text="{hourly[temperature]}°C" />
+ <drawtext name="felt" x="2*{rowheight} + 0.75*{rowheight} - {width(felt)}/2" font="{light}" fontsize="6%" y="{rowheight}*0.6" color="{clrWhite}" text="felt {hourly[apparenttemperature]}°C" />
+ <drawtext x="4*{rowheight}" font="{light}" fontsize="8%" y="0" width="{columnwidth} - 4*{rowheight}" color="{clrWhite}" text="{hourly[summary]}" />
+ <drawtext x="4*{rowheight}" font="{light}" fontsize="8%" y="{rowheight}/2" width="{columnwidth} - 4*{rowheight}" color="{clrWhite}" text="Precipitation {hourly[precipitationprobability]}%, {hourly[precipitationintensity]} l/qm, Wind {hourly[windspeed]} from {hourly[windbearingstring]}" />
+ <drawrectangle x="0" y="{rowheight} - 1" width="{columnwidth}" height="1" color="{clrWhite}" />
+ </loop>
+ </tab>
+</menuplugin>
diff --git a/views/displaymenurootview.c b/views/displaymenurootview.c
index 142949f..db6e56e 100644
--- a/views/displaymenurootview.c
+++ b/views/displaymenurootview.c
@@ -210,12 +210,11 @@ void cDisplayMenuRootView::CorrectDefaultMenu(void) {
}
}
-void cDisplayMenuRootView::SetPluginMenu(string name, int menu, int type) {
+void cDisplayMenuRootView::SetPluginMenu(string name, int menu, int type) {
if (pluginName.compare(name) || menu != pluginMenu || type != pluginMenuType)
pluginMenuChanged = true;
else
pluginMenuChanged = false;
-
pluginName = name;
pluginMenu = menu;
pluginMenuType = (ePluginMenuType)type;
@@ -301,9 +300,9 @@ void cDisplayMenuRootView::SetDetailedViewText(const char *text) {
bool cDisplayMenuRootView::SetDetailedViewPlugin(map<string,string> *stringTokens, map<string,int> *intTokens, map<string,vector<map<string,string> > > *loopTokens) {
if (!detailView) {
SetMenu(mcPlugin, true);
- if (!subViewAvailable)
- return false;
}
+ if (!subViewAvailable)
+ return false;
detailView->SetPluginTokens(stringTokens, intTokens, loopTokens);
return true;
}