summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2015-06-05 14:48:45 +0200
committerlouis <louis.braun@gmx.de>2015-06-05 14:48:45 +0200
commitb6a6ea2f6bf697b94a489521b774f2b8dc67629a (patch)
tree201788f6c50ac45e52ddfb9d23b09e4fbdb8b2fa /views
parent57244494b6a88834c2b01252a83b85fb0b21c456 (diff)
downloadvdr-plugin-skindesigner-b6a6ea2f6bf697b94a489521b774f2b8dc67629a.tar.gz
vdr-plugin-skindesigner-b6a6ea2f6bf697b94a489521b774f2b8dc67629a.tar.bz2
refresh custom token display with each custom token change
Diffstat (limited to 'views')
-rw-r--r--views/displaychannelview.c8
-rw-r--r--views/displaychannelview.h1
-rw-r--r--views/displaymenuview.c16
-rw-r--r--views/displaymenuview.h2
-rw-r--r--views/displayreplayview.c7
-rw-r--r--views/displayreplayview.h1
6 files changed, 28 insertions, 7 deletions
diff --git a/views/displaychannelview.c b/views/displaychannelview.c
index 255dc3e..47537ec 100644
--- a/views/displaychannelview.c
+++ b/views/displaychannelview.c
@@ -556,10 +556,18 @@ void cDisplayChannelView::DrawCustomTokens(void) {
} else {
map < string, string > stringTokens = tmplView->GetCustomStringTokens();
map < string, int > intTokens = tmplView->GetCustomIntTokens();
+ ClearViewElement(veCustomTokens);
DrawViewElement(veCustomTokens, &stringTokens, &intTokens);
}
}
+bool cDisplayChannelView::CustomTokenChange(void) {
+ if (!tmplView)
+ return false;
+ return tmplView->CustomTokenChange();
+}
+
+
void cDisplayChannelView::DrawCurrentWeather(void) {
if (!ExecuteViewElement(veCurrentWeather)) {
return;
diff --git a/views/displaychannelview.h b/views/displaychannelview.h
index 068b27a..9468d7d 100644
--- a/views/displaychannelview.h
+++ b/views/displaychannelview.h
@@ -49,6 +49,7 @@ public:
void ClearChannelGroups(void);
void DisplayMessage(eMessageType Type, const char *Text);
void DrawCustomTokens(void);
+ bool CustomTokenChange(void);
void DrawCurrentWeather(void);
void DoStart(void) { Start(); };
void Flush(void) { DoFlush(); };
diff --git a/views/displaymenuview.c b/views/displaymenuview.c
index d76095c..aba112f 100644
--- a/views/displaymenuview.c
+++ b/views/displaymenuview.c
@@ -293,7 +293,6 @@ void cDisplayMenuMainView::DrawStaticViewElements(void) {
DrawTemperatures();
DrawCurrentSchedule();
DrawCurrentWeather();
- DrawCustomTokens();
}
bool cDisplayMenuMainView::DrawDynamicViewElements(void) {
@@ -301,9 +300,9 @@ bool cDisplayMenuMainView::DrawDynamicViewElements(void) {
bool memChanged = DrawMemory();
bool vdrChanged = DrawVdrStats();
bool devicesChanged = DrawDevices();
+ bool customTokensChanged = DrawCustomTokens();
initial = false;
- return loadChanged || memChanged || vdrChanged || devicesChanged;
-
+ return loadChanged || memChanged || vdrChanged || devicesChanged || customTokensChanged;
}
void cDisplayMenuMainView::DrawTimers(void) {
@@ -588,12 +587,15 @@ void cDisplayMenuMainView::DrawCurrentWeather(void) {
}
}
-void cDisplayMenuMainView::DrawCustomTokens(void) {
+bool cDisplayMenuMainView::DrawCustomTokens(void) {
if (!ExecuteViewElement(veCustomTokens)) {
- return;
+ return false;
}
if (!tmplView)
- return;
+ return false;
+
+ if (!initial && !tmplView->CustomTokenChange())
+ return false;
if (DetachViewElement(veCustomTokens)) {
cViewElement *viewElement = GetViewElement(veCustomTokens);
@@ -608,8 +610,10 @@ void cDisplayMenuMainView::DrawCustomTokens(void) {
} else {
map < string, string > stringTokens = tmplView->GetCustomStringTokens();
map < string, int > intTokens = tmplView->GetCustomIntTokens();
+ ClearViewElement(veCustomTokens);
DrawViewElement(veCustomTokens, &stringTokens, &intTokens);
}
+ return true;
}
/************************************************************************
diff --git a/views/displaymenuview.h b/views/displaymenuview.h
index 60a859e..7fbd9a3 100644
--- a/views/displaymenuview.h
+++ b/views/displaymenuview.h
@@ -62,7 +62,7 @@ private:
bool DrawDevices(void);
void DrawCurrentSchedule(void);
void DrawCurrentWeather(void);
- void DrawCustomTokens(void);
+ bool DrawCustomTokens(void);
public:
cDisplayMenuMainView(cTemplateView *tmplView, bool menuInit, string currentRecording);
virtual ~cDisplayMenuMainView();
diff --git a/views/displayreplayview.c b/views/displayreplayview.c
index 400807f..385ed2e 100644
--- a/views/displayreplayview.c
+++ b/views/displayreplayview.c
@@ -457,9 +457,16 @@ void cDisplayReplayView::DrawCustomTokens(void) {
return;
map < string, string > stringTokens = tmplView->GetCustomStringTokens();
map < string, int > intTokens = tmplView->GetCustomIntTokens();
+ ClearViewElement(veCustomTokens);
DrawViewElement(veCustomTokens, &stringTokens, &intTokens);
}
+bool cDisplayReplayView::CustomTokenChange(void) {
+ if (!tmplView)
+ return false;
+ return tmplView->CustomTokenChange();
+}
+
/****************************************************************************************
* Private Functions
*****************************************************************************************/
diff --git a/views/displayreplayview.h b/views/displayreplayview.h
index 87de67d..f776d3d 100644
--- a/views/displayreplayview.h
+++ b/views/displayreplayview.h
@@ -44,6 +44,7 @@ public:
void ClearOnPause(void);
void DelayOnPause(void);
void DrawCustomTokens(void);
+ bool CustomTokenChange(void);
void DoFadeIn(void) { Start(); };
void Flush(void) { DoFlush(); };
};