mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuRerunResults
This commit is contained in:
parent
0837137ea8
commit
ec7d45f960
35
recmenus.c
35
recmenus.c
@ -321,28 +321,26 @@ cRecMenuNoTimerConflict::cRecMenuNoTimerConflict(void) { // OK
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- cRecMenuRerunResults ---------------------------------------------------------
|
// --- cRecMenuRerunResults ---------------------------------------------------------
|
||||||
cRecMenuRerunResults::cRecMenuRerunResults(const cEvent *original, const cEvent **reruns, int numReruns) {
|
cRecMenuRerunResults::cRecMenuRerunResults(const cEvent *original, const cEvent **reruns, int numReruns) { // OK
|
||||||
|
SetWidthPercent(70);
|
||||||
|
|
||||||
this->reruns = reruns;
|
this->reruns = reruns;
|
||||||
this->numReruns = numReruns;
|
this->numReruns = numReruns;
|
||||||
SetWidthPercent(70);
|
|
||||||
this->numReruns = numReruns;
|
const cString line1 = cString::sprintf("%d %s:", numReruns, (numReruns > 1) ? tr("reruns for") : tr("rerun for"));
|
||||||
cString message1 = tr("reruns for");
|
const cString line2 = cString::sprintf("\"%s\"", original->Title());
|
||||||
cString message2 = tr("rerun for");
|
const cString line3 = tr("found");
|
||||||
cString message3 = tr("found");
|
|
||||||
cString infoText = cString::sprintf("%d %s:\n\"%s\" %s", numReruns, (numReruns>1)?(*message1):(*message2), original->Title(), *message3);
|
AddHeader(new cRecMenuItemInfo(*line1, 3, *line2, *line3, "", width - 2 * border, true));
|
||||||
cRecMenuItem *infoItem = new cRecMenuItemInfo(*infoText, true);
|
AddFooter(new cRecMenuItemButton(tr("Ignore reruns"), rmsTimerConflictIgnoreReruns, false));
|
||||||
infoItem->CalculateHeight(width - 2 * border);
|
|
||||||
SetHeader(infoItem);
|
|
||||||
|
|
||||||
cRecMenuItem *button = new cRecMenuItemButton(tr("Ignore reruns"), rmsTimerConflictIgnoreReruns, false);
|
|
||||||
SetFooter(button);
|
|
||||||
|
|
||||||
if (reruns && (numReruns > 0)) {
|
if (reruns && (numReruns > 0)) {
|
||||||
for (int i=0; i<numReruns; i++) {
|
for (int i = 0; i < numReruns; i++) {
|
||||||
if (!AddMenuItemInitial(new cRecMenuItemEvent(reruns[i], rmsSearchShowInfo, rmsTimerConflictRecordRerun, (i==0)?true:false)))
|
if (!AddMenuItemInitial(new cRecMenuItemEvent(reruns[i], rmsSearchShowInfo, rmsTimerConflictRecordRerun, (i == 0) ? true : false)))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CalculateHeight();
|
CalculateHeight();
|
||||||
CreatePixmap();
|
CreatePixmap();
|
||||||
Arrange();
|
Arrange();
|
||||||
@ -361,8 +359,9 @@ int cRecMenuRerunResults::GetTotalNumMenuItems(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cEvent *cRecMenuRerunResults::GetRerunEvent(void) {
|
const cEvent *cRecMenuRerunResults::GetRerunEvent(void) {
|
||||||
cRecMenuItemEvent *activeItem = dynamic_cast<cRecMenuItemEvent*>(GetActiveMenuItem());
|
if (cRecMenuItemEvent *activeItem = dynamic_cast<cRecMenuItemEvent*>(GetActiveMenuItem()))
|
||||||
return activeItem->GetEventValue();
|
return activeItem->GetEventValue();
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- cRecMenuNoRerunsFound ---------------------------------------------------------
|
// --- cRecMenuNoRerunsFound ---------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user