diff options
author | louis <louis.braun@gmx.de> | 2016-04-30 06:49:30 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2016-04-30 06:49:30 +0200 |
commit | f4f64e96e5cd5856305498dd562247cdf6474fff (patch) | |
tree | 7d51c3ca4c731f383d891b83ed4de24d7ef21345 /coreengine/viewdisplaymenu.c | |
parent | 4076377e213c45f1f0e07c288ea48aa9faa37d90 (diff) | |
download | vdr-plugin-skindesigner-f4f64e96e5cd5856305498dd562247cdf6474fff.tar.gz vdr-plugin-skindesigner-f4f64e96e5cd5856305498dd562247cdf6474fff.tar.bz2 |
improved estuary4vdr
Diffstat (limited to 'coreengine/viewdisplaymenu.c')
-rw-r--r-- | coreengine/viewdisplaymenu.c | 58 |
1 files changed, 25 insertions, 33 deletions
diff --git a/coreengine/viewdisplaymenu.c b/coreengine/viewdisplaymenu.c index 07de9fe..9376879 100644 --- a/coreengine/viewdisplaymenu.c +++ b/coreengine/viewdisplaymenu.c @@ -639,40 +639,33 @@ cSubView::cSubView(const char *name) { colorbuttons = NULL; scrollbar = NULL; viewList = NULL; - viewListVertical = NULL; - viewListHorizontal = NULL; SetViewElements(); } cSubView::~cSubView(void) { - delete viewListHorizontal; - delete viewListVertical; + for(vector<cViewList*>::iterator it = viewLists.begin(); it != viewLists.end(); it++) { + delete (*it); + } } void cSubView::SetGlobals(cGlobals *globals) { cView::SetGlobals(globals); - if (viewListVertical) - viewListVertical->SetGlobals(globals); - if (viewListHorizontal) - viewListHorizontal->SetGlobals(globals); + for(vector<cViewList*>::iterator it = viewLists.begin(); it != viewLists.end(); it++) { + (*it)->SetGlobals(globals); + } } void cSubView::PreCache(void) { attribs->SetContainer(container.X(), container.Y(), container.Width(), container.Height()); attribs->Cache(); - cView::PreCache(); - if (viewListVertical) { - viewListVertical->SetPlugId(plugId); - viewListVertical->SetPlugMenuId(plugMenuId); - viewListVertical->SetContainer(attribs->X(), attribs->Y(), attribs->Width(), attribs->Height()); - viewListVertical->PreCache(); - } - if (viewListHorizontal) { - viewListHorizontal->SetPlugId(plugId); - viewListHorizontal->SetPlugMenuId(plugMenuId); - viewListHorizontal->SetContainer(attribs->X(), attribs->Y(), attribs->Width(), attribs->Height()); - viewListHorizontal->PreCache(); + for(vector<cViewList*>::iterator it = viewLists.begin(); it != viewLists.end(); it++) { + cViewList *vl = (*it); + vl->SetPlugId(plugId); + vl->SetPlugMenuId(plugMenuId); + vl->SetContainer(attribs->X(), attribs->Y(), attribs->Width(), attribs->Height()); + vl->PreCache(); } + cView::PreCache(); } bool cSubView::ViewElementSet(int ve) { @@ -769,14 +762,7 @@ void cSubView::SetViewElementHorizontal(eVeDisplayMenu ve, cViewElement *viewEle } void cSubView::AddViewList(cViewList *viewList) { - eOrientation orientation = viewList->Orientation(); - if (orientation == eOrientation::vertical) { - viewListVertical = viewList; - } else if (orientation == eOrientation::horizontal) { - viewListHorizontal = viewList; - } else { - viewListVertical = viewList; - } + viewLists.push_back(viewList); } int cSubView::NumListItems(void) { @@ -987,11 +973,17 @@ void cSubView::SetViewElementObjects(void) { else if (viewElements[(int)eVeDisplayMenu::scrollbar]) scrollbar = dynamic_cast<cVeDmScrollbar*>(viewElements[(int)eVeDisplayMenu::scrollbar]); - - if (attribs->Orientation() == eOrientation::horizontal) - viewList = viewListHorizontal; - else - viewList = viewListVertical; + //set appropriate viewlist, orientation and condition have to be considered + for(vector<cViewList*>::iterator it = viewLists.begin(); it != viewLists.end(); it++) { + cViewList *vl = (*it); + if (vl->Orientation() == orientation && vl->Execute()) { + viewList = vl; + break; + } + } + if (!viewList && viewLists.size() > 0) { + viewList = viewLists.front(); + } } void cSubView::SetViewElements(void) { |