diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2020-03-02 11:37:50 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2020-03-02 13:33:58 +0100 |
commit | 8129d116fb6f8b2c77c9e3ad3dac7e18716b91f8 (patch) | |
tree | a57052168d42a78e9edc60a8f04238be44bed151 | |
parent | 874f5cd9d5856fdb12933766238345c38497ad7f (diff) | |
download | vdr-plugin-tvguide-8129d116fb6f8b2c77c9e3ad3dac7e18716b91f8.tar.gz vdr-plugin-tvguide-8129d116fb6f8b2c77c9e3ad3dac7e18716b91f8.tar.bz2 |
Show numTimersToday in timeline
-rw-r--r-- | recmenuitem.c | 5 | ||||
-rw-r--r-- | recmenuitem.h | 4 | ||||
-rw-r--r-- | recmenus.c | 6 |
3 files changed, 10 insertions, 5 deletions
diff --git a/recmenuitem.c b/recmenuitem.c index e8edf79..db54c2c 100644 --- a/recmenuitem.c +++ b/recmenuitem.c @@ -2312,13 +2312,14 @@ void cRecMenuItemRecording::Show(void) { } // --- cRecMenuItemTimelineHeader ------------------------------------------------------- -cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday) { +cRecMenuItemTimelineHeader::cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday) { conflicts = conflictsToday; pixmapTimeline = NULL; pixmapTimerInfo = NULL; pixmapTimerConflicts = NULL; timer = NULL; this->day = day; + this->numTimersToday = numTimersToday; selectable = false; active = false; height = 5 * font->Height(); @@ -2367,7 +2368,7 @@ void cRecMenuItemTimelineHeader::Draw(void) { } DrawTimerConflicts(); pixmap->Fill(clrTransparent); - cString headerText = tr("Timers for"); + cString headerText = cString::sprintf("%i %s", numTimersToday, tr("Timers for")); cString dateText = DateString(day); cString header = cString::sprintf("%s: %s", *headerText, *dateText); int xText = (width - fontLarge->Width(*header)) / 2; diff --git a/recmenuitem.h b/recmenuitem.h index e91b52f..866391e 100644 --- a/recmenuitem.h +++ b/recmenuitem.h @@ -575,17 +575,19 @@ private: cPixmap *pixmapTimerConflicts; int width5Mins; int x0; + int numTimersToday; bool timelineDrawn; void DrawTimeline(void); void DrawTimerConflicts(void); void DrawCurrentTimer(void); public: - cRecMenuItemTimelineHeader(time_t day, std::vector<cTVGuideTimerConflict*> conflictsToday); + cRecMenuItemTimelineHeader(time_t day, int numTimersToday, std::vector<cTVGuideTimerConflict*> conflictsToday); virtual ~cRecMenuItemTimelineHeader(void); void SetDay(time_t day) { this->day = day; }; void SetPixmaps(void); void SetCurrentTimer(const cTimer *timer) { this->timer = timer; }; void UnsetCurrentTimer(void) { timer = NULL; }; + void SetNumTimersToday(int numTimersToday) { this->numTimersToday = numTimersToday; }; void RefreshTimerDisplay(void); void Hide(void); void Show(void); @@ -1414,7 +1414,7 @@ cRecMenuTimeline::cRecMenuTimeline(cTVGuideTimerConflicts *timerConflicts) { conflictsToday = timerConflicts->GetConflictsBetween(timeStart, timeStop); GetTimersForDay(); SetWidthPercent(95); - header = new cRecMenuItemTimelineHeader(timeStart, conflictsToday); + header = new cRecMenuItemTimelineHeader(timeStart, numTimersToday, conflictsToday); SetHeader(header); cRecMenuItem *footer = new cRecMenuItemButton(tr("Close"), rmsClose, false, true); SetFooter(footer); @@ -1456,14 +1456,16 @@ void cRecMenuTimeline::SetTimers(void) { if (numTimersToday == 0) { AddMenuItem(new cRecMenuItemTimelineTimer(NULL, 0, 0, conflictsToday, header, false)); header->UnsetCurrentTimer(); + header->SetNumTimersToday(0); footer->setActive(); } else { - for (int i=0; i<numTimersToday; i++) { + 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)) break; + header->SetNumTimersToday(numTimersToday); } footer->setInactive(); } |