mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuConfirmDeleteTimer
This commit is contained in:
parent
ce690366f8
commit
a4294b1f54
31
recmenus.c
31
recmenus.c
@ -144,27 +144,26 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event, bool timerChange
|
||||
}
|
||||
|
||||
// --- cRecMenuConfirmDeleteTimer ---------------------------------------------------------
|
||||
cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) {
|
||||
cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { // 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 text = cString::sprintf("%s\n%s\n%s %s - %s\n%s",
|
||||
tr("Timer deleted"),
|
||||
*channelName,
|
||||
*event->GetDateString(),
|
||||
*event->GetTimeString(),
|
||||
*event->GetEndTimeString(),
|
||||
event->Title()
|
||||
);
|
||||
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
|
||||
infoItem->CalculateHeight(width - 4 * border);
|
||||
AddMenuItem(infoItem);
|
||||
AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsClose, true, true));
|
||||
|
||||
const cString channelName = channels->GetByChannelID(event->ChannelID())->Name();
|
||||
const cString line1 = tr("Timer deleted");
|
||||
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"), rmsClose, true, true));
|
||||
|
||||
CalculateHeight();
|
||||
CreatePixmap();
|
||||
Arrange();
|
||||
|
Loading…
Reference in New Issue
Block a user