mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Show numTimersToday in timeline
This commit is contained in:
parent
874f5cd9d5
commit
8129d116fb
@ -2312,13 +2312,14 @@ void cRecMenuItemRecording::Show(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- cRecMenuItemTimelineHeader -------------------------------------------------------
|
// --- cRecMenuItemTimelineHeader -------------------------------------------------------
|
||||||
cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday) {
|
cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday) {
|
||||||
conflicts = conflictsToday;
|
conflicts = conflictsToday;
|
||||||
pixmapTimeline = NULL;
|
pixmapTimeline = NULL;
|
||||||
pixmapTimerInfo = NULL;
|
pixmapTimerInfo = NULL;
|
||||||
pixmapTimerConflicts = NULL;
|
pixmapTimerConflicts = NULL;
|
||||||
timer = NULL;
|
timer = NULL;
|
||||||
this->day = day;
|
this->day = day;
|
||||||
|
this->numTimersToday = numTimersToday;
|
||||||
selectable = false;
|
selectable = false;
|
||||||
active = false;
|
active = false;
|
||||||
height = 5 * font->Height();
|
height = 5 * font->Height();
|
||||||
@ -2367,7 +2368,7 @@ void cRecMenuItemTimelineHeader::Draw(void) {
|
|||||||
}
|
}
|
||||||
DrawTimerConflicts();
|
DrawTimerConflicts();
|
||||||
pixmap->Fill(clrTransparent);
|
pixmap->Fill(clrTransparent);
|
||||||
cString headerText = tr("Timers for");
|
cString headerText = cString::sprintf("%i %s", numTimersToday, tr("Timers for"));
|
||||||
cString dateText = DateString(day);
|
cString dateText = DateString(day);
|
||||||
cString header = cString::sprintf("%s: %s", *headerText, *dateText);
|
cString header = cString::sprintf("%s: %s", *headerText, *dateText);
|
||||||
int xText = (width - fontLarge->Width(*header)) / 2;
|
int xText = (width - fontLarge->Width(*header)) / 2;
|
||||||
|
@ -575,17 +575,19 @@ private:
|
|||||||
cPixmap *pixmapTimerConflicts;
|
cPixmap *pixmapTimerConflicts;
|
||||||
int width5Mins;
|
int width5Mins;
|
||||||
int x0;
|
int x0;
|
||||||
|
int numTimersToday;
|
||||||
bool timelineDrawn;
|
bool timelineDrawn;
|
||||||
void DrawTimeline(void);
|
void DrawTimeline(void);
|
||||||
void DrawTimerConflicts(void);
|
void DrawTimerConflicts(void);
|
||||||
void DrawCurrentTimer(void);
|
void DrawCurrentTimer(void);
|
||||||
public:
|
public:
|
||||||
cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday);
|
cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday);
|
||||||
virtual ~cRecMenuItemTimelineHeader(void);
|
virtual ~cRecMenuItemTimelineHeader(void);
|
||||||
void SetDay(time_t day) { this->day = day; };
|
void SetDay(time_t day) { this->day = day; };
|
||||||
void SetPixmaps(void);
|
void SetPixmaps(void);
|
||||||
void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
|
void SetCurrentTimer(const cTimer *timer) { this->timer = timer; };
|
||||||
void UnsetCurrentTimer(void) { timer = NULL; };
|
void UnsetCurrentTimer(void) { timer = NULL; };
|
||||||
|
void SetNumTimersToday(int numTimersToday) { this->numTimersToday = numTimersToday; };
|
||||||
void RefreshTimerDisplay(void);
|
void RefreshTimerDisplay(void);
|
||||||
void Hide(void);
|
void Hide(void);
|
||||||
void Show(void);
|
void Show(void);
|
||||||
|
@ -1414,7 +1414,7 @@ cRecMenuTimeline::cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts) {
|
|||||||
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop);
|
||||||
GetTimersForDay();
|
GetTimersForDay();
|
||||||
SetWidthPercent(95);
|
SetWidthPercent(95);
|
||||||
header = new cRecMenuItemTimelineHeader(timeStart, conflictsToday);
|
header = new cRecMenuItemTimelineHeader(timeStart, numTimersToday, conflictsToday);
|
||||||
SetHeader(header);
|
SetHeader(header);
|
||||||
cRecMenuItem *footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true);
|
cRecMenuItem *footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true);
|
||||||
SetFooter(footer);
|
SetFooter(footer);
|
||||||
@ -1456,6 +1456,7 @@ void cRecMenuTimeline::SetTimers(void) {
|
|||||||
if (numTimersToday == 0) {
|
if (numTimersToday == 0) {
|
||||||
AddMenuItem(new cRecMenuItemTimelineTimer(NULL, 0, 0, conflictsToday, header, false));
|
AddMenuItem(new cRecMenuItemTimelineTimer(NULL, 0, 0, conflictsToday, header, false));
|
||||||
header->UnsetCurrentTimer();
|
header->UnsetCurrentTimer();
|
||||||
|
header->SetNumTimersToday(0);
|
||||||
footer->setActive();
|
footer->setActive();
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i<numTimersToday; i++) {
|
for (int i = 0; i<numTimersToday; i++) {
|
||||||
@ -1464,6 +1465,7 @@ void cRecMenuTimeline::SetTimers(void) {
|
|||||||
item->setActive();
|
item->setActive();
|
||||||
if (!AddMenuItemInitial(item))
|
if (!AddMenuItemInitial(item))
|
||||||
break;
|
break;
|
||||||
|
header->SetNumTimersToday(numTimersToday);
|
||||||
}
|
}
|
||||||
footer->setInactive();
|
footer->setInactive();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user