using default menu list in case an invalid MenuCategory is set

This commit is contained in:
louis 2014-10-25 17:29:41 +02:00
parent 0b9e3787a2
commit ce67dea08a
3 changed files with 28 additions and 10 deletions

View File

@ -33,5 +33,7 @@ Version 0.0.2
- if a subview is completely not set in a skin, the default menu is used
- fixed a bug if displaydetailedtext is called without correct menucat (mailbox plugin)
- implemented function drawslope, see Wiki for documentation
- using default menu list in case an invalid MenuCategory is set

View File

@ -12,6 +12,10 @@ cDisplayMenuRootView::cDisplayMenuRootView(cTemplateView *rootView) : cView(root
view = NULL;
listView = NULL;
detailView = NULL;
buttonTexts[0] = "";
buttonTexts[1] = "";
buttonTexts[2] = "";
buttonTexts[3] = "";
defaultBackgroundDrawn = false;
defaultHeaderDrawn = false;
defaultButtonsDrawn = false;
@ -216,14 +220,24 @@ void cDisplayMenuRootView::SetMessage(eMessageType type, const char *text) {
}
void cDisplayMenuRootView::SetDetailedViewEvent(const cEvent *event) {
if (!detailView)
detailView = new cDisplayMenuDetailView(subView);
if (!detailView) {
if (viewType != svMenuDetailedEpg) {
SetMenu(mcEvent, true);
} else {
detailView = new cDisplayMenuDetailView(subView);
}
}
detailView->SetEvent(event);
}
void cDisplayMenuRootView::SetDetailedViewRecording(const cRecording *recording) {
if (!detailView)
detailView = new cDisplayMenuDetailView(subView);
if (!detailView) {
if (viewType != svMenuDetailedRecording) {
SetMenu(mcRecordingInfo, true);
} else {
detailView = new cDisplayMenuDetailView(subView);
}
}
detailView->SetRecording(recording);
}
@ -231,7 +245,6 @@ void cDisplayMenuRootView::SetDetailedViewText(const char *text) {
if (!detailView) {
if (viewType != svMenuDetailedText) {
SetMenu(mcText, true);
SetButtonTexts(NULL, NULL, NULL, NULL);
} else {
detailView = new cDisplayMenuDetailView(subView);
}
@ -281,7 +294,9 @@ int cDisplayMenuRootView::GetMaxItems(void) {
if (listView) {
return listView->GetMaxItems();
}
return 0;
//wrong menucat
SetMenu(mcUnknown, true);
return listView->GetMaxItems();
}
int cDisplayMenuRootView::GetListViewWidth(void) {

View File

@ -12,6 +12,7 @@ cDisplayMenuView::cDisplayMenuView(cTemplateView *tmplView, bool menuInit) : cVi
else
SetFadeTime(0);
cat = mcUndefined;
buttonTexts = NULL;
}
cDisplayMenuView::~cDisplayMenuView() {
@ -106,10 +107,10 @@ bool cDisplayMenuView::DrawColorButtons(void) {
map < string, string > stringTokens;
map < string, int > intTokens;
stringTokens.insert(pair<string,string>("red", buttonTexts[0]));
stringTokens.insert(pair<string,string>("green", buttonTexts[1]));
stringTokens.insert(pair<string,string>("yellow", buttonTexts[2]));
stringTokens.insert(pair<string,string>("blue", buttonTexts[3]));
stringTokens.insert(pair<string,string>("red", buttonTexts ? buttonTexts[0] : ""));
stringTokens.insert(pair<string,string>("green", buttonTexts ? buttonTexts[1]: ""));
stringTokens.insert(pair<string,string>("yellow", buttonTexts ? buttonTexts[2]: ""));
stringTokens.insert(pair<string,string>("blue", buttonTexts ? buttonTexts[3] : ""));
int colorKeys[4] = { Setup.ColorKey0, Setup.ColorKey1, Setup.ColorKey2, Setup.ColorKey3 };