From 4ef2c616801032cc7b3d6d3fec2d182688637eba Mon Sep 17 00:00:00 2001 From: louis Date: Thu, 14 May 2015 12:09:44 +0200 Subject: [PATCH] fixed dayseparators in schedules menu --- HISTORY | 1 + displaymenu.c | 4 +++- views/displaymenuitemview.c | 6 +++++- views/displaymenuitemview.h | 3 ++- views/displaymenulistview.c | 4 ++-- views/displaymenulistview.h | 2 +- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/HISTORY b/HISTORY index 1caafd9..eecde0e 100644 --- a/HISTORY +++ b/HISTORY @@ -323,4 +323,5 @@ Version 0.4.5 - implemented shiftout for views - fixed blinking for animated views - chachged displaymessage in menus to detachable +- fixed dayseparators in schedules menu diff --git a/displaymenu.c b/displaymenu.c index c533032..ae461a8 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -122,7 +122,7 @@ bool cSDDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current, cDisplayMenuListView *list = rootView->GetListView(); if (!list) return false; - list->AddSchedulesMenuItem(Index, Event, channel, TimerMatch, MenuCategory(), isFav, Current, Selectable); + list->AddSchedulesMenuItem(Index, Event, channel, TimerMatch, MenuCategory(), isFav, Current, Selectable, ""); if (state == vsIdle) state = vsMenuUpdate; return true; @@ -209,6 +209,8 @@ void cSDDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Sel } } else if (cat == mcSetup && rootView->SubViewAvailable()) { list->AddSetupMenuItem(Index, Text, Current, Selectable); + } else if ((cat == mcSchedule || cat == mcScheduleNow || cat == mcScheduleNext) && rootView->SubViewAvailable()) { + list->AddSchedulesMenuItem(Index, NULL, NULL, tmNone, MenuCategory(), false, Current, Selectable, Text); } else { rootView->CorrectDefaultMenu(); string *tabTexts = new string[MaxTabs]; diff --git a/views/displaymenuitemview.c b/views/displaymenuitemview.c index eb865be..6cfef9a 100644 --- a/views/displaymenuitemview.c +++ b/views/displaymenuitemview.c @@ -319,10 +319,12 @@ void cDisplayMenuItemMainView::CheckPlugins(void) { cDisplayMenuItemSchedulesView::cDisplayMenuItemSchedulesView(cTemplateViewList *tmplList, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, - eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable) + eMenuCategory cat, bool isEpgSearchFav, bool current, + bool selectable, string dayseparator) : cDisplayMenuItemView(tmplList, current, selectable) { this->event = event; this->channel = channel; + this->dayseparator = dayseparator; this->timerMatch = timerMatch; this->cat = cat; this->isEpgSearchFav = isEpgSearchFav; @@ -384,6 +386,8 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) { } else { stringTokens.insert(pair("title", event->Title() ? ParseSeparator(event->Title()) : "")); } + } else { + stringTokens.insert(pair("title", dayseparator)); } if (channel) { stringTokens.insert(pair("channelname", channel->Name() ? channel->Name() : "")); diff --git a/views/displaymenuitemview.h b/views/displaymenuitemview.h index 1108571..fb818b0 100644 --- a/views/displaymenuitemview.h +++ b/views/displaymenuitemview.h @@ -78,13 +78,14 @@ class cDisplayMenuItemSchedulesView: public cDisplayMenuItemView { private: const cEvent *event; const cChannel *channel; + string dayseparator; eTimerMatch timerMatch; eMenuCategory cat; bool isEpgSearchFav; string ParseSeparator(string sep); public: cDisplayMenuItemSchedulesView(cTemplateViewList *tmplList, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, - eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable); + eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable, string dayseparator); virtual ~cDisplayMenuItemSchedulesView(); void SetTokens(void); void Prepare(void); diff --git a/views/displaymenulistview.c b/views/displaymenulistview.c index 87845d7..f40b129 100644 --- a/views/displaymenulistview.c +++ b/views/displaymenulistview.c @@ -145,14 +145,14 @@ void cDisplayMenuListView::AddSetupMenuItem(int index, const char *itemText, boo } void cDisplayMenuListView::AddSchedulesMenuItem(int index, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, - eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable) { + eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable, string dayseparator) { if (index >= itemCount) return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return; } - cDisplayMenuItemView *item = new cDisplayMenuItemSchedulesView(tmplList, event, channel, timerMatch, cat, isEpgSearchFav, current, selectable); + cDisplayMenuItemView *item = new cDisplayMenuItemSchedulesView(tmplList, event, channel, timerMatch, cat, isEpgSearchFav, current, selectable, dayseparator); menuItems[index] = item; } diff --git a/views/displaymenulistview.h b/views/displaymenulistview.h index 60758cf..4e69457 100644 --- a/views/displaymenulistview.h +++ b/views/displaymenulistview.h @@ -26,7 +26,7 @@ public: void AddDefaultMenuItem(int index, string *tabTexts, bool current, bool selectable); string AddMainMenuItem(int index, const char *itemText, bool current, bool selectable); void AddSetupMenuItem(int index, const char *itemText, bool current, bool selectable); - void AddSchedulesMenuItem(int index, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable); + void AddSchedulesMenuItem(int index, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable, string dayseparator); void AddChannelsMenuItem(int index, const cChannel *channel, bool withProvider, bool current, bool selectable); void AddTimersMenuItem(int index, const cTimer *timer, bool current, bool selectable); void AddRecordingMenuItem(int index, const cRecording *recording, int level, int total, int isNew, bool current, bool selectable);