Refactor cRecMenuConfirmDeleteTimer

This commit is contained in:
kamel5 2019-11-09 11:27:04 +01:00
parent ce690366f8
commit a4294b1f54
1 changed files with 15 additions and 16 deletions

View File

@ -144,27 +144,26 @@ cRecMenuConfirmTimer::cRecMenuConfirmTimer(const cEvent *event, bool timerChange
} }
// --- cRecMenuConfirmDeleteTimer --------------------------------------------------------- // --- cRecMenuConfirmDeleteTimer ---------------------------------------------------------
cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { // 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 text = cString::sprintf("%s\n%s\n%s %s - %s\n%s", const cString channelName = channels->GetByChannelID(event->ChannelID())->Name();
tr("Timer deleted"), const cString line1 = tr("Timer deleted");
*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"), rmsClose, true, true));
);
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
infoItem->CalculateHeight(width - 4 * border);
AddMenuItem(infoItem);
AddMenuItem(new cRecMenuItemButton(tr("OK"), rmsClose, true, true));
CalculateHeight(); CalculateHeight();
CreatePixmap(); CreatePixmap();
Arrange(); Arrange();