From cf44f2cf4c931470785d0cc8f027c87a5640e2a0 Mon Sep 17 00:00:00 2001 From: louis Date: Wed, 5 Nov 2014 17:02:14 +0100 Subject: [PATCH 1/2] added tokens {month}, {monthname} and {year} in displaymenutimers listitem and currentitem --- HISTORY | 1 + skins/metrixhd/xmlfiles/displaymenutimers.xml | 6 ++++++ skinskeleton/xmlfiles/displaymenutimers.xml | 6 ++++++ views/displaymenuitemcurrentview.c | 17 +++++++++++++++++ views/displaymenuitemview.c | 17 +++++++++++++++++ 5 files changed, 47 insertions(+) diff --git a/HISTORY b/HISTORY index 0693f0e..31d7e72 100644 --- a/HISTORY +++ b/HISTORY @@ -54,4 +54,5 @@ Version 0.0.3 - fixed Bug that displaychannel was not shown after closing displaymenu with "backspace" (with active menuorg plugin) - fixed Bug with menuselection Patch +- added tokens {month}, {monthname} and {year} in displaymenutimers listitem and currentitem diff --git a/skins/metrixhd/xmlfiles/displaymenutimers.xml b/skins/metrixhd/xmlfiles/displaymenutimers.xml index d191172..8fb5856 100644 --- a/skins/metrixhd/xmlfiles/displaymenutimers.xml +++ b/skins/metrixhd/xmlfiles/displaymenutimers.xml @@ -7,6 +7,9 @@ {timerstop} End Time of Timer in hh::mm {day} Day (numerical) {dayname} Day, for repeating timers days where timer is active + {month} Month (two digits) + {monthname} Month, three letter abbrevation + {year} Year (4 digits) {channelname} Name of channel which is set for the timer {channelid} ID of channel which is set for the timer (for dispalying channel logo) {channelnumber} Number of channel which is set for the timer @@ -42,6 +45,9 @@ {timerstop} End Time of Timer in hh::mm {day} Day (numerical) {dayname} Day, for repeating timers days where timer is active + {month} Month (two digits) + {monthname} Month, three letter abbrevation + {year} Year (4 digits) {channelname} Name of channel which is set for the timer {channelid} ID of channel which is set for the timer (for dispalying channel logo) {channelnumber} Number of channel which is set for the timer diff --git a/skinskeleton/xmlfiles/displaymenutimers.xml b/skinskeleton/xmlfiles/displaymenutimers.xml index 93b64fd..584ec73 100644 --- a/skinskeleton/xmlfiles/displaymenutimers.xml +++ b/skinskeleton/xmlfiles/displaymenutimers.xml @@ -7,6 +7,9 @@ {timerstop} End Time of Timer in hh::mm {day} Day (numerical) {dayname} Day, for repeating timers days where timer is active + {month} Month (two digits) + {monthname} Month, three letter abbrevation + {year} Year (4 digits) {channelname} Name of channel which is set for the timer {channelid} ID of channel which is set for the timer (for dispalying channel logo) {channelnumber} Number of channel which is set for the timer @@ -33,6 +36,9 @@ {timerstop} End Time of Timer in hh::mm {day} Day (numerical) {dayname} Day, for repeating timers days where timer is active + {month} Month (two digits) + {monthname} Month, three letter abbrevation + {year} Year (4 digits)# {channelname} Name of channel which is set for the timer {channelid} ID of channel which is set for the timer (for dispalying channel logo) {channelnumber} Number of channel which is set for the timer diff --git a/views/displaymenuitemcurrentview.c b/views/displaymenuitemcurrentview.c index 741c7d1..4044b4f 100644 --- a/views/displaymenuitemcurrentview.c +++ b/views/displaymenuitemcurrentview.c @@ -433,8 +433,25 @@ void cDisplayMenuItemCurrentTimerView::Render(void) { strftime(buffer, sizeof(buffer), "%Y%m%d", &tm_r); day = buffer; } + + struct tm tm_r; + time_t timerDate = timer->Day(); + localtime_r(&timerDate, &tm_r); + char buffer[4]; + strftime(buffer, sizeof(buffer), "%m", &tm_r); + int month = atoi(buffer); + char buffer2[6]; + strftime(buffer2, sizeof(buffer2), "%b", &tm_r); + string monthName = buffer2; + char buffer3[6]; + strftime(buffer3, sizeof(buffer3), "%Y", &tm_r); + int year = atoi(buffer3); + stringTokens.insert(pair("day", day)); stringTokens.insert(pair("dayname", dayName)); + intTokens.insert(pair("month", month)); + stringTokens.insert(pair("monthname", monthName)); + intTokens.insert(pair("year", year)); const cChannel *channel = timer->Channel(); if (channel) { diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c index 67fd641..0618363 100644 --- a/views/displaymenuitemview.c +++ b/views/displaymenuitemview.c @@ -537,8 +537,25 @@ void cDisplayMenuItemTimersView::SetTokens(void) { strftime(buffer, sizeof(buffer), "%Y%m%d", &tm_r); day = buffer; } + + struct tm tm_r; + time_t timerDate = timer->Day(); + localtime_r(&timerDate, &tm_r); + char buffer[4]; + strftime(buffer, sizeof(buffer), "%m", &tm_r); + int month = atoi(buffer); + char buffer2[6]; + strftime(buffer2, sizeof(buffer2), "%b", &tm_r); + string monthName = buffer2; + char buffer3[6]; + strftime(buffer3, sizeof(buffer3), "%Y", &tm_r); + int year = atoi(buffer3); + stringTokens.insert(pair("day", day)); stringTokens.insert(pair("dayname", dayName)); + intTokens.insert(pair("month", month)); + stringTokens.insert(pair("monthname", monthName)); + intTokens.insert(pair("year", year)); const cChannel *channel = timer->Channel(); if (channel) { From 7e7d7c994caa612f8520a772c8dcc964a5207414 Mon Sep 17 00:00:00 2001 From: louis Date: Wed, 5 Nov 2014 17:39:16 +0100 Subject: [PATCH 2/2] added dedicated tokens for posters and banners in in displaychannel and displayreplay --- HISTORY | 1 + skins/metrixhd/xmlfiles/displaychannel.xml | 10 ++++++ skins/metrixhd/xmlfiles/displayreplay.xml | 10 ++++++ skinskeleton/xmlfiles/displaychannel.xml | 10 ++++++ skinskeleton/xmlfiles/displayreplay.xml | 10 ++++++ views/displaychannelview.c | 36 +++++++++++++++++++++- views/displayreplayview.c | 36 +++++++++++++++++++++- 7 files changed, 111 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index 31d7e72..bcba075 100644 --- a/HISTORY +++ b/HISTORY @@ -55,4 +55,5 @@ Version 0.0.3 menuorg plugin) - fixed Bug with menuselection Patch - added tokens {month}, {monthname} and {year} in displaymenutimers listitem and currentitem +- added dedicated tokens for posters and banners in in displaychannel and displayreplay diff --git a/skins/metrixhd/xmlfiles/displaychannel.xml b/skins/metrixhd/xmlfiles/displaychannel.xml index d1148d5..5fb6dc0 100644 --- a/skins/metrixhd/xmlfiles/displaychannel.xml +++ b/skins/metrixhd/xmlfiles/displaychannel.xml @@ -209,6 +209,16 @@