diff options
author | louis <louis.braun@gmx.de> | 2016-05-14 10:07:07 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2016-05-14 10:07:07 +0200 |
commit | b41d0f243152bef8408586a4ee56ac02fa854522 (patch) | |
tree | e4e5fe675fabfb17315ab30a8094073da4cea4c5 | |
parent | f3db608253e8efee18dc3e6bca9ac6491cafcffd (diff) | |
download | vdr-plugin-skindesigner-b41d0f243152bef8408586a4ee56ac02fa854522.tar.gz vdr-plugin-skindesigner-b41d0f243152bef8408586a4ee56ac02fa854522.tar.bz2 |
fixed display of last recordings in main menu
-rw-r--r-- | coreengine/viewelementsdisplaymenu.c | 29 | ||||
-rw-r--r-- | coreengine/viewelementsdisplaymenu.h | 2 | ||||
-rw-r--r-- | skins/estuary4vdr/xmlfiles/displaymenumain.xml | 12 |
3 files changed, 26 insertions, 17 deletions
diff --git a/coreengine/viewelementsdisplaymenu.c b/coreengine/viewelementsdisplaymenu.c index 0d47895..4397ffa 100644 --- a/coreengine/viewelementsdisplaymenu.c +++ b/coreengine/viewelementsdisplaymenu.c @@ -950,12 +950,23 @@ bool cVeDmLastrecordings::Parse(bool forced) { continue; } #endif - string recFullPath = recording->Name() ? recording->Name() : ""; string recName = ""; - string recPath = ""; - RecName(recFullPath, recName, recPath); + string recSeriesName = ""; + const cRecordingInfo *recInfo = recording->Info(); + if (recInfo) { + recName = recInfo->Title() ? recInfo->Title() : ""; + if (recInfo->Title() && recInfo->ShortText()) { + stringstream ss; + ss << recInfo->Title() << " - " << recInfo->ShortText(); + recSeriesName = ss.str(); + } + } else { + string recPath = recording->Name() ? recording->Name() : ""; + RecName(recPath, recName); + } + if (recName.size() == 0) + recName = recording->Name() ? recording->Name() : ""; cString recDuration = cString::sprintf("%d", recording->LengthInSeconds()/60); - string posterPath = ""; int posterWidth = 0; int posterHeight = 0; @@ -963,7 +974,7 @@ bool cVeDmLastrecordings::Parse(bool forced) { RecPoster(recording, posterWidth, posterHeight, posterPath, hasPoster); tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::name, recName.c_str()); - tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::seriesname, recPath.c_str()); + tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::seriesname, recSeriesName.c_str()); tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::date, *ShortDateString(recording->Start())); tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::time, *TimeString(recording->Start())); tokenContainer->AddLoopToken(recIndex, i, (int)eDMLastrecordingsLT::duration, *recDuration); @@ -981,7 +992,7 @@ bool cVeDmLastrecordings::Parse(bool forced) { return true; } -void cVeDmLastrecordings::RecName(string &path, string &name, string &folder) { +void cVeDmLastrecordings::RecName(string &path, string &name) { size_t delim = path.find_last_of('~'); if (delim == string::npos) { name = path; @@ -994,12 +1005,6 @@ void cVeDmLastrecordings::RecName(string &path, string &name, string &folder) { if (name.find('%') == 0) { name = name.substr(1); } - folder = path.substr(0, delim); - size_t delim2 = folder.find_last_of('~'); - if (delim2 == string::npos) { - return; - } - folder = folder.substr(delim2+1); } /****************************************************************** * cVeDmDetailheaderEpg diff --git a/coreengine/viewelementsdisplaymenu.h b/coreengine/viewelementsdisplaymenu.h index 26cbbc9..59ce03d 100644 --- a/coreengine/viewelementsdisplaymenu.h +++ b/coreengine/viewelementsdisplaymenu.h @@ -184,7 +184,7 @@ public: class cVeDmLastrecordings : public cViewElement, public cScrapManager { private: int recIndex; - void RecName(string &path, string &name, string &folder); + void RecName(string &path, string &name); public: cVeDmLastrecordings(void); virtual ~cVeDmLastrecordings(void); diff --git a/skins/estuary4vdr/xmlfiles/displaymenumain.xml b/skins/estuary4vdr/xmlfiles/displaymenumain.xml index d6f0b67..1671be4 100644 --- a/skins/estuary4vdr/xmlfiles/displaymenumain.xml +++ b/skins/estuary4vdr/xmlfiles/displaymenumain.xml @@ -38,10 +38,14 @@ <area condition="{numtimers}" x="2%" y="78%" width="28%" height="14%" layer="3"> <loop name="timers" x="5" y="3" orientation="vertical" columnwidth="{areawidth}" rowheight="{areaheight}/3" overflow="cut"> <drawimage cache="true" name="logo" imagetype="channellogo" path="{timers[channelid]}" width="{columnwidth}*0.15" height="{rowheight}*0.75" x="10" valign="center" /> - <drawtext name="datetime" x="{posx(logo)} + {width(logo)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[datetime]}" /> - <drawimage condition="{timers[isremotetimer]}" name="remotetimericon" imagetype="icon" path="ico_remotetimer" width="{rowheight}*0.4" height="{rowheight}*0.4" x="{posx(datetime)} + {width(datetime)} + 10" y="0" /> - <drawtext condition="{timers[isremotetimer]}" x="{posx(remotetimericon)} + {width(remotetimericon)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[remotehost]}" /> - <drawtext x="{posx(logo)} + {width(logo)} + 10" y="{rowheight}*0.35" width="{columnwidth} - {posx(logo)} - {width(logo)} - 20" font="{regular}" fontsize="{rowheight}*0.6" color="{fontdefault}" text="{timers[title]}" /> + <drawtext condition="not{timers[recording]}" name="datetime" x="{posx(logo)} + {width(logo)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[datetime]}" /> + <drawimage condition="not{timers[recording]}++{timers[isremotetimer]}" name="remotetimericon" imagetype="icon" path="ico_remotetimer" width="{rowheight}*0.4" height="{rowheight}*0.4" x="{posx(datetime)} + {width(datetime)} + 10" y="0" /> + <drawtext condition="not{timers[recording]}++{timers[isremotetimer]}" x="{posx(remotetimericon)} + {width(remotetimericon)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[remotehost]}" /> + <drawtext condition="{timers[recording]}" name="datetimeactive" x="{posx(logo)} + {width(logo)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{icontextalert}" text="{timers[datetime]}" /> + <drawimage condition="{timers[recording]}++{timers[isremotetimer]}" name="remotetimericonactive" imagetype="icon" path="ico_remotetimer" width="{rowheight}*0.4" height="{rowheight}*0.4" x="{posx(datetimeactive)} + {width(datetimeactive)} + 10" y="0" /> + <drawtext condition="{timers[recording]}++{timers[isremotetimer]}" x="{posx(remotetimericonactive)} + {width(remotetimericonactive)} + 10" y="0" font="{regular}" fontsize="{rowheight}*0.4" color="{fontdefault}" text="{timers[remotehost]}" /> + <drawtext condition="not{timers[recording]}" x="{posx(logo)} + {width(logo)} + 10" y="{rowheight}*0.35" width="{columnwidth} - {posx(logo)} - {width(logo)} - 20" font="{regular}" fontsize="{rowheight}*0.6" color="{fontdefault}" text="{timers[title]}" /> + <drawtext condition="{timers[recording]}" x="{posx(logo)} + {width(logo)} + 10" y="{rowheight}*0.35" width="{columnwidth} - {posx(logo)} - {width(logo)} - 20" font="{regular}" fontsize="{rowheight}*0.6" color="{icontextalert}" text="{timers[title]}" /> </loop> </area> </timers> |