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
20
recmenus.c
20
recmenus.c
@ -234,17 +234,19 @@ int cRecMenuTimerConflicts::GetTimerConflict(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- cRecMenuTimerConflict ---------------------------------------------------------
|
// --- cRecMenuTimerConflict ---------------------------------------------------------
|
||||||
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction) {
|
cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eRecMenuState nextAction) { //OK
|
||||||
SetWidthPercent(95);
|
SetWidthPercent(90);
|
||||||
|
|
||||||
this->conflict = conflict;
|
this->conflict = conflict;
|
||||||
totalNumMenuItems = (int)conflict->timerIDs.size();
|
totalNumMenuItems = (int)conflict->timerIDs.size();
|
||||||
|
|
||||||
SetHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
AddHeader(new cRecMenuItemTimerConflictHeader(conflict->timeStart,
|
||||||
conflict->timeStop,
|
conflict->timeStop,
|
||||||
conflict->overlapStart,
|
conflict->overlapStart,
|
||||||
conflict->overlapStop));
|
conflict->overlapStop));
|
||||||
SetFooter(new cRecMenuItemButton(tr("Ignore Conflict"), nextAction, false, true));
|
AddFooter(new cRecMenuItemButton(tr("Ignore Conflict"), nextAction, false, true));
|
||||||
int i=0;
|
|
||||||
|
int i = 0;
|
||||||
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
|
for(std::vector<int>::iterator it = conflict->timerIDs.begin(); it != conflict->timerIDs.end(); it++) {
|
||||||
#if VDRVERSNUM >= 20301
|
#if VDRVERSNUM >= 20301
|
||||||
LOCK_TIMERS_READ;
|
LOCK_TIMERS_READ;
|
||||||
@ -253,7 +255,7 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eR
|
|||||||
const cTimer *timer = Timers.Get(*it);
|
const cTimer *timer = Timers.Get(*it);
|
||||||
#endif
|
#endif
|
||||||
if (timer) {
|
if (timer) {
|
||||||
if (!AddMenuItemInitial(new cRecMenuItemTimer( timer,
|
if (!AddMenuItemInitial(new cRecMenuItemTimer(timer,
|
||||||
rmsTimerConflictShowInfo,
|
rmsTimerConflictShowInfo,
|
||||||
rmsDeleteTimerConflictMenu,
|
rmsDeleteTimerConflictMenu,
|
||||||
rmsEditTimerConflictMenu,
|
rmsEditTimerConflictMenu,
|
||||||
@ -262,12 +264,12 @@ cRecMenuTimerConflict::cRecMenuTimerConflict(cTVGuideTimerConflict *conflict, eR
|
|||||||
conflict->timeStop,
|
conflict->timeStop,
|
||||||
conflict->overlapStart,
|
conflict->overlapStart,
|
||||||
conflict->overlapStop,
|
conflict->overlapStop,
|
||||||
(!i)?true:false)
|
(!i) ? true : false)))
|
||||||
))
|
|
||||||
break;
|
break;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CalculateHeight();
|
CalculateHeight();
|
||||||
CreatePixmap();
|
CreatePixmap();
|
||||||
Arrange();
|
Arrange();
|
||||||
@ -281,7 +283,7 @@ cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) {
|
|||||||
#else
|
#else
|
||||||
const cTimer *timer = Timers.Get(conflict->timerIDs[number]);
|
const cTimer *timer = Timers.Get(conflict->timerIDs[number]);
|
||||||
#endif
|
#endif
|
||||||
cRecMenuItem *result = new cRecMenuItemTimer( timer,
|
cRecMenuItem *result = new cRecMenuItemTimer(timer,
|
||||||
rmsTimerConflictShowInfo,
|
rmsTimerConflictShowInfo,
|
||||||
rmsDeleteTimerConflictMenu,
|
rmsDeleteTimerConflictMenu,
|
||||||
rmsEditTimerConflictMenu,
|
rmsEditTimerConflictMenu,
|
||||||
|
Loading…
Reference in New Issue
Block a user