diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-11-09 15:09:37 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2022-06-18 17:03:15 +0200 |
commit | 37a31d07684d06417a9b1abe7f988dd9ec828882 (patch) | |
tree | e2215726e111be240af0fdb56e0f1a41dc55ea23 | |
parent | 380e84afcdbeccc2fc1899f1a92e3ab97bf3819d (diff) | |
download | vdr-plugin-tvguide-37a31d07684d06417a9b1abe7f988dd9ec828882.tar.gz vdr-plugin-tvguide-37a31d07684d06417a9b1abe7f988dd9ec828882.tar.bz2 |
Refactor cRecMenuSearchConfirmTimer
-rw-r--r-- | recmenus.c | 32 |
1 files changed, 16 insertions, 16 deletions
@@ -1259,27 +1259,27 @@ cRecMenuSearchNothingFound::cRecMenuSearchNothingFound(std::string searchString, } // --- cRecMenuSearchConfirmTimer --------------------------------------------------------- -cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) { +cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) { // OK SetWidthPercent(50); + + const cChannels *channels = NULL; #if VDRVERSNUM >= 20301 + { LOCK_CHANNELS_READ; - const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name(); + channels = Channels; + } #else - const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name(); + channels = &Channels; #endif - cString message = tr("Timer created"); - cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s", - *message, - *channelName, - *event->GetDateString(), - *event->GetTimeString(), - *event->GetEndTimeString(), - event->Title() - ); - cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text); - infoItem->CalculateHeight(width - 2 * border); - AddMenuItem(infoItem); - AddMenuItem(new cRecMenuItemButton(tr("OK"), nextAction, true, true)); + const cString channelName = channels->GetByChannelID(event->ChannelID())->Name(); + + const cString line1 = tr("Timer created"); + const cString line3 = cString::sprintf("%s %s - %s", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString()); + const cString line4 = (event && event->Title()) ? cString::sprintf("\"%s\"", event->Title()) : ""; + + AddHeader(new cRecMenuItemInfo(*line1, 4, *channelName, *line3, *line4, width - 2 * border)); + AddFooter(new cRecMenuItemButton(tr("OK"), nextAction, true, true)); + CalculateHeight(); CreatePixmap(); Arrange(); |