Use the real devices from telldus-core instead of hardcoded values

This commit is contained in:
Micke Prag 2011-01-14 12:56:52 +00:00
parent 042508033e
commit 2b2cb019fa
2 changed files with 67 additions and 68 deletions

View file

@ -8,11 +8,10 @@ __postInit__ = function() {
com.telldus.schedulersimplegui = function() {
function init() {
print("START");
var v = new com.telldus.qml.view({});
v.setProperty('deviceModel', com.telldus.core.deviceList.getList());
v.load("main.qml");
//var v = new com.telldus.qml.view("");
application.addWidget("scheduler.simple", ":/images/devices.png", v);
application.addWidget("scheduler.simple", "icon.png", v);
}

View file

@ -34,11 +34,11 @@ import Qt 4.7
}
Column {
id: testColumn
width: parent.width
id: testColumn
width: parent.width
height: parent.height
//anchors.bottom: page.bottom; anchors.bottomMargin: 4
//rows: 6; columns: 1; spacing: 3
//anchors.bottom: page.bottom; anchors.bottomMargin: 4
//rows: 6; columns: 1; spacing: 3
Repeater{
model: 3
@ -58,15 +58,15 @@ import Qt 4.7
}
}
Rectangle { color: "green"; width: parent.width; height:50; id: row2 }
Rectangle { color: "blue"; }
Rectangle { color: "yellow"; }
Rectangle { color: "steelblue"; }
Rectangle { color: "black"; }
}
*/
Rectangle { color: "green"; width: parent.width; height:50; id: row2 }
Rectangle { color: "blue"; }
Rectangle { color: "yellow"; }
Rectangle { color: "steelblue"; }
Rectangle { color: "black"; }
}
*/
Component{
Component{
id: listRow
Row{
id: row1
@ -79,7 +79,7 @@ import Qt 4.7
anchors.horizontalCenter: parent.horizontalCenter
//text: "Device " + (index + 1) + "Name: " + name
text: devicename + height
text: modelData.name + height
}
}
Rectangle { id: "deviceRow"; border.color: "blue"; width: parent.width-100; height:parent.height;
@ -125,7 +125,7 @@ import Qt 4.7
}
}
ListModel {
ListModel {
id: myModel
ListElement {
devicename: "Storsalen"
@ -141,16 +141,16 @@ import Qt 4.7
ListView {
id: myListView
anchors.fill: parent
model: myModel
model: deviceModel
delegate: listRow
//snapMode: ListView.SnapToItem
//highlight: Rectangle { color: "lightsteelblue"; radius: 5 }
focus: true
footer: addButtonComponent
header: timeline
}
}
Component{
Component{
id: timeline
Item{
width: parent.width
@ -181,7 +181,7 @@ import Qt 4.7
}
}
Component{
Component{
id: addButtonComponent
//anchors { left: myListView.left; top: myListView.top; margins: 20 }
Row {
@ -260,10 +260,10 @@ import Qt 4.7
//fuzziness
/*
* Dialog {
id: dialog
anchors.centerIn: parent
z: 100
}
*/
id: dialog
anchors.centerIn: parent
z: 100
}
*/
}