summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-11-09 15:09:37 +0100
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2022-06-18 17:03:15 +0200
commit37a31d07684d06417a9b1abe7f988dd9ec828882 (patch)
treee2215726e111be240af0fdb56e0f1a41dc55ea23
parent380e84afcdbeccc2fc1899f1a92e3ab97bf3819d (diff)
downloadvdr-plugin-tvguide-37a31d07684d06417a9b1abe7f988dd9ec828882.tar.gz
vdr-plugin-tvguide-37a31d07684d06417a9b1abe7f988dd9ec828882.tar.bz2
Refactor cRecMenuSearchConfirmTimer
-rw-r--r--recmenus.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/recmenus.c b/recmenus.c
index 71accdc..80b696c 100644
--- a/recmenus.c
+++ b/recmenus.c
@@ -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();