diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2019-11-09 11:55:25 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2022-06-18 17:03:15 +0200 |
commit | 33196207d0f72bf63206253c4fadab773c89add1 (patch) | |
tree | 2455b16c5528f8a0f37cf19302060b4b7dc6ee1a /recmenus.c | |
parent | 73e331f97f6238112ca196cc71001916a8d4df54 (diff) | |
download | vdr-plugin-tvguide-33196207d0f72bf63206253c4fadab773c89add1.tar.gz vdr-plugin-tvguide-33196207d0f72bf63206253c4fadab773c89add1.tar.bz2 |
Refactor cRecMenuTimerConflict
Diffstat (limited to 'recmenus.c')
-rw-r--r-- | recmenus.c | 56 |
1 files changed, 29 insertions, 27 deletions
@@ -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,26 +255,26 @@ 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(); } - + cRecMenuItem *cRecMenuTimerConflict::GetMenuItem(int number) { if ((number >= 0) && (number < totalNumMenuItems)) { #if VDRVERSNUM >= 20301 @@ -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; |