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(const cEvent *event) {
|
||||
cRecMenuAskDeleteTimer::cRecMenuAskDeleteTimer(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 \"%s, %s\" %s",
|
||||
tr("Timer"),
|
||||
*channelName,
|
||||
event->Title(),
|
||||
tr("still recording - really delete?"));
|
||||
cRecMenuItemInfo *infoItem = new cRecMenuItemInfo(*text);
|
||||
infoItem->CalculateHeight(width - 4 * border);
|
||||
AddMenuItem(infoItem);
|
||||
AddMenuItem(new cRecMenuItemButtonYesNo(tr("Yes"), tr("No"), rmsDeleteTimerConfirmation, rmsClose, true));
|
||||
const cString channelName = channels->GetByChannelID(event->ChannelID())->Name();
|
||||
const cString line1 = tr("Timer");
|
||||
const cString line3 = (event && event->Title()) ? cString::sprintf("\"%s\"", event->Title()) : "";
|
||||
const cString line4 = tr("still recording - really delete?");
|
||||
|
||||
AddHeader(new cRecMenuItemInfo(*line1, 4, *channelName, *line3, *line4, width - 2 * border));
|
||||
AddFooter(new cRecMenuItemButtonYesNo(tr("Yes"), tr("No"), rmsDeleteTimerConfirmation, rmsClose, true));
|
||||
|
||||
CalculateHeight();
|
||||
CreatePixmap();
|
||||
Arrange();
|
||||
|
Loading…
Reference in New Issue
Block a user