Sensor view now starts up in view mode if no sensors are set to be visible. Closes #168
This commit is contained in:
parent
430871bebf
commit
e69f7abba8
2 changed files with 9 additions and 1 deletions
|
@ -36,6 +36,14 @@ com.telldus.sensors = function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
view.setProperty('sensorModel', sensorList);
|
view.setProperty('sensorModel', sensorList);
|
||||||
|
var initialViewMode = 'EDIT';
|
||||||
|
for (var i=0; i < sensorList.length; ++i) {
|
||||||
|
if (sensorList.get(i).showInList || sensorList.get(i).name !== "") {
|
||||||
|
initialViewMode = 'VIEW';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
view.setProperty('initialViewMode', initialViewMode);
|
||||||
saveSensorModel();
|
saveSensorModel();
|
||||||
view.load("main.qml");
|
view.load("main.qml");
|
||||||
application.addWidget("sensors.gui", "icon.png", view);
|
application.addWidget("sensors.gui", "icon.png", view);
|
||||||
|
|
|
@ -3,7 +3,7 @@ import QtDesktop 0.1
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: main
|
id: main
|
||||||
state: "VIEW"
|
state: initialViewMode
|
||||||
|
|
||||||
ScrollArea {
|
ScrollArea {
|
||||||
id: scrollArea
|
id: scrollArea
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue