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

@@ -409,11 +409,15 @@ void cDisplayChannelView::DrawDevices(bool initial) {
if (!ExecuteViewElement(veDevices)) {
return;
}
string mode = tmplView->GetViewElementMode(veDevices);
bool light = false;
if (!mode.compare("light")) {
light = true;
}
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();
} else {
@@ -426,7 +430,7 @@ void cDisplayChannelView::DrawDevices(bool initial) {
map < string, vector< map< string, string > > > deviceLoopTokens;
vector< map< string, string > > devices;
bool changed = SetDevices(initial, &intTokens, &devices);
bool changed = SetDevices(initial, light, &intTokens, &devices);
if (!changed)
return;