mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuSearchConfirmTimer
This commit is contained in:
parent
380e84afcd
commit
37a31d0768
32
recmenus.c
32
recmenus.c
@ -1259,27 +1259,27 @@ cRecMenuSearchNothingFound::cRecMenuSearchNothingFound(std::string searchString,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- cRecMenuSearchConfirmTimer ---------------------------------------------------------
|
// --- cRecMenuSearchConfirmTimer ---------------------------------------------------------
|
||||||
cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) {
|
cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRecMenuState nextAction) { // OK
|
||||||
SetWidthPercent(50);
|
SetWidthPercent(50);
|
||||||
|
|
||||||
|
const cChannels *channels = NULL;
|
||||||
#if VDRVERSNUM >= 20301
|
#if VDRVERSNUM >= 20301
|
||||||
|
{
|
||||||
LOCK_CHANNELS_READ;
|
LOCK_CHANNELS_READ;
|
||||||
const cString channelName = Channels->GetByChannelID(event->ChannelID())->Name();
|
channels = Channels;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
const cString channelName = Channels.GetByChannelID(event->ChannelID())->Name();
|
channels = &Channels;
|
||||||
#endif
|
#endif
|
||||||
cString message = tr("Timer created");
|
const cString channelName = channels->GetByChannelID(event->ChannelID())->Name();
|
||||||
cString text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",
|
|
||||||
*message,
|
const cString line1 = tr("Timer created");
|
||||||
*channelName,
|
const cString line3 = cString::sprintf("%s %s - %s", *event->GetDateString(), *event->GetTimeString(), *event->GetEndTimeString());
|
||||||
*event->GetDateString(),
|
const cString line4 = (event && event->Title()) ? cString::sprintf("\"%s\"", event->Title()) : "";
|
||||||
*event->GetTimeString(),
|
|
||||||
*event->GetEndTimeString(),
|
AddHeader(new cRecMenuItemInfo(*line1, 4, *channelName, *line3, *line4, width - 2 * border));
|
||||||
event->Title()
|
AddFooter(new cRecMenuItemButton(tr("OK"), nextAction, true, true));
|
||||||
);
|
|
||||||
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
|
|
||||||
infoItem->CalculateHeight(width - 2 * border);
|
|
||||||
AddMenuItem(infoItem);
|
|
||||||
AddMenuItem(new cRecMenuItemButton(tr("OK"), nextAction, true, true));
|
|
||||||
CalculateHeight();
|
CalculateHeight();
|
||||||
CreatePixmap();
|
CreatePixmap();
|
||||||
Arrange();
|
Arrange();
|
||||||
|
Loading…
Reference in New Issue
Block a user