From 0bcdb0f3866e1fe2251efad395498954527e1c89 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 6 Jan 2015 06:23:36 +0100 Subject: [PATCH] added customtokens view element in displayreplay --- HISTORY | 4 +++- displayreplay.c | 2 ++ dtd/displayreplay.dtd | 8 +++++++- libtemplate/templateview.c | 6 ++++++ skinskeleton/xmlfiles/displayreplay.xml | 8 ++++++++ views/displayreplayview.c | 11 +++++++++++ views/displayreplayview.h | 1 + 7 files changed, 38 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index d3c6b15..8fd7225 100644 --- a/HISTORY +++ b/HISTORY @@ -122,7 +122,8 @@ Version 0.1.1 - added "temperatures" view element in displaymenumainview to display cpu and gpu temperature in main menu (scripts to get temperatures - borrowed from skinflatplus) + borrowed from skinflatplus). scripts to get temperatures have to be + adapted according the system setup. - added "time" view element in displaychannelview, displayreplay view and displaymenuviews to display current time with seconds precision - added {currenttab}, {prevtab}, {nexttab} Tokens in view @@ -131,5 +132,6 @@ Version 0.1.1 correctly - fixed some minor bugs - added skin "blackhole" +- added customtokens view element in displayreplay Version 0.1.2 diff --git a/displayreplay.c b/displayreplay.c index ec79c3b..9fd8d3f 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -81,7 +81,9 @@ void cSDDisplayReplay::Flush(void) { replayView->DrawDate(); replayView->DrawTime(); } + if (initial) { + replayView->DrawCustomTokens(); replayView->DoFadeIn(); initial = false; } else { diff --git a/dtd/displayreplay.dtd b/dtd/displayreplay.dtd index 6e5a111..c2333c3 100644 --- a/dtd/displayreplay.dtd +++ b/dtd/displayreplay.dtd @@ -5,7 +5,8 @@ + controliconsmodeonly | jump | message | onpause | + onpausemodeonly | customtokens)*> + + + %functions; \ No newline at end of file diff --git a/libtemplate/templateview.c b/libtemplate/templateview.c index 0671a0a..7b64f3d 100644 --- a/libtemplate/templateview.c +++ b/libtemplate/templateview.c @@ -1429,6 +1429,7 @@ void cTemplateViewReplay::SetViewElements(void) { viewElementsAllowed.insert("message"); viewElementsAllowed.insert("onpause"); viewElementsAllowed.insert("onpausemodeonly"); + viewElementsAllowed.insert("customtokens"); } string cTemplateViewReplay::GetViewElementName(eViewElement ve) { @@ -1482,6 +1483,9 @@ string cTemplateViewReplay::GetViewElementName(eViewElement ve) { case veOnPauseModeOnly: name = "On Pause Mode Only"; break; + case veCustomTokens: + name = "Custom Tokens"; + break; default: name = "Unknown"; break; @@ -1526,6 +1530,8 @@ void cTemplateViewReplay::AddPixmap(string sViewElement, cTemplatePixmap *pix, v ve = veOnPause; } else if (!sViewElement.compare("onpausemodeonly")) { ve = veOnPauseModeOnly; + } else if (!sViewElement.compare("customtokens")) { + ve = veCustomTokens; } if (ve == veUndefined) { diff --git a/skinskeleton/xmlfiles/displayreplay.xml b/skinskeleton/xmlfiles/displayreplay.xml index ee63f7a..8cef153 100644 --- a/skinskeleton/xmlfiles/displayreplay.xml +++ b/skinskeleton/xmlfiles/displayreplay.xml @@ -241,4 +241,12 @@ + + + + diff --git a/views/displayreplayview.c b/views/displayreplayview.c index 1c8429b..4831161 100644 --- a/views/displayreplayview.c +++ b/views/displayreplayview.c @@ -379,6 +379,17 @@ void cDisplayReplayView::ClearOnPause(void) { } } +void cDisplayReplayView::DrawCustomTokens(void) { + if (!ViewElementImplemented(veCustomTokens)) { + return; + } + if (!tmplView) + return; + map < string, string > stringTokens = tmplView->GetCustomStringTokens(); + map < string, int > intTokens = tmplView->GetCustomIntTokens(); + DrawViewElement(veCustomTokens, &stringTokens, &intTokens); +} + /**************************************************************************************** * Private Functions *****************************************************************************************/ diff --git a/views/displayreplayview.h b/views/displayreplayview.h index cb8f7f7..a79e537 100644 --- a/views/displayreplayview.h +++ b/views/displayreplayview.h @@ -33,6 +33,7 @@ public: void DrawMessage(eMessageType type, const char *text); void DrawOnPause(bool modeOnly); void ClearOnPause(void); + void DrawCustomTokens(void); void DoFadeIn(void) { Start(); }; void Flush(void) { DoFlush(); }; };