added parameter mode to viewelement <devices>

This commit is contained in:
louis
2015-04-01 13:26:36 +02:00
parent 25505767d3
commit 7c9ad39e95
17 changed files with 61 additions and 14 deletions

View File

@@ -423,11 +423,16 @@ bool cDisplayMenuMainView::DrawDevices(void) {
if (!ExecuteViewElement(veDevices)) {
return false;
}
string mode = tmplView->GetViewElementMode(veDevices);
bool light = false;
if (!mode.compare("light")) {
light = true;
}
bool changed = false;
if (DetachViewElement(veDevices)) {
cViewElement *viewElement = GetViewElement(veDevices);
if (!viewElement) {
viewElement = new cViewElementDevices(tmplView->GetViewElement(veDevices));
viewElement = new cViewElementDevices(light, tmplView->GetViewElement(veDevices));
AddViewElement(veDevices, viewElement);
viewElement->Start();
changed = true;
@@ -441,7 +446,7 @@ bool cDisplayMenuMainView::DrawDevices(void) {
map < string, vector< map< string, string > > > deviceLoopTokens;
vector< map< string, string > > devices;
changed = SetDevices(initial, &intTokens, &devices);
changed = SetDevices(initial, light, &intTokens, &devices);
if (!changed)
return false;