mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuTimerConflict
This commit is contained in:
parent
73e331f97f
commit
33196207d0
54
recmenus.c
54
recmenus.c
@ -234,17 +234,19 @@ int cRecMenuTimerConflicts::GetTimerConflict(void) {
|
||||
}
|
||||
|
||||
// --- cRecMenuTimerConflict ---------------------------------------------------------
|
||||
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction) {
|
||||
SetWidthPercent(95);
|
||||
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction) { //OK
|
||||
SetWidthPercent(90);
|
||||
|
||||
this->conflict = conflict;
|
||||
totalNumMenuItems = (int)conflict->timerIDs.size();
|
||||
|
||||
SetHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
||||
AddHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
conflict->overlapStop));
|
||||
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), nextAction, false, true));
|
||||
int i=0;
|
||||
AddFooter(new cRecMenuItemButton(tr("Ignore Conflict"), nextAction, false, true));
|
||||
|
||||
int i = 0;
|
||||
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
|
||||
#if VDRVERSNUM >= 20301
|
||||
LOCK_TIMERS_READ;
|
||||
@ -253,21 +255,21 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eR
|
||||
const cTimer *timer = Timers.Get(*it);
|
||||
#endif
|
||||
if (timer) {
|
||||
if (!AddMenuItemInitial(new cRecMenuItemTimer( timer,
|
||||
rmsTimerConflictShowInfo,
|
||||
rmsDeleteTimerConflictMenu,
|
||||
rmsEditTimerConflictMenu,
|
||||
rmsSearchRerunsTimerConflictMenu,
|
||||
conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
conflict->overlapStop,
|
||||
(!i)?true:false)
|
||||
))
|
||||
if (!AddMenuItemInitial(new cRecMenuItemTimer(timer,
|
||||
rmsTimerConflictShowInfo,
|
||||
rmsDeleteTimerConflictMenu,
|
||||
rmsEditTimerConflictMenu,
|
||||
rmsSearchRerunsTimerConflictMenu,
|
||||
conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
conflict->overlapStop,
|
||||
(!i) ? true : false)))
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
CalculateHeight();
|
||||
CreatePixmap();
|
||||
Arrange();
|
||||
@ -281,16 +283,16 @@ cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
|
||||
#else
|
||||
const cTimer *timer = Timers.Get(conflict->timerIDs[number]);
|
||||
#endif
|
||||
cRecMenuItem *result = new cRecMenuItemTimer( timer,
|
||||
rmsTimerConflictShowInfo,
|
||||
rmsDeleteTimerConflictMenu,
|
||||
rmsEditTimerConflictMenu,
|
||||
rmsSearchRerunsTimerConflictMenu,
|
||||
conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
conflict->overlapStop,
|
||||
false);
|
||||
cRecMenuItem *result = new cRecMenuItemTimer(timer,
|
||||
rmsTimerConflictShowInfo,
|
||||
rmsDeleteTimerConflictMenu,
|
||||
rmsEditTimerConflictMenu,
|
||||
rmsSearchRerunsTimerConflictMenu,
|
||||
conflict->timeStart,
|
||||
conflict->timeStop,
|
||||
conflict->overlapStart,
|
||||
conflict->overlapStop,
|
||||
false);
|
||||
return result;
|
||||
}
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user