fixed bug that EPGSearch Favorites Menu was not displayed correctly

This commit is contained in:
louis
2015-01-10 10:10:31 +01:00
parent abcb357b25
commit 74febbfe86
15 changed files with 98 additions and 18 deletions

View File

@@ -104,12 +104,13 @@ void cDisplayMenuItemCurrentMainView::Action(void) {
* cDisplayMenuItemCurrentSchedulesView
*************************************************************/
cDisplayMenuItemCurrentSchedulesView::cDisplayMenuItemCurrentSchedulesView(cTemplateViewElement *tmplCurrent, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat)
cDisplayMenuItemCurrentSchedulesView::cDisplayMenuItemCurrentSchedulesView(cTemplateViewElement *tmplCurrent, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat, bool isEpgSearchFav)
: cDisplayMenuItemCurrentView(tmplCurrent) {
this->event = event;
this->channel = channel;
this->timerMatch = timerMatch;
this->cat = cat;
this->isEpgSearchFav = isEpgSearchFav;
}
cDisplayMenuItemCurrentSchedulesView::~cDisplayMenuItemCurrentSchedulesView() {
@@ -120,9 +121,10 @@ void cDisplayMenuItemCurrentSchedulesView::Prepare(void) {
void cDisplayMenuItemCurrentSchedulesView::Render(void) {
intTokens.insert(pair<string,int>("whatson", (cat == mcSchedule) ? true: false));
intTokens.insert(pair<string,int>("whatson", (cat == mcSchedule)&&(!isEpgSearchFav) ? true: false));
intTokens.insert(pair<string,int>("whatsonnow", (cat == mcScheduleNow) ? true: false));
intTokens.insert(pair<string,int>("whatsonnext", (cat == mcScheduleNext) ? true: false));
intTokens.insert(pair<string,int>("whatsonfavorites", isEpgSearchFav ? true: false));
if (timerMatch == tmFull) {
intTokens.insert(pair<string,int>("timerpartitial", false));
intTokens.insert(pair<string,int>("timerfull", true));

View File

@@ -42,10 +42,11 @@ private:
const cChannel *channel;
eTimerMatch timerMatch;
eMenuCategory cat;
bool isEpgSearchFav;
void Action(void);
void ReadSchedules(vector< map<string,string> > *schedulesTokens);
public:
cDisplayMenuItemCurrentSchedulesView(cTemplateViewElement *tmplCurrent, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat);
cDisplayMenuItemCurrentSchedulesView(cTemplateViewElement *tmplCurrent, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat, bool isEpgSearchFav);
virtual ~cDisplayMenuItemCurrentSchedulesView();
void Prepare(void);
void Render(void);

View File

@@ -267,12 +267,13 @@ void cDisplayMenuItemMainView::SplitMenuText(void) {
cDisplayMenuItemSchedulesView::cDisplayMenuItemSchedulesView(cTemplateViewList *tmplList, const cEvent *event,
const cChannel *channel, eTimerMatch timerMatch,
eMenuCategory cat, bool current, bool selectable)
eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable)
: cDisplayMenuItemView(tmplList, current, selectable) {
this->event = event;
this->channel = channel;
this->timerMatch = timerMatch;
this->cat = cat;
this->isEpgSearchFav = isEpgSearchFav;
}
cDisplayMenuItemSchedulesView::~cDisplayMenuItemSchedulesView() {
@@ -285,9 +286,10 @@ void cDisplayMenuItemSchedulesView::SetTokens(void) {
intTokens.insert(pair<string,int>("current", current));
intTokens.insert(pair<string,int>("separator", !selectable));
intTokens.insert(pair<string,int>("nummenuitem", num+1));
intTokens.insert(pair<string,int>("whatson", (cat == mcSchedule) ? true: false));
intTokens.insert(pair<string,int>("whatson", (cat == mcSchedule)&&(!isEpgSearchFav) ? true: false));
intTokens.insert(pair<string,int>("whatsonnow", (cat == mcScheduleNow) ? true: false));
intTokens.insert(pair<string,int>("whatsonnext", (cat == mcScheduleNext) ? true: false));
intTokens.insert(pair<string,int>("whatsonfavorites", isEpgSearchFav ? true: false));
if (timerMatch == tmFull) {
intTokens.insert(pair<string,int>("timerpartitial", false));
intTokens.insert(pair<string,int>("timerfull", true));
@@ -360,7 +362,7 @@ void cDisplayMenuItemSchedulesView::Render(void) {
if (current) {
cTemplateViewElement *tmplCurrent = tmplList->GetListElementCurrent();
if (tmplCurrent) {
currentView = new cDisplayMenuItemCurrentSchedulesView(tmplCurrent, event, channel, timerMatch, cat);
currentView = new cDisplayMenuItemCurrentSchedulesView(tmplCurrent, event, channel, timerMatch, cat, isEpgSearchFav);
currentView->Start();
}
}

View File

@@ -74,10 +74,11 @@ private:
const cChannel *channel;
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 current, bool selectable);
eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable);
virtual ~cDisplayMenuItemSchedulesView();
void SetTokens(void);
void Prepare(void);

View File

@@ -138,14 +138,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 current, bool selectable) {
eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable) {
if (index >= itemCount)
return;
if (menuItems[index]) {
menuItems[index]->SetCurrent(current);
return;
}
cDisplayMenuItemView *item = new cDisplayMenuItemSchedulesView(tmplList, event, channel, timerMatch, cat, current, selectable);
cDisplayMenuItemView *item = new cDisplayMenuItemSchedulesView(tmplList, event, channel, timerMatch, cat, isEpgSearchFav, current, selectable);
menuItems[index] = item;
}

View File

@@ -23,7 +23,7 @@ public:
void AddDefaultMenuItem(int index, string *tabTexts, bool current, bool selectable);
void 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 current, bool selectable);
void AddSchedulesMenuItem(int index, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat, bool isEpgSearchFav, bool current, bool selectable);
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);

View File

@@ -50,6 +50,7 @@ public:
void SetTitle(const char *title);
void SetChannel(const cChannel *channel) { view->SetChannel(channel); };
const cChannel *GetChannel(void) { return view->GetChannel(); };
void SetEpgSearchFavorite(void) { if (view) view->SetEpgSearchFavorite(); };
void SetButtonTexts(const char *Red, const char *Green, const char *Yellow, const char *Blue);
void SetTabs(int tab1, int tab2, int tab3, int tab4, int tab5);
void SetMessage(eMessageType type, const char *text);

View File

@@ -599,6 +599,7 @@ void cDisplayMenuMainView::DrawCustomTokens(void) {
cDisplayMenuSchedulesView::cDisplayMenuSchedulesView(cTemplateView *tmplView, eMenuCategory menuCat, bool menuInit) : cDisplayMenuView(tmplView, menuInit) {
cat = menuCat;
channel = NULL;
isEpgSearchFavoritesMenu = false;
}
cDisplayMenuSchedulesView::~cDisplayMenuSchedulesView() {
@@ -614,9 +615,10 @@ bool cDisplayMenuSchedulesView::DrawHeader(void) {
map < string, string > stringTokens;
map < string, int > intTokens;
intTokens.insert(pair<string,int>("whatson", (cat == mcSchedule) ? true: false));
intTokens.insert(pair<string,int>("whatson", (cat == mcSchedule)&&(!isEpgSearchFavoritesMenu) ? true: false));
intTokens.insert(pair<string,int>("whatsonnow", (cat == mcScheduleNow) ? true: false));
intTokens.insert(pair<string,int>("whatsonnext", (cat == mcScheduleNext) ? true: false));
intTokens.insert(pair<string,int>("whatsonfavorites", isEpgSearchFavoritesMenu ? true: false));
stringTokens.insert(pair<string,string>("title", menuTitle));
stringTokens.insert(pair<string,string>("vdrversion", VDRVERSION));

View File

@@ -18,6 +18,7 @@ public:
void SetTitle(const char *title) {menuTitle = title; };
virtual void SetChannel(const cChannel *channel) {};
virtual const cChannel *GetChannel(void) { return NULL; };
virtual void SetEpgSearchFavorite(void) {};
void SetButtonTexts(string *buttonTexts) { this->buttonTexts = buttonTexts; };
bool DrawBackground(void);
virtual bool DrawHeader(void);
@@ -52,11 +53,13 @@ public:
class cDisplayMenuSchedulesView : public cDisplayMenuView {
private:
const cChannel *channel;
bool isEpgSearchFavoritesMenu;
public:
cDisplayMenuSchedulesView(cTemplateView *tmplView, eMenuCategory menuCat, bool menuInit);
virtual ~cDisplayMenuSchedulesView();
void SetChannel(const cChannel *channel) { if (channel) this->channel = channel; };
const cChannel *GetChannel(void) { return channel; };
void SetEpgSearchFavorite(void) { isEpgSearchFavoritesMenu = true; };
bool DrawHeader(void);
};