mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuAskDeleteTimer
This commit is contained in:
parent
a4294b1f54
commit
56cab4a666
27
recmenus.c
27
recmenus.c
@ -170,23 +170,26 @@ cRecMenuConfirmDeleteTimer::cRecMenuConfirmDeleteTimer(const cEvent *event) { //
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- cRecMenuAskDeleteTimer ---------------------------------------------------------
|
// --- cRecMenuAskDeleteTimer ---------------------------------------------------------
|
||||||
cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(const cEvent *event) {
|
cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(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 \"%s, %s\" %s",
|
const cString channelName = channels->GetByChannelID(event->ChannelID())->Name();
|
||||||
tr("Timer"),
|
const cString line1 = tr("Timer");
|
||||||
*channelName,
|
const cString line3 = (event && event->Title()) ? cString::sprintf("\"%s\"", event->Title()) : "";
|
||||||
event->Title(),
|
const cString line4 = tr("still recording - really delete?");
|
||||||
tr("still recording - really delete?"));
|
|
||||||
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
|
AddHeader(new cRecMenuItemInfo(*line1, 4, *channelName, *line3, *line4, width - 2 * border));
|
||||||
infoItem->CalculateHeight(width - 4 * border);
|
AddFooter(new cRecMenuItemButtonYesNo(tr("Yes"), tr("No"), rmsDeleteTimerConfirmation, rmsClose, true));
|
||||||
AddMenuItem(infoItem);
|
|
||||||
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Yes"), tr("No"), rmsDeleteTimerConfirmation, rmsClose, true));
|
|
||||||
CalculateHeight();
|
CalculateHeight();
|
||||||
CreatePixmap();
|
CreatePixmap();
|
||||||
Arrange();
|
Arrange();
|
||||||
|
Loading…
Reference in New Issue
Block a user