Initial Import
[profile/ivi/connman-qt.git] / test / main.qml
1 import Qt 4.7
2 import MeeGo.Connman 0.1
3
4 Item {
5         //anchors.fill: parent
6         width: 800
7         height: 480
8
9         NetworkListModel {
10                 id: networkListModel
11         }
12     ClockModel {
13         id: clockModel
14     }
15
16         Column {
17
18         Text { text: "Timezone: " + clockModel.timezone }
19         Row {
20             TextInput {
21                 id: timezoneEntry
22                 width: 200
23                 height: 40
24                 text: clockModel.timezone
25             }
26             Rectangle {
27                 id: setButton
28                 width: 40
29                 height: 40
30                 color: "grey"
31                 Text { anchors.centerIn: parent; text: "Set" }
32                 MouseArea {
33                     anchors.fill: parent
34                     onClicked: {
35                         clockModel.timezone = timezoneEntry.text
36                     }
37                 }
38             }
39         }
40         Rectangle {
41             id: updatesButton
42             property string mode: clockModel.timezoneUpdates
43             width: 180
44             height: 50
45             color: mode == "auto" ? "blue" : "red"
46             Text {
47                 anchors.centerIn: parent
48                 text: "TimezoneUpdates: " + updatesButton.mode
49             }
50             MouseArea {
51                 anchors.fill: parent
52                 onClicked: {
53                     if (updatesButton.mode == "auto")
54                         clockModel.timezoneUpdates = "manual";
55                     else
56                         clockModel.timezoneUpdates = "auto";
57                 }
58             }
59         }
60                 Rectangle {
61                         id: button
62                         property bool airplane: networkListModel.offlineMode
63                         width: 100
64                         height: 50
65                         color: button.airplane ? "blue":"red"
66
67                         Text {
68                                 anchors.centerIn: parent
69                                 text: "offline: " + button.airplane
70                         }
71
72                         MouseArea {
73                                 anchors.fill: parent
74                                 onClicked: {
75                                         networkListModel.offlineMode = !button.airplane
76                                 }
77                         }
78                 }
79
80                 Row {
81                         height: 50
82                         spacing: 10
83                         Text { text: "available technologies" }
84                         Repeater {
85                                 model: networkListModel.availableTechnologies
86                                 delegate: Text {
87                                         text: modelData
88                                         height: 50
89                                 }
90                         }
91                 }
92
93                 Row {
94                         height: 50
95                         spacing: 10
96                         Text { text: "enabled technologies" }
97                         Repeater {
98                                 model: networkListModel.enabledTechnologies
99                                 delegate: Text {
100                                         text: modelData
101                                         height: 50
102                                 }
103                         }
104                 }
105
106                 Row {
107                         height: 50
108                         spacing: 10
109                         Text { text: "connected technologies" }
110                         Repeater {
111                                 model: networkListModel.connectedTechnologies
112                                 delegate: Text {
113                                         text: modelData
114                                         height: 50
115                                 }
116                         }
117                 }
118
119                 ListView {
120                         height: 600
121                         width: parent.width
122                         model: networkListModel
123                         delegate: Text {
124                                 text: name + " " + type
125                         }
126                 }
127         }
128 }