added possibility to hide root menu from a subview template

This commit is contained in:
louis 2015-03-15 18:11:07 +01:00
parent b6e6065b0f
commit 19dfd1af7b
7 changed files with 34 additions and 2 deletions

View File

@ -214,4 +214,6 @@ Version 0.3.0
- fixed bug detecting menu item numbers in main menu - fixed bug detecting menu item numbers in main menu
- fixed recording progress bar in nopacity - fixed recording progress bar in nopacity
- added <systemmemory> viewelement in main menu - added <systemmemory> viewelement in main menu
- added possibility to hide root menu from a subview template

View File

@ -13,6 +13,7 @@
scaletvy CDATA #IMPLIED scaletvy CDATA #IMPLIED
scaletvwidth CDATA #IMPLIED scaletvwidth CDATA #IMPLIED
scaletvheight CDATA #IMPLIED scaletvheight CDATA #IMPLIED
hideroot CDATA #IMPLIED
> >
<!ELEMENT viewelement (area|areascroll)*> <!ELEMENT viewelement (area|areascroll)*>

View File

@ -125,6 +125,8 @@ void cTemplateFunction::SetParameters(vector<pair<string, string> > params) {
p.first = ptScaleTvWidth; p.first = ptScaleTvWidth;
} else if (!name.compare("scaletvheight")) { } else if (!name.compare("scaletvheight")) {
p.first = ptScaleTvHeight; p.first = ptScaleTvHeight;
} else if (!name.compare("hideroot")) {
p.first = ptHideRoot;
} else if (!name.compare("cache")) { } else if (!name.compare("cache")) {
p.first = ptCache; p.first = ptCache;
} else if (!name.compare("determinatefont")) { } else if (!name.compare("determinatefont")) {
@ -260,6 +262,10 @@ bool cTemplateFunction::CalculateParameters(void) {
break; break;
case ptOverflow: case ptOverflow:
paramValid = SetOverflow(value); paramValid = SetOverflow(value);
break;
case ptHideRoot:
paramValid = SetHideRoot(value);
break;
default: default:
paramValid = true; paramValid = true;
break; break;
@ -1046,6 +1052,14 @@ bool cTemplateFunction::SetOverflow(string value) {
return ok; return ok;
} }
bool cTemplateFunction::SetHideRoot(string value) {
bool hideRoot = 0;
if (!value.compare("true"))
hideRoot = 1;
numericParameters.insert(pair<eParamType, int>(ptHideRoot, hideRoot));
return true;
}
void cTemplateFunction::ParseStringParameters(void) { void cTemplateFunction::ParseStringParameters(void) {
//first replace stringtokens in Text (drawText) //first replace stringtokens in Text (drawText)
stringstream text; stringstream text;

View File

@ -76,6 +76,7 @@ enum eParamType {
ptScaleTvY, ptScaleTvY,
ptScaleTvWidth, ptScaleTvWidth,
ptScaleTvHeight, ptScaleTvHeight,
ptHideRoot,
ptCache, ptCache,
ptDeterminateFont, ptDeterminateFont,
ptNone ptNone
@ -150,6 +151,7 @@ protected:
bool SetOrientation(string value); bool SetOrientation(string value);
bool SetFloating(string value); bool SetFloating(string value);
bool SetOverflow(string value); bool SetOverflow(string value);
bool SetHideRoot(string value);
void ParseStringParameters(void); void ParseStringParameters(void);
void ParseNumericalParameters(void); void ParseNumericalParameters(void);
void CalculateAlign(int elementWidth, int elementHeight); void CalculateAlign(int elementWidth, int elementHeight);

View File

@ -194,6 +194,13 @@ int cTemplateView::GetNumPixmapsViewElement(eViewElement ve) {
return viewElement->GetNumPixmaps(); return viewElement->GetNumPixmaps();
} }
bool cTemplateView::HideView(void) {
if (!parameters)
return false;
return parameters->GetNumericParameter(ptHideRoot);
}
bool cTemplateView::ExecuteView(eViewElement ve) { bool cTemplateView::ExecuteView(eViewElement ve) {
map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve); map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve);
if (hit == viewElements.end()) if (hit == viewElements.end())
@ -1878,6 +1885,7 @@ cTemplateViewPlugin::cTemplateViewPlugin(string pluginName, int viewID) {
attributes.insert("scaletvy"); attributes.insert("scaletvy");
attributes.insert("scaletvwidth"); attributes.insert("scaletvwidth");
attributes.insert("scaletvheight"); attributes.insert("scaletvheight");
attributes.insert("hideroot");
funcsAllowed.insert(pair< string, set<string> >(viewName, attributes)); funcsAllowed.insert(pair< string, set<string> >(viewName, attributes));
//definition of allowed parameters for viewtab //definition of allowed parameters for viewtab

View File

@ -109,6 +109,7 @@ public:
cRect GetOsdSize(void); cRect GetOsdSize(void);
int GetNumPixmaps(void); int GetNumPixmaps(void);
int GetNumPixmapsViewElement(eViewElement ve); int GetNumPixmapsViewElement(eViewElement ve);
bool HideView(void);
bool ExecuteView(eViewElement ve); bool ExecuteView(eViewElement ve);
int GetNumListViewMenuItems(void); int GetNumListViewMenuItems(void);
bool GetScalingWindow(cRect &scalingWindow); bool GetScalingWindow(cRect &scalingWindow);

View File

@ -34,8 +34,12 @@ bool cDisplayPluginView::createOsd(void) {
void cDisplayPluginView::Deactivate(bool hide) { void cDisplayPluginView::Deactivate(bool hide) {
Stop(); Stop();
if (!hide) if (!hide) {
return; bool hideFromTemplate = tmplView->HideView();
if (!hideFromTemplate)
return;
esyslog("skindesigner: hiding from template");
}
HidePixmaps(); HidePixmaps();
for (map< int, cViewGrid* >::iterator it = viewGrids.begin(); it != viewGrids.end(); it++) { for (map< int, cViewGrid* >::iterator it = viewGrids.begin(); it != viewGrids.end(); it++) {
cViewGrid *viewGrid = it->second; cViewGrid *viewGrid = it->second;