mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Refactor cRecMenuTimeline
This commit is contained in:
parent
1f1498a734
commit
0289731158
@ -2554,6 +2554,8 @@ cRecMenuItemTimelineTimer::cRecMenuItemTimelineTimer(const cTimer *timer, time_t
|
||||
selectable = true;
|
||||
this->active = active;
|
||||
height = geoManager.osdHeight / 16;
|
||||
if (active)
|
||||
setActive();
|
||||
}
|
||||
|
||||
cRecMenuItemTimelineTimer::~cRecMenuItemTimelineTimer(void) {
|
||||
|
26
recmenus.c
26
recmenus.c
@ -1292,16 +1292,21 @@ cRecMenuSearchConfirmTimer::cRecMenuSearchConfirmTimer(const cEvent *event, eRec
|
||||
******************************************************************************************/
|
||||
|
||||
// --- cRecMenuTimeline ---------------------------------------------------------
|
||||
cRecMenuTimeline::cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts) {
|
||||
cRecMenuTimeline::cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts) { // OK
|
||||
SetWidthPercent(90);
|
||||
|
||||
numTimersToday = 0;
|
||||
this->timerConflicts = timerConflicts;
|
||||
SetStartStop();
|
||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||
GetTimersForDay();
|
||||
SetWidthPercent(90);
|
||||
|
||||
header = new cRecMenuItemTimelineHeader(timeStart, numTimersToday, conflictsToday);
|
||||
SetHeader(header);
|
||||
cRecMenuItem *footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true);
|
||||
SetFooter(footer);
|
||||
AddHeader(header);
|
||||
|
||||
footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true);
|
||||
AddFooter(footer);
|
||||
|
||||
SetTimers();
|
||||
}
|
||||
|
||||
@ -1313,7 +1318,6 @@ void cRecMenuTimeline::SetStartStop(void) {
|
||||
timeStop = timeStart + 24 * 3600 - 1;
|
||||
}
|
||||
|
||||
|
||||
void cRecMenuTimeline::GetTimersForDay(void) {
|
||||
timersToday.clear();
|
||||
#if VDRVERSNUM >= 20301
|
||||
@ -1352,14 +1356,12 @@ void cRecMenuTimeline::SetTimers(void) {
|
||||
footer->setActive();
|
||||
} else {
|
||||
for (int i = 0; i < numTimersToday; i++) {
|
||||
cRecMenuItemTimelineTimer *item = new cRecMenuItemTimelineTimer(timersToday[i], timeStart, timeStop, conflictsToday, header, false);
|
||||
if (i==0)
|
||||
item->setActive();
|
||||
if (!AddMenuItemInitial(item))
|
||||
if (!AddMenuItemInitial(new cRecMenuItemTimelineTimer(timersToday[i], timeStart, timeStop, conflictsToday, header, (i == 0) ? true : false)))
|
||||
break;
|
||||
}
|
||||
footer->setInactive();
|
||||
}
|
||||
|
||||
CalculateHeight();
|
||||
CreatePixmap();
|
||||
Arrange();
|
||||
@ -1382,9 +1384,7 @@ void cRecMenuTimeline::NextDay(void) {
|
||||
}
|
||||
|
||||
cRecMenuItem *cRecMenuTimeline::GetMenuItem(int number) {
|
||||
if (number < 0)
|
||||
return NULL;
|
||||
if (number >= numTimersToday)
|
||||
if ((number < 0) || (number >= numTimersToday))
|
||||
return NULL;
|
||||
return new cRecMenuItemTimelineTimer(timersToday[number], timeStart, timeStop, conflictsToday, header, false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user