Merge lp:~martin-borho/ubuntu-weather-app/edit-locations-in-sheets into lp:ubuntu-weather-app/obsolete.trunk
- edit-locations-in-sheets
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | David Planella |
Approved revision: | 72 |
Merged at revision: | 71 |
Proposed branch: | lp:~martin-borho/ubuntu-weather-app/edit-locations-in-sheets |
Merge into: | lp:ubuntu-weather-app/obsolete.trunk |
Diff against target: |
1291 lines (+528/-442) 13 files modified
components/AddLocationPage.qml (+0/-114) components/AddLocationSheet.qml (+134/-0) components/CurrentWeather.qml (+6/-1) components/DateComponent.qml (+3/-2) components/DayWeatherComponent.qml (+4/-1) components/LocationManagerPage.qml (+0/-182) components/LocationManagerSheet.qml (+228/-0) components/LocationTab.qml (+48/-56) components/SettingsSheet.qml (+2/-2) tests/autopilot/ubuntu_weather_app/tests/__init__.py (+9/-0) tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py (+61/-22) tests/autopilot/ubuntu_weather_app/tests/test_settings.py (+5/-13) ubuntu-weather-app.qml (+28/-49) |
To merge this branch: | bzr merge lp:~martin-borho/ubuntu-weather-app/edit-locations-in-sheets |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Planella | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+175815@code.launchpad.net |
Commit message
LocationManager now implemented with Sheet components, PageStack removed, Suru gradient background added.
Description of the change
* LocationManager is now implemented with Sheet components, like discussed in Bug #1187314
* Flat navigation is used everywhere now, which means the tab header will slide away when a tab gets scrolled down (default behaviour). Solves Bug #1201094
* PageStack removed, since not needed anymore.
* Autopilot tests updated accordingly
* one ActivityIndicator removed
* Suru gradient background added
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 71. By Martin Borho
-
autopilot settings tests now also uses SheetMixin
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:71
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 72. By Martin Borho
-
suru gradient background added
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:72
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
David Planella (dpm) wrote : | # |
Nice work, thanks for updating the tests as well!
Preview Diff
1 | === removed file 'components/AddLocationPage.qml' | |||
2 | --- components/AddLocationPage.qml 2013-07-16 08:25:05 +0000 | |||
3 | +++ components/AddLocationPage.qml 1970-01-01 00:00:00 +0000 | |||
4 | @@ -1,114 +0,0 @@ | |||
5 | 1 | import QtQuick 2.0 | ||
6 | 2 | import Ubuntu.Components 0.1 | ||
7 | 3 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
8 | 4 | |||
9 | 5 | Page { | ||
10 | 6 | id: addLocationPage | ||
11 | 7 | objectName: "AddLocationPage" | ||
12 | 8 | title: i18n.tr("Add city") | ||
13 | 9 | visible: false | ||
14 | 10 | tools: ToolbarItems{ | ||
15 | 11 | locked: true | ||
16 | 12 | opened: true | ||
17 | 13 | back: ToolbarButton { | ||
18 | 14 | objectName: "BackButton" | ||
19 | 15 | iconSource: Qt.resolvedUrl("../resources/images/back@18.png") | ||
20 | 16 | text: i18n.tr("Back") | ||
21 | 17 | onTriggered: { | ||
22 | 18 | if(pageStack.depth === 3) pageStack.pop() | ||
23 | 19 | } | ||
24 | 20 | } | ||
25 | 21 | } | ||
26 | 22 | |||
27 | 23 | WorkerScript { | ||
28 | 24 | id: searchWorker | ||
29 | 25 | source: "./WeatherApi.js" | ||
30 | 26 | onMessage: { | ||
31 | 27 | if(!messageObject.error) { | ||
32 | 28 | listView.visible = true | ||
33 | 29 | messageObject.result.locations.forEach(function(loc) { | ||
34 | 30 | citiesModel.append(loc); | ||
35 | 31 | noCityError.visible = false | ||
36 | 32 | }); | ||
37 | 33 | } else { | ||
38 | 34 | console.log(messageObject.error.msg+" / "+messageObject.error.request.url) | ||
39 | 35 | } | ||
40 | 36 | if (!citiesModel.count) { | ||
41 | 37 | noCityError.visible = true | ||
42 | 38 | noCityError.text = i18n.tr("No location was found for ") + locationString.text | ||
43 | 39 | } | ||
44 | 40 | } | ||
45 | 41 | } | ||
46 | 42 | |||
47 | 43 | function clear() { | ||
48 | 44 | locationString.text = ''; | ||
49 | 45 | citiesModel.clear(); | ||
50 | 46 | listView.visible = true; | ||
51 | 47 | } | ||
52 | 48 | |||
53 | 49 | Rectangle { | ||
54 | 50 | id: searchInput | ||
55 | 51 | width:parent.width | ||
56 | 52 | height:units.gu(7) | ||
57 | 53 | color: "transparent" | ||
58 | 54 | TextField { | ||
59 | 55 | id: locationString | ||
60 | 56 | objectName: "SearchField" | ||
61 | 57 | width: parent.width-units.gu(2) | ||
62 | 58 | height:units.gu(5) | ||
63 | 59 | anchors.centerIn: parent | ||
64 | 60 | placeholderText: i18n.tr("Enter a city name") | ||
65 | 61 | hasClearButton: true | ||
66 | 62 | onAccepted: { | ||
67 | 63 | citiesModel.clear(); | ||
68 | 64 | searchWorker.sendMessage({ | ||
69 | 65 | action: "searchByName", | ||
70 | 66 | params: {name:locationString.text, units:"metric"} | ||
71 | 67 | }) | ||
72 | 68 | } | ||
73 | 69 | } | ||
74 | 70 | } | ||
75 | 71 | |||
76 | 72 | ListModel { | ||
77 | 73 | id: citiesModel | ||
78 | 74 | } | ||
79 | 75 | |||
80 | 76 | Rectangle { | ||
81 | 77 | id: cityList; | ||
82 | 78 | anchors.top: searchInput.bottom | ||
83 | 79 | width: parent.width | ||
84 | 80 | height: units.gu(52) | ||
85 | 81 | color: "transparent" | ||
86 | 82 | Label { | ||
87 | 83 | id: noCityError | ||
88 | 84 | objectName: "noCityError" | ||
89 | 85 | visible: false | ||
90 | 86 | anchors.centerIn: parent; | ||
91 | 87 | font.pixelSize: 18 | ||
92 | 88 | } | ||
93 | 89 | |||
94 | 90 | ListView { | ||
95 | 91 | id: listView; | ||
96 | 92 | objectName: "SearchResultList" | ||
97 | 93 | visible: false | ||
98 | 94 | clip: true; | ||
99 | 95 | anchors.fill: parent; | ||
100 | 96 | model: citiesModel; | ||
101 | 97 | delegate: ListItem.Standard { | ||
102 | 98 | text: i18n.tr(name)+((country) ? ', '+i18n.tr(country): ''); | ||
103 | 99 | progression: true; | ||
104 | 100 | onClicked: { | ||
105 | 101 | var location = citiesModel.get(index) | ||
106 | 102 | locationManager.addLocation(location) | ||
107 | 103 | pageStack.pop() | ||
108 | 104 | clear() | ||
109 | 105 | } | ||
110 | 106 | } | ||
111 | 107 | Scrollbar { | ||
112 | 108 | flickableItem: listView; | ||
113 | 109 | align: Qt.AlignTrailing; | ||
114 | 110 | } | ||
115 | 111 | } | ||
116 | 112 | } | ||
117 | 113 | |||
118 | 114 | } | ||
119 | 115 | 0 | ||
120 | === added file 'components/AddLocationSheet.qml' | |||
121 | --- components/AddLocationSheet.qml 1970-01-01 00:00:00 +0000 | |||
122 | +++ components/AddLocationSheet.qml 2013-07-20 16:54:27 +0000 | |||
123 | @@ -0,0 +1,134 @@ | |||
124 | 1 | /* | ||
125 | 2 | * Copyright (C) 2013 Canonical Ltd | ||
126 | 3 | * | ||
127 | 4 | * This program is free software: you can redistribute it and/or modify | ||
128 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
129 | 6 | * published by the Free Software Foundation. | ||
130 | 7 | * | ||
131 | 8 | * This program is distributed in the hope that it will be useful, | ||
132 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
133 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
134 | 11 | * GNU General Public License for more details. | ||
135 | 12 | * | ||
136 | 13 | * You should have received a copy of the GNU General Public License | ||
137 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
138 | 15 | * | ||
139 | 16 | * Authored by: Raúl Yeguas <neokore@gmail.com> | ||
140 | 17 | * Martin Borho <martin@borho.net> | ||
141 | 18 | */ | ||
142 | 19 | import QtQuick 2.0 | ||
143 | 20 | import Ubuntu.Components 0.1 | ||
144 | 21 | import Ubuntu.Components.Popups 0.1 | ||
145 | 22 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
146 | 23 | |||
147 | 24 | Component { | ||
148 | 25 | |||
149 | 26 | DefaultSheet { | ||
150 | 27 | id: addLocationSheet | ||
151 | 28 | objectName: "AddLocationSheet" | ||
152 | 29 | title: i18n.tr("Add city") | ||
153 | 30 | contentsHeight: parent.height | ||
154 | 31 | doneButton: false | ||
155 | 32 | |||
156 | 33 | WorkerScript { | ||
157 | 34 | id: searchWorker | ||
158 | 35 | source: "./WeatherApi.js" | ||
159 | 36 | onMessage: { | ||
160 | 37 | if(!messageObject.error) { | ||
161 | 38 | listView.visible = true | ||
162 | 39 | messageObject.result.locations.forEach(function(loc) { | ||
163 | 40 | citiesModel.append(loc); | ||
164 | 41 | noCityError.visible = false | ||
165 | 42 | }); | ||
166 | 43 | } else { | ||
167 | 44 | console.log(messageObject.error.msg+" / "+messageObject.error.request.url) | ||
168 | 45 | } | ||
169 | 46 | if (!citiesModel.count) { | ||
170 | 47 | noCityError.visible = true | ||
171 | 48 | noCityError.text = i18n.tr("No location was found for ") + locationString.text | ||
172 | 49 | } | ||
173 | 50 | } | ||
174 | 51 | } | ||
175 | 52 | |||
176 | 53 | Component.onCompleted: { | ||
177 | 54 | |||
178 | 55 | } | ||
179 | 56 | |||
180 | 57 | function clear() { | ||
181 | 58 | locationString.text = ''; | ||
182 | 59 | citiesModel.clear(); | ||
183 | 60 | listView.visible = true; | ||
184 | 61 | } | ||
185 | 62 | |||
186 | 63 | ListModel { | ||
187 | 64 | id: citiesModel | ||
188 | 65 | } | ||
189 | 66 | |||
190 | 67 | container: Item { | ||
191 | 68 | width: parent.width | ||
192 | 69 | Rectangle { | ||
193 | 70 | id: searchInput | ||
194 | 71 | width:parent.width | ||
195 | 72 | height:units.gu(7) | ||
196 | 73 | color: "transparent" | ||
197 | 74 | TextField { | ||
198 | 75 | id: locationString | ||
199 | 76 | objectName: "SearchField" | ||
200 | 77 | width: parent.width-units.gu(2) | ||
201 | 78 | height:units.gu(5) | ||
202 | 79 | anchors.centerIn: parent | ||
203 | 80 | placeholderText: i18n.tr("Enter a city name") | ||
204 | 81 | hasClearButton: true | ||
205 | 82 | onAccepted: { | ||
206 | 83 | citiesModel.clear(); | ||
207 | 84 | searchWorker.sendMessage({ | ||
208 | 85 | action: "searchByName", | ||
209 | 86 | params: {name:locationString.text, units:"metric"} | ||
210 | 87 | }) | ||
211 | 88 | } | ||
212 | 89 | } | ||
213 | 90 | } | ||
214 | 91 | |||
215 | 92 | Rectangle { | ||
216 | 93 | id: cityList; | ||
217 | 94 | anchors.top: searchInput.bottom | ||
218 | 95 | width: parent.width | ||
219 | 96 | height: units.gu(52) | ||
220 | 97 | color: "transparent" | ||
221 | 98 | Label { | ||
222 | 99 | id: noCityError | ||
223 | 100 | objectName: "noCityError" | ||
224 | 101 | visible: false | ||
225 | 102 | anchors.centerIn: parent; | ||
226 | 103 | font.pixelSize: 18 | ||
227 | 104 | } | ||
228 | 105 | |||
229 | 106 | ListView { | ||
230 | 107 | id: listView; | ||
231 | 108 | objectName: "SearchResultList" | ||
232 | 109 | visible: false | ||
233 | 110 | clip: true; | ||
234 | 111 | anchors.fill: parent; | ||
235 | 112 | model: citiesModel; | ||
236 | 113 | delegate: ListItem.Standard { | ||
237 | 114 | text: i18n.tr(name)+((country) ? ', '+i18n.tr(country): ''); | ||
238 | 115 | progression: true; | ||
239 | 116 | onClicked: { | ||
240 | 117 | var location = citiesModel.get(index) | ||
241 | 118 | //locationManager.addLocation(location) | ||
242 | 119 | //mainView.newLocationAdded(location) | ||
243 | 120 | locationManagerSheet.addLocation(location) | ||
244 | 121 | PopupUtils.close(addLocationSheet) | ||
245 | 122 | //pageStack.pop() | ||
246 | 123 | clear() | ||
247 | 124 | } | ||
248 | 125 | } | ||
249 | 126 | Scrollbar { | ||
250 | 127 | flickableItem: listView; | ||
251 | 128 | align: Qt.AlignTrailing; | ||
252 | 129 | } | ||
253 | 130 | } | ||
254 | 131 | } | ||
255 | 132 | } | ||
256 | 133 | } | ||
257 | 134 | } | ||
258 | 0 | 135 | ||
259 | === modified file 'components/CurrentWeather.qml' | |||
260 | --- components/CurrentWeather.qml 2013-06-26 10:43:49 +0000 | |||
261 | +++ components/CurrentWeather.qml 2013-07-20 16:54:27 +0000 | |||
262 | @@ -4,6 +4,7 @@ | |||
263 | 4 | 4 | ||
264 | 5 | Rectangle { | 5 | Rectangle { |
265 | 6 | id: currentWeather | 6 | id: currentWeather |
266 | 7 | color: "transparent" | ||
267 | 7 | 8 | ||
268 | 8 | // For Status I take the same condition codes from OpenWeatherMap (http://openweathermap.org/wiki/API/Weather_Condition_Codes) | 9 | // For Status I take the same condition codes from OpenWeatherMap (http://openweathermap.org/wiki/API/Weather_Condition_Codes) |
269 | 9 | property int condition | 10 | property int condition |
270 | @@ -44,7 +45,7 @@ | |||
271 | 44 | anchors.horizontalCenter: parent.horizontalCenter | 45 | anchors.horizontalCenter: parent.horizontalCenter |
272 | 45 | anchors.top: currentCondition.bottom | 46 | anchors.top: currentCondition.bottom |
273 | 46 | anchors.topMargin: 0 | 47 | anchors.topMargin: 0 |
275 | 47 | color: "#00000000" | 48 | color: "transparent" |
276 | 48 | 49 | ||
277 | 49 | Column { | 50 | Column { |
278 | 50 | id: column1 | 51 | id: column1 |
279 | @@ -67,6 +68,7 @@ | |||
280 | 67 | anchors.horizontalCenter: parent.horizontalCenter | 68 | anchors.horizontalCenter: parent.horizontalCenter |
281 | 68 | font.pixelSize: FontUtils.sizeToPixels("medium") | 69 | font.pixelSize: FontUtils.sizeToPixels("medium") |
282 | 69 | horizontalAlignment: Text.AlignHCenter | 70 | horizontalAlignment: Text.AlignHCenter |
283 | 71 | color: Theme.palette.normal.baseText | ||
284 | 70 | } | 72 | } |
285 | 71 | } | 73 | } |
286 | 72 | 74 | ||
287 | @@ -84,6 +86,7 @@ | |||
288 | 84 | anchors.verticalCenter: parent.verticalCenter | 86 | anchors.verticalCenter: parent.verticalCenter |
289 | 85 | font.pointSize: 52 | 87 | font.pointSize: 52 |
290 | 86 | horizontalAlignment: Text.AlignHCenter | 88 | horizontalAlignment: Text.AlignHCenter |
291 | 89 | color: Theme.palette.normal.baseText | ||
292 | 87 | } | 90 | } |
293 | 88 | 91 | ||
294 | 89 | Column { | 92 | Column { |
295 | @@ -99,6 +102,7 @@ | |||
296 | 99 | horizontalAlignment: Text.AlignHCenter | 102 | horizontalAlignment: Text.AlignHCenter |
297 | 100 | anchors.horizontalCenter: parent.horizontalCenter | 103 | anchors.horizontalCenter: parent.horizontalCenter |
298 | 101 | font.pixelSize: FontUtils.sizeToPixels("x-small") | 104 | font.pixelSize: FontUtils.sizeToPixels("x-small") |
299 | 105 | color: Theme.palette.normal.baseText | ||
300 | 102 | } | 106 | } |
301 | 103 | 107 | ||
302 | 104 | Label { | 108 | Label { |
303 | @@ -107,6 +111,7 @@ | |||
304 | 107 | horizontalAlignment: Text.AlignHCenter | 111 | horizontalAlignment: Text.AlignHCenter |
305 | 108 | anchors.horizontalCenter: parent.horizontalCenter | 112 | anchors.horizontalCenter: parent.horizontalCenter |
306 | 109 | font.pixelSize: FontUtils.sizeToPixels("medium") | 113 | font.pixelSize: FontUtils.sizeToPixels("medium") |
307 | 114 | color: Theme.palette.normal.baseText | ||
308 | 110 | } | 115 | } |
309 | 111 | } | 116 | } |
310 | 112 | } | 117 | } |
311 | 113 | 118 | ||
312 | === modified file 'components/DateComponent.qml' | |||
313 | --- components/DateComponent.qml 2013-06-26 11:12:34 +0000 | |||
314 | +++ components/DateComponent.qml 2013-07-20 16:54:27 +0000 | |||
315 | @@ -4,11 +4,11 @@ | |||
316 | 4 | Rectangle { | 4 | Rectangle { |
317 | 5 | width: parent.width | 5 | width: parent.width |
318 | 6 | height: childrenRect.height | 6 | height: childrenRect.height |
320 | 7 | 7 | color: "transparent" | |
321 | 8 | property bool borderTopVisible: true | 8 | property bool borderTopVisible: true |
322 | 9 | property string dateRelative: "" | 9 | property string dateRelative: "" |
323 | 10 | property string dateString: "" | 10 | property string dateString: "" |
325 | 11 | property string borderColor: "#D6D6D6" | 11 | property string borderColor: "transparent" |
326 | 12 | property int borderHeight: units.gu(0.1) | 12 | property int borderHeight: units.gu(0.1) |
327 | 13 | 13 | ||
328 | 14 | Component.onCompleted: { | 14 | Component.onCompleted: { |
329 | @@ -44,6 +44,7 @@ | |||
330 | 44 | objectName: "DayDateLabel" | 44 | objectName: "DayDateLabel" |
331 | 45 | height: parent.height | 45 | height: parent.height |
332 | 46 | verticalAlignment: Text.AlignVCenter | 46 | verticalAlignment: Text.AlignVCenter |
333 | 47 | color: Theme.palette.normal.baseText | ||
334 | 47 | } | 48 | } |
335 | 48 | } | 49 | } |
336 | 49 | 50 | ||
337 | 50 | 51 | ||
338 | === modified file 'components/DayWeatherComponent.qml' | |||
339 | --- components/DayWeatherComponent.qml 2013-06-26 23:50:16 +0000 | |||
340 | +++ components/DayWeatherComponent.qml 2013-07-20 16:54:27 +0000 | |||
341 | @@ -8,13 +8,14 @@ | |||
342 | 8 | width: parent.width-units.gu(2) | 8 | width: parent.width-units.gu(2) |
343 | 9 | anchors.horizontalCenter: parent.horizontalCenter | 9 | anchors.horizontalCenter: parent.horizontalCenter |
344 | 10 | height:contentShape.height+units.gu(2) | 10 | height:contentShape.height+units.gu(2) |
345 | 11 | color: "transparent" | ||
346 | 11 | 12 | ||
347 | 12 | property int condition | 13 | property int condition |
348 | 13 | property string icon | 14 | property string icon |
349 | 14 | property int temperature | 15 | property int temperature |
350 | 15 | property int temperatureMin | 16 | property int temperatureMin |
351 | 16 | property string scale: (mainView.settings["units"] === "imperial") ? "F" : "C" | 17 | property string scale: (mainView.settings["units"] === "imperial") ? "F" : "C" |
353 | 17 | property string shapeColor: "#D6D6D6" | 18 | property string shapeColor: "transparent" |
354 | 18 | 19 | ||
355 | 19 | UbuntuShape{ | 20 | UbuntuShape{ |
356 | 20 | id: contentShape | 21 | id: contentShape |
357 | @@ -38,6 +39,7 @@ | |||
358 | 38 | width:parent.width/9*3 | 39 | width:parent.width/9*3 |
359 | 39 | height:parent.height | 40 | height:parent.height |
360 | 40 | text: dayWeatherComponent.temperature+"°"+dayWeatherComponent.scale | 41 | text: dayWeatherComponent.temperature+"°"+dayWeatherComponent.scale |
361 | 42 | color: Theme.palette.normal.baseText | ||
362 | 41 | } | 43 | } |
363 | 42 | Label { | 44 | Label { |
364 | 43 | id: minTemp | 45 | id: minTemp |
365 | @@ -46,6 +48,7 @@ | |||
366 | 46 | width:parent.width/9*3 | 48 | width:parent.width/9*3 |
367 | 47 | height: parent.height | 49 | height: parent.height |
368 | 48 | text: i18n.tr("Min.")+"\n"+dayWeatherComponent.temperatureMin+"°"+dayWeatherComponent.scale | 50 | text: i18n.tr("Min.")+"\n"+dayWeatherComponent.temperatureMin+"°"+dayWeatherComponent.scale |
369 | 51 | color: Theme.palette.normal.baseText | ||
370 | 49 | } | 52 | } |
371 | 50 | } | 53 | } |
372 | 51 | } | 54 | } |
373 | 52 | 55 | ||
374 | === removed file 'components/LocationManagerPage.qml' | |||
375 | --- components/LocationManagerPage.qml 2013-07-16 09:39:11 +0000 | |||
376 | +++ components/LocationManagerPage.qml 1970-01-01 00:00:00 +0000 | |||
377 | @@ -1,182 +0,0 @@ | |||
378 | 1 | import QtQuick 2.0 | ||
379 | 2 | import Ubuntu.Components 0.1 | ||
380 | 3 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
381 | 4 | import Ubuntu.Components.Popups 0.1 | ||
382 | 5 | |||
383 | 6 | Page { | ||
384 | 7 | id: locationManagerPage | ||
385 | 8 | objectName: "LocationManagerPage" | ||
386 | 9 | title: i18n.tr("Edit locations") | ||
387 | 10 | visible: false | ||
388 | 11 | |||
389 | 12 | property bool locationsChanged: false | ||
390 | 13 | |||
391 | 14 | tools: ToolbarItems { | ||
392 | 15 | locked: true | ||
393 | 16 | opened: (locationModel.count > 0) ? true : false | ||
394 | 17 | back: ToolbarButton { | ||
395 | 18 | objectName: "BackButton" | ||
396 | 19 | text: i18n.tr("Back") | ||
397 | 20 | iconSource: Qt.resolvedUrl("../resources/images/back@18.png") | ||
398 | 21 | onTriggered: { | ||
399 | 22 | if(locationsChanged) { | ||
400 | 23 | mainView.refreshData() | ||
401 | 24 | locationsChanged = false; | ||
402 | 25 | } | ||
403 | 26 | // handle dummy "current location" item | ||
404 | 27 | currentLocationItem.visible = false | ||
405 | 28 | locationLookupItem.visible = true | ||
406 | 29 | lookupItemAddButton.visible = true | ||
407 | 30 | |||
408 | 31 | if(pageStack.depth === 2) pageStack.pop() | ||
409 | 32 | } | ||
410 | 33 | } | ||
411 | 34 | } | ||
412 | 35 | |||
413 | 36 | function loadData() { | ||
414 | 37 | storage.getLocations(fillLocationsList); | ||
415 | 38 | } | ||
416 | 39 | |||
417 | 40 | function checkLocationExists(location) { | ||
418 | 41 | for(var x=0;x<locationModel.count;x++) { | ||
419 | 42 | var loc = locationModel.get(x); | ||
420 | 43 | if(loc.service === location.service | ||
421 | 44 | && loc.service_id === location.service_id) { | ||
422 | 45 | existsNotification.show() | ||
423 | 46 | return true; | ||
424 | 47 | } | ||
425 | 48 | } | ||
426 | 49 | return false; | ||
427 | 50 | } | ||
428 | 51 | |||
429 | 52 | function fillLocationsList(locations) { | ||
430 | 53 | locationModel.clear() | ||
431 | 54 | for(var x=0;x<locations.length;x++) { | ||
432 | 55 | var dbId = locations[x].db.id, | ||
433 | 56 | location = locations[x].location; | ||
434 | 57 | // add db-id to the location object | ||
435 | 58 | location.dbId = dbId; | ||
436 | 59 | locationModel.append(locations[x].location); | ||
437 | 60 | } | ||
438 | 61 | } | ||
439 | 62 | |||
440 | 63 | function addLocation(location) { | ||
441 | 64 | if(!checkLocationExists(location)) { | ||
442 | 65 | storage.insertLocation({location:location}); | ||
443 | 66 | loadData() | ||
444 | 67 | locationsChanged = true; | ||
445 | 68 | } | ||
446 | 69 | } | ||
447 | 70 | |||
448 | 71 | |||
449 | 72 | Dialog { | ||
450 | 73 | id:existsNotification | ||
451 | 74 | title: i18n.tr("Location already added.") | ||
452 | 75 | Button { | ||
453 | 76 | text: i18n.tr("OK") | ||
454 | 77 | onClicked: PopupUtils.close(existsNotification) | ||
455 | 78 | } | ||
456 | 79 | } | ||
457 | 80 | |||
458 | 81 | ListModel { | ||
459 | 82 | id: locationModel | ||
460 | 83 | } | ||
461 | 84 | |||
462 | 85 | Column { | ||
463 | 86 | anchors.fill: parent | ||
464 | 87 | Rectangle { | ||
465 | 88 | color: "#D6D6D6" | ||
466 | 89 | width:parent.width | ||
467 | 90 | height: units.gu(0.3) | ||
468 | 91 | } | ||
469 | 92 | Rectangle { | ||
470 | 93 | width: parent.width | ||
471 | 94 | height: units.gu(5) | ||
472 | 95 | Label { | ||
473 | 96 | anchors.verticalCenter: parent.verticalCenter | ||
474 | 97 | text: " "+i18n.tr("Current location") | ||
475 | 98 | fontSize: "large" | ||
476 | 99 | } | ||
477 | 100 | } | ||
478 | 101 | Rectangle { | ||
479 | 102 | color: "#D6D6D6" | ||
480 | 103 | width:parent.width | ||
481 | 104 | height: units.gu(0.3) | ||
482 | 105 | } | ||
483 | 106 | ListItem.Standard { | ||
484 | 107 | id: locationLookupItem | ||
485 | 108 | text: i18n.tr("Lookup location")+" (Dummy)" | ||
486 | 109 | progression: true | ||
487 | 110 | onClicked: { | ||
488 | 111 | print("TODO: lookup current location") | ||
489 | 112 | visible = false | ||
490 | 113 | currentLocationItem.visible = true; | ||
491 | 114 | } | ||
492 | 115 | } | ||
493 | 116 | ListItem.Standard { | ||
494 | 117 | id: currentLocationItem | ||
495 | 118 | visible: false | ||
496 | 119 | text: i18n.tr("London") | ||
497 | 120 | //icon: Qt.resolvedUrl("../resources/images/refresh_icon.png") | ||
498 | 121 | control: Button { | ||
499 | 122 | id: lookupItemAddButton | ||
500 | 123 | anchors.verticalCenter: parent.verticalCenter | ||
501 | 124 | text: i18n.tr("add") | ||
502 | 125 | MouseArea { | ||
503 | 126 | anchors.fill: parent | ||
504 | 127 | onClicked: { | ||
505 | 128 | // add dummy location | ||
506 | 129 | addLocation({"service_id":2643743,"name":"London","country":"GB","service":"openweathermap"}) | ||
507 | 130 | lookupItemAddButton.visible = false; | ||
508 | 131 | } | ||
509 | 132 | } | ||
510 | 133 | } | ||
511 | 134 | } | ||
512 | 135 | Rectangle { | ||
513 | 136 | id:test2 | ||
514 | 137 | width: parent.width | ||
515 | 138 | height: units.gu(5) | ||
516 | 139 | Label { | ||
517 | 140 | anchors.verticalCenter: parent.verticalCenter | ||
518 | 141 | text: " "+i18n.tr("World") | ||
519 | 142 | fontSize: "large" | ||
520 | 143 | } | ||
521 | 144 | } | ||
522 | 145 | Rectangle { | ||
523 | 146 | color: "#D6D6D6" | ||
524 | 147 | width:parent.width | ||
525 | 148 | height: units.gu(0.3) | ||
526 | 149 | } | ||
527 | 150 | Rectangle { | ||
528 | 151 | width: parent.width | ||
529 | 152 | clip:true | ||
530 | 153 | color:"transparent" | ||
531 | 154 | height: units.gu(40) | ||
532 | 155 | ListView { | ||
533 | 156 | objectName: "LocationList" | ||
534 | 157 | anchors.fill: parent | ||
535 | 158 | model: locationModel | ||
536 | 159 | delegate: ListItem.Standard { | ||
537 | 160 | text: model.name | ||
538 | 161 | removable: true | ||
539 | 162 | onItemRemoved: { | ||
540 | 163 | var location = locationModel.get(index) | ||
541 | 164 | locationsChanged = true; | ||
542 | 165 | storage.clearLocation(location.dbId); | ||
543 | 166 | locationModel.remove(index) | ||
544 | 167 | } | ||
545 | 168 | backgroundIndicator: SwipeDelete { | ||
546 | 169 | id: swipeDelete | ||
547 | 170 | state: swipingState | ||
548 | 171 | } | ||
549 | 172 | } | ||
550 | 173 | footer: ListItem.Standard { | ||
551 | 174 | objectName: "AddCityListItem" | ||
552 | 175 | text: i18n.tr("Add city") | ||
553 | 176 | progression: true | ||
554 | 177 | onClicked: pageStack.push(addLocationPage) | ||
555 | 178 | } | ||
556 | 179 | } | ||
557 | 180 | } | ||
558 | 181 | } | ||
559 | 182 | } | ||
560 | 183 | 0 | ||
561 | === added file 'components/LocationManagerSheet.qml' | |||
562 | --- components/LocationManagerSheet.qml 1970-01-01 00:00:00 +0000 | |||
563 | +++ components/LocationManagerSheet.qml 2013-07-20 16:54:27 +0000 | |||
564 | @@ -0,0 +1,228 @@ | |||
565 | 1 | /* | ||
566 | 2 | * Copyright (C) 2013 Canonical Ltd | ||
567 | 3 | * | ||
568 | 4 | * This program is free software: you can redistribute it and/or modify | ||
569 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
570 | 6 | * published by the Free Software Foundation. | ||
571 | 7 | * | ||
572 | 8 | * This program is distributed in the hope that it will be useful, | ||
573 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
574 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
575 | 11 | * GNU General Public License for more details. | ||
576 | 12 | * | ||
577 | 13 | * You should have received a copy of the GNU General Public License | ||
578 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
579 | 15 | * | ||
580 | 16 | * Authored by: Martin Borho <martin@borho.net> | ||
581 | 17 | Raúl Yeguas <neokore@gmail.com> | ||
582 | 18 | Riccardo Padovani <ricki.padovani@gmail.com> | ||
583 | 19 | */ | ||
584 | 20 | import QtQuick 2.0 | ||
585 | 21 | import Ubuntu.Components 0.1 | ||
586 | 22 | import Ubuntu.Components.Popups 0.1 | ||
587 | 23 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
588 | 24 | |||
589 | 25 | Component { | ||
590 | 26 | id: locationManagerComponent | ||
591 | 27 | |||
592 | 28 | ComposerSheet { | ||
593 | 29 | id: locationManagerSheet | ||
594 | 30 | objectName: "LocationManagerSheet" | ||
595 | 31 | title: i18n.tr("Edit locations") | ||
596 | 32 | contentsHeight: parent.height | ||
597 | 33 | |||
598 | 34 | property int initial_sum: 0 | ||
599 | 35 | |||
600 | 36 | Component.onCompleted: { | ||
601 | 37 | locationsRemoved.clear() | ||
602 | 38 | loadData() | ||
603 | 39 | } | ||
604 | 40 | |||
605 | 41 | function loadData() { | ||
606 | 42 | storage.getLocations(fillLocationsList); | ||
607 | 43 | } | ||
608 | 44 | |||
609 | 45 | function checkLocationExists(location) { | ||
610 | 46 | for(var x=0;x<locationModel.count;x++) { | ||
611 | 47 | var loc = locationModel.get(x); | ||
612 | 48 | if(loc.service === location.service | ||
613 | 49 | && loc.service_id === location.service_id) { | ||
614 | 50 | existsNotification.show() | ||
615 | 51 | return true; | ||
616 | 52 | } | ||
617 | 53 | } | ||
618 | 54 | return false; | ||
619 | 55 | } | ||
620 | 56 | |||
621 | 57 | function fillLocationsList(locations) { | ||
622 | 58 | initial_sum = locations.length; | ||
623 | 59 | locationModel.clear() | ||
624 | 60 | for(var x=0;x<locations.length;x++) { | ||
625 | 61 | var dbId = locations[x].db.id, | ||
626 | 62 | location = locations[x].location; | ||
627 | 63 | // add db-id to the location object | ||
628 | 64 | location.dbId = dbId; | ||
629 | 65 | locationModel.append(locations[x].location); | ||
630 | 66 | } | ||
631 | 67 | } | ||
632 | 68 | |||
633 | 69 | function addLocation(location) { | ||
634 | 70 | if(!checkLocationExists(location)) { | ||
635 | 71 | locationModel.append(location) | ||
636 | 72 | } | ||
637 | 73 | } | ||
638 | 74 | |||
639 | 75 | container: Column { | ||
640 | 76 | anchors.fill: parent | ||
641 | 77 | Rectangle { | ||
642 | 78 | width: parent.width | ||
643 | 79 | height: units.gu(5) | ||
644 | 80 | color: "transparent" | ||
645 | 81 | Label { | ||
646 | 82 | anchors.verticalCenter: parent.verticalCenter | ||
647 | 83 | text: " "+i18n.tr("Current location") | ||
648 | 84 | fontSize: "large" | ||
649 | 85 | } | ||
650 | 86 | } | ||
651 | 87 | Rectangle { | ||
652 | 88 | color: "#A9A9A9" | ||
653 | 89 | width:parent.width | ||
654 | 90 | height: units.gu(0.1) | ||
655 | 91 | } | ||
656 | 92 | ListItem.Standard { | ||
657 | 93 | id: locationLookupItem | ||
658 | 94 | text: i18n.tr("Lookup location")+" (Dummy)" | ||
659 | 95 | progression: true | ||
660 | 96 | onClicked: { | ||
661 | 97 | print("TODO: lookup current location") | ||
662 | 98 | visible = false | ||
663 | 99 | currentLocationItem.visible = true; | ||
664 | 100 | } | ||
665 | 101 | } | ||
666 | 102 | ListItem.Standard { | ||
667 | 103 | id: currentLocationItem | ||
668 | 104 | visible: false | ||
669 | 105 | text: i18n.tr("London") | ||
670 | 106 | control: Button { | ||
671 | 107 | id: lookupItemAddButton | ||
672 | 108 | anchors.verticalCenter: parent.verticalCenter | ||
673 | 109 | text: i18n.tr("add") | ||
674 | 110 | MouseArea { | ||
675 | 111 | anchors.fill: parent | ||
676 | 112 | onClicked: { | ||
677 | 113 | // add dummy location | ||
678 | 114 | addLocation({"service_id":2643743,"name":"London","country":"GB","service":"openweathermap"}) | ||
679 | 115 | lookupItemAddButton.visible = false; | ||
680 | 116 | } | ||
681 | 117 | } | ||
682 | 118 | } | ||
683 | 119 | } | ||
684 | 120 | Rectangle { | ||
685 | 121 | width: parent.width | ||
686 | 122 | height: units.gu(5) | ||
687 | 123 | color: "transparent" | ||
688 | 124 | Label { | ||
689 | 125 | anchors.verticalCenter: parent.verticalCenter | ||
690 | 126 | text: " "+i18n.tr("World") | ||
691 | 127 | fontSize: "large" | ||
692 | 128 | } | ||
693 | 129 | } | ||
694 | 130 | Rectangle { | ||
695 | 131 | color: "#A9A9A9" | ||
696 | 132 | width:parent.width | ||
697 | 133 | height: units.gu(0.1) | ||
698 | 134 | } | ||
699 | 135 | Rectangle { | ||
700 | 136 | width: parent.width | ||
701 | 137 | clip:true | ||
702 | 138 | color:"transparent" | ||
703 | 139 | height: units.gu(40) | ||
704 | 140 | ListView { | ||
705 | 141 | objectName: "LocationList" | ||
706 | 142 | anchors.fill: parent | ||
707 | 143 | model: locationModel | ||
708 | 144 | delegate: ListItem.Standard { | ||
709 | 145 | text: model.name | ||
710 | 146 | removable: true | ||
711 | 147 | onItemRemoved: { | ||
712 | 148 | var location = locationModel.get(index) | ||
713 | 149 | // clone location obj | ||
714 | 150 | location = JSON.parse(JSON.stringify(location)); | ||
715 | 151 | locationsRemoved.append(location) | ||
716 | 152 | locationModel.remove(index) | ||
717 | 153 | |||
718 | 154 | } | ||
719 | 155 | backgroundIndicator: SwipeDelete { | ||
720 | 156 | id: swipeDelete | ||
721 | 157 | state: swipingState | ||
722 | 158 | } | ||
723 | 159 | } | ||
724 | 160 | footer: ListItem.Standard { | ||
725 | 161 | objectName: "AddCityListItem" | ||
726 | 162 | text: i18n.tr("Add city") | ||
727 | 163 | progression: true | ||
728 | 164 | onClicked: { | ||
729 | 165 | PopupUtils.open(addLocationSheet) | ||
730 | 166 | } | ||
731 | 167 | } | ||
732 | 168 | } | ||
733 | 169 | } | ||
734 | 170 | } | ||
735 | 171 | |||
736 | 172 | Dialog { | ||
737 | 173 | id:existsNotification | ||
738 | 174 | title: i18n.tr("Location already added.") | ||
739 | 175 | Button { | ||
740 | 176 | text: i18n.tr("OK") | ||
741 | 177 | onClicked: PopupUtils.close(existsNotification) | ||
742 | 178 | } | ||
743 | 179 | } | ||
744 | 180 | |||
745 | 181 | ListModel { | ||
746 | 182 | id: locationModel | ||
747 | 183 | } | ||
748 | 184 | |||
749 | 185 | ListModel { | ||
750 | 186 | id: locationsRemoved | ||
751 | 187 | } | ||
752 | 188 | |||
753 | 189 | onConfirmClicked: { | ||
754 | 190 | var locationsChanged = false; | ||
755 | 191 | // remove | ||
756 | 192 | for(var x=0;x<locationsRemoved.count;x++) { | ||
757 | 193 | var delLoc = locationsRemoved.get(x); | ||
758 | 194 | storage.clearLocation(delLoc.dbId); | ||
759 | 195 | locationsChanged = true; | ||
760 | 196 | } | ||
761 | 197 | // add | ||
762 | 198 | for(var y=0;y<locationModel.count;y++) { | ||
763 | 199 | var loc = locationModel.get(y); | ||
764 | 200 | if(loc.dbId === undefined || loc.dbId=== 0) { | ||
765 | 201 | storage.insertLocation({location:loc}); | ||
766 | 202 | locationsChanged = true; | ||
767 | 203 | } | ||
768 | 204 | } | ||
769 | 205 | // refresh tabs if neccessary | ||
770 | 206 | if(locationsChanged || locationModel.count === 0) { | ||
771 | 207 | mainView.refreshData() | ||
772 | 208 | } | ||
773 | 209 | // handle dummy "current location" item | ||
774 | 210 | currentLocationItem.visible = false | ||
775 | 211 | locationLookupItem.visible = true | ||
776 | 212 | lookupItemAddButton.visible = true | ||
777 | 213 | } | ||
778 | 214 | |||
779 | 215 | onCancelClicked: { | ||
780 | 216 | if(initial_sum === 0) { | ||
781 | 217 | // refresh mainview to land again here, | ||
782 | 218 | // when no locations were defined when | ||
783 | 219 | // opening the sheet | ||
784 | 220 | mainView.refreshData() | ||
785 | 221 | } | ||
786 | 222 | } | ||
787 | 223 | |||
788 | 224 | AddLocationSheet { | ||
789 | 225 | id:addLocationSheet | ||
790 | 226 | } | ||
791 | 227 | } | ||
792 | 228 | } | ||
793 | 0 | 229 | ||
794 | === modified file 'components/LocationTab.qml' | |||
795 | --- components/LocationTab.qml 2013-07-15 18:04:37 +0000 | |||
796 | +++ components/LocationTab.qml 2013-07-20 16:54:27 +0000 | |||
797 | @@ -75,66 +75,21 @@ | |||
798 | 75 | // Menu for options | 75 | // Menu for options |
799 | 76 | page: Page { | 76 | page: Page { |
800 | 77 | id: locationPage | 77 | id: locationPage |
840 | 78 | tools: ToolbarItems { | 78 | anchors.fill: parent |
841 | 79 | id: pageTools | 79 | |
842 | 80 | ToolbarButton { | 80 | ListModel { |
843 | 81 | objectName: "RefreshButton" | 81 | id: dayForecastModel |
805 | 82 | action:Action { | ||
806 | 83 | id: refreshAction | ||
807 | 84 | objectName: "RefreshAction" | ||
808 | 85 | iconSource: Qt.resolvedUrl("../resources/images/refresh_icon.png") | ||
809 | 86 | text: i18n.tr("Refresh") | ||
810 | 87 | |||
811 | 88 | onTriggered: { | ||
812 | 89 | mainView.refreshData(false, true); | ||
813 | 90 | } | ||
814 | 91 | } | ||
815 | 92 | } | ||
816 | 93 | ToolbarButton { | ||
817 | 94 | objectName: "EditButton" | ||
818 | 95 | action:Action { | ||
819 | 96 | id: editLocationAction | ||
820 | 97 | iconSource: Qt.resolvedUrl("../resources/images/add_icon.png") | ||
821 | 98 | text: i18n.tr("Edit") | ||
822 | 99 | |||
823 | 100 | onTriggered: { | ||
824 | 101 | mainView.showLocationManager() | ||
825 | 102 | } | ||
826 | 103 | } | ||
827 | 104 | } | ||
828 | 105 | ToolbarButton { | ||
829 | 106 | objectName: "SettingsButton" | ||
830 | 107 | action:Action { | ||
831 | 108 | id: configAction | ||
832 | 109 | iconSource: Qt.resolvedUrl("../resources/images/settings.png") | ||
833 | 110 | text: i18n.tr("Settings") | ||
834 | 111 | |||
835 | 112 | onTriggered: { | ||
836 | 113 | mainView.showSettings(); | ||
837 | 114 | } | ||
838 | 115 | } | ||
839 | 116 | } | ||
844 | 117 | } | 82 | } |
845 | 118 | } | ||
846 | 119 | |||
847 | 120 | ListModel { | ||
848 | 121 | id: dayForecastModel | ||
849 | 122 | } | ||
850 | 123 | |||
851 | 124 | Rectangle { | ||
852 | 125 | id:startPage | ||
853 | 126 | width: parent.width | ||
854 | 127 | height: parent.height | ||
855 | 128 | 83 | ||
856 | 129 | Flickable { | 84 | Flickable { |
857 | 130 | id: flickable | 85 | id: flickable |
860 | 131 | width: parent.width | 86 | anchors.fill: parent |
859 | 132 | height: parent.height | ||
861 | 133 | contentHeight: flickContent.height; | 87 | contentHeight: flickContent.height; |
862 | 134 | Rectangle { | 88 | Rectangle { |
863 | 135 | id: flickContent | 89 | id: flickContent |
864 | 136 | width:parent.width | 90 | width:parent.width |
865 | 137 | height: childrenRect.height | 91 | height: childrenRect.height |
866 | 92 | color: "transparent" | ||
867 | 138 | DateComponent { | 93 | DateComponent { |
868 | 139 | id: todayDateComponent | 94 | id: todayDateComponent |
869 | 140 | //dateRelative: i18n.tr("Today") | 95 | //dateRelative: i18n.tr("Today") |
870 | @@ -144,10 +99,6 @@ | |||
871 | 144 | id: currentCondition | 99 | id: currentCondition |
872 | 145 | anchors.top: todayDateComponent.bottom | 100 | anchors.top: todayDateComponent.bottom |
873 | 146 | } | 101 | } |
874 | 147 | /*ChartComponent{ | ||
875 | 148 | id: chartComponent | ||
876 | 149 | anchors.top: currentCondition.bottom | ||
877 | 150 | }*/ | ||
878 | 151 | ListView { | 102 | ListView { |
879 | 152 | id: dailyForecastList | 103 | id: dailyForecastList |
880 | 153 | width: parent.width; | 104 | width: parent.width; |
881 | @@ -175,6 +126,47 @@ | |||
882 | 175 | } | 126 | } |
883 | 176 | } | 127 | } |
884 | 177 | } | 128 | } |
885 | 129 | |||
886 | 130 | |||
887 | 131 | tools: ToolbarItems { | ||
888 | 132 | id: pageTools | ||
889 | 133 | ToolbarButton { | ||
890 | 134 | objectName: "RefreshButton" | ||
891 | 135 | action:Action { | ||
892 | 136 | id: refreshAction | ||
893 | 137 | objectName: "RefreshAction" | ||
894 | 138 | iconSource: Qt.resolvedUrl("../resources/images/refresh_icon.png") | ||
895 | 139 | text: i18n.tr("Refresh") | ||
896 | 140 | |||
897 | 141 | onTriggered: { | ||
898 | 142 | mainView.refreshData(false, true); | ||
899 | 143 | } | ||
900 | 144 | } | ||
901 | 145 | } | ||
902 | 146 | ToolbarButton { | ||
903 | 147 | objectName: "EditButton" | ||
904 | 148 | action:Action { | ||
905 | 149 | id: editLocationAction | ||
906 | 150 | iconSource: Qt.resolvedUrl("../resources/images/add_icon.png") | ||
907 | 151 | text: i18n.tr("Edit") | ||
908 | 152 | |||
909 | 153 | onTriggered: { | ||
910 | 154 | mainView.showLocationManager() | ||
911 | 155 | } | ||
912 | 156 | } | ||
913 | 157 | } | ||
914 | 158 | ToolbarButton { | ||
915 | 159 | objectName: "SettingsButton" | ||
916 | 160 | action:Action { | ||
917 | 161 | id: configAction | ||
918 | 162 | iconSource: Qt.resolvedUrl("../resources/images/settings.png") | ||
919 | 163 | text: i18n.tr("Settings") | ||
920 | 164 | |||
921 | 165 | onTriggered: { | ||
922 | 166 | mainView.showSettings(); | ||
923 | 167 | } | ||
924 | 168 | } | ||
925 | 169 | } | ||
926 | 170 | } | ||
927 | 178 | } | 171 | } |
928 | 179 | |||
929 | 180 | } | 172 | } |
930 | 181 | 173 | ||
931 | === modified file 'components/SettingsSheet.qml' | |||
932 | --- components/SettingsSheet.qml 2013-07-11 18:50:23 +0000 | |||
933 | +++ components/SettingsSheet.qml 2013-07-20 16:54:27 +0000 | |||
934 | @@ -27,9 +27,9 @@ | |||
935 | 27 | id: sheet | 27 | id: sheet |
936 | 28 | objectName: "SettingsSheet" | 28 | objectName: "SettingsSheet" |
937 | 29 | title: i18n.tr("Settings") | 29 | title: i18n.tr("Settings") |
939 | 30 | contentsHeight: parent.height | 30 | contentsHeight: parent.height |
940 | 31 | 31 | ||
942 | 32 | container: ListItem.ValueSelector { | 32 | container: ListItem.ValueSelector { |
943 | 33 | id: unitsSelector | 33 | id: unitsSelector |
944 | 34 | objectName: "UnitsSelector" | 34 | objectName: "UnitsSelector" |
945 | 35 | text: i18n.tr("Temperature unit") | 35 | text: i18n.tr("Temperature unit") |
946 | 36 | 36 | ||
947 | === modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py' | |||
948 | --- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-07-11 20:03:29 +0000 | |||
949 | +++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-07-20 16:54:27 +0000 | |||
950 | @@ -76,6 +76,15 @@ | |||
951 | 76 | def main_window(self): | 76 | def main_window(self): |
952 | 77 | return ubuntusdk(self, self.app)#MainWindow(self, self.app) | 77 | return ubuntusdk(self, self.app)#MainWindow(self, self.app) |
953 | 78 | 78 | ||
954 | 79 | class SheetMixin(object): | ||
955 | 80 | """A mixin to to give access to common sheet elements""" | ||
956 | 81 | def _click_sheet_confirm(self): | ||
957 | 82 | """Clicks the confirm button""" | ||
958 | 83 | self.pointing_device.click_object(self.main_window.app.select_many('Button')[1]) | ||
959 | 84 | |||
960 | 85 | def _click_sheet_cancel(self): | ||
961 | 86 | """Clicks the cancel button""" | ||
962 | 87 | self.pointing_device.click_object(self.main_window.app.select_many('Button')[0]) | ||
963 | 79 | 88 | ||
964 | 80 | class DatabaseMixin(object): | 89 | class DatabaseMixin(object): |
965 | 81 | 90 | ||
966 | 82 | 91 | ||
967 | === modified file 'tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py' | |||
968 | --- tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-07-16 19:34:12 +0000 | |||
969 | +++ tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-07-20 16:54:27 +0000 | |||
970 | @@ -12,10 +12,10 @@ | |||
971 | 12 | from testtools.matchers import Equals | 12 | from testtools.matchers import Equals |
972 | 13 | from autopilot.matchers import Eventually | 13 | from autopilot.matchers import Eventually |
973 | 14 | 14 | ||
975 | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin, SheetMixin |
976 | 16 | from ubuntu_weather_app.tests.weatherdata import locations_data | 16 | from ubuntu_weather_app.tests.weatherdata import locations_data |
977 | 17 | 17 | ||
979 | 18 | class TestLocationManager(WeatherTestCase, DatabaseMixin): | 18 | class TestLocationManager(WeatherTestCase, DatabaseMixin, SheetMixin): |
980 | 19 | def setUp(self): | 19 | def setUp(self): |
981 | 20 | self.clean_db() | 20 | self.clean_db() |
982 | 21 | super(TestLocationManager, self).setUp() | 21 | super(TestLocationManager, self).setUp() |
983 | @@ -30,7 +30,7 @@ | |||
984 | 30 | self.pointing_device.move_to_object(addCityItem) | 30 | self.pointing_device.move_to_object(addCityItem) |
985 | 31 | self.pointing_device.click() | 31 | self.pointing_device.click() |
986 | 32 | 32 | ||
988 | 33 | addLocPage = self.main_window.get_object("AddLocationPage", "AddLocationPage") | 33 | addLocPage = self.main_window.get_object("DefaultSheet", "AddLocationSheet") |
989 | 34 | self.assertThat(addLocPage.visible, Eventually(Equals(True))) | 34 | self.assertThat(addLocPage.visible, Eventually(Equals(True))) |
990 | 35 | 35 | ||
991 | 36 | def test_add_location(self): | 36 | def test_add_location(self): |
992 | @@ -56,10 +56,17 @@ | |||
993 | 56 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') | 56 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') |
994 | 57 | addedItem = locationList.get_children()[0] | 57 | addedItem = locationList.get_children()[0] |
995 | 58 | self.assertThat(addedItem.get_children()[1].text, Eventually(Equals("London"))) | 58 | self.assertThat(addedItem.get_children()[1].text, Eventually(Equals("London"))) |
1000 | 59 | 59 | self._click_sheet_confirm() | |
1001 | 60 | # a location is defined, so toolbar should be visible | 60 | |
1002 | 61 | toolbar = self.main_window.get_toolbar() | 61 | # back to locations, wait till data is loaded |
1003 | 62 | self.assertThat(toolbar.opened, Eventually(Equals(True))) | 62 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') |
1004 | 63 | self.assertThat(load_indicator.running, Eventually(Equals(False))) | ||
1005 | 64 | |||
1006 | 65 | # only location is there | ||
1007 | 66 | loadingPage = self.main_window.get_object("Tabs", "rootTabs") | ||
1008 | 67 | self.assertThat(loadingPage.visible, Eventually(Equals(True))) | ||
1009 | 68 | tabObjects = self.main_window.get_objects('LocationTab','LocationTab') | ||
1010 | 69 | self.assertEqual(1, len(tabObjects)) | ||
1011 | 63 | 70 | ||
1012 | 64 | def test_toolbar_hidden_when_no_location_is_defined(self): | 71 | def test_toolbar_hidden_when_no_location_is_defined(self): |
1013 | 65 | """Toolbar is not visible when there's no location is defined""" | 72 | """Toolbar is not visible when there's no location is defined""" |
1014 | @@ -99,7 +106,7 @@ | |||
1015 | 99 | def test_cancel_adding_location(self): | 106 | def test_cancel_adding_location(self): |
1016 | 100 | """Cancel the cities search""" | 107 | """Cancel the cities search""" |
1017 | 101 | self._open_add_location_page() | 108 | self._open_add_location_page() |
1019 | 102 | self.main_window.click_toolbar_button("BackButton") | 109 | self._click_sheet_cancel() |
1020 | 103 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') | 110 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') |
1021 | 104 | self.assertThat(locationList.visible, Eventually(Equals(True))) | 111 | self.assertThat(locationList.visible, Eventually(Equals(True))) |
1022 | 105 | 112 | ||
1023 | @@ -120,12 +127,13 @@ | |||
1024 | 120 | self.assertThat(errorLabel.visible, Eventually(Equals(True), timeout=30)) | 127 | self.assertThat(errorLabel.visible, Eventually(Equals(True), timeout=30)) |
1025 | 121 | 128 | ||
1026 | 122 | 129 | ||
1028 | 123 | class TestLocationManagerWithLocation(WeatherTestCase, DatabaseMixin): | 130 | class TestLocationManagerWithLocation(WeatherTestCase, DatabaseMixin, SheetMixin): |
1029 | 124 | def setUp(self): | 131 | def setUp(self): |
1030 | 125 | self.clean_db() | 132 | self.clean_db() |
1031 | 126 | self.launch_and_quit_app() | 133 | self.launch_and_quit_app() |
1032 | 127 | # add one location to storage | 134 | # add one location to storage |
1034 | 128 | self.save_locations_to_storage([locations_data[0]]) | 135 | #self.save_locations_to_storage([locations_data[0]]) |
1035 | 136 | self.save_locations_to_storage(locations_data) | ||
1036 | 129 | super(TestLocationManagerWithLocation, self).setUp() | 137 | super(TestLocationManagerWithLocation, self).setUp() |
1037 | 130 | self.assertThat( | 138 | self.assertThat( |
1038 | 131 | self.main_window.get_qml_view().visible, Eventually(Equals(True))) | 139 | self.main_window.get_qml_view().visible, Eventually(Equals(True))) |
1039 | @@ -136,16 +144,8 @@ | |||
1040 | 136 | self.assertThat(self.main_window.get_toolbar().opened, Eventually(Equals(True))) | 144 | self.assertThat(self.main_window.get_toolbar().opened, Eventually(Equals(True))) |
1041 | 137 | self.main_window.click_toolbar_button("EditButton") | 145 | self.main_window.click_toolbar_button("EditButton") |
1042 | 138 | 146 | ||
1053 | 139 | def test_remove_location(self): | 147 | def _swipe_location_to_remove(self): |
1054 | 140 | """Removes location""" | 148 | """Swipe right to delete the first location""" |
1045 | 141 | # check loading screen diappears | ||
1046 | 142 | loadingPage = self.main_window.get_object("Page", "MainPage") | ||
1047 | 143 | self.assertThat(loadingPage.visible, Eventually(Equals(True))) | ||
1048 | 144 | |||
1049 | 145 | # go to the location manegr | ||
1050 | 146 | self._open_location_manager() | ||
1051 | 147 | |||
1052 | 148 | # swipe right to delete the first location | ||
1055 | 149 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') | 149 | locationList = self.main_window.get_object('QQuickListView', 'LocationList') |
1056 | 150 | locItem = locationList.get_children()[0] | 150 | locItem = locationList.get_children()[0] |
1057 | 151 | loc_x, loc_y, loc_w, loc_h = locItem.globalRect | 151 | loc_x, loc_y, loc_w, loc_h = locItem.globalRect |
1058 | @@ -154,8 +154,47 @@ | |||
1059 | 154 | self.pointing_device.move(loc_x + loc_w - 10, loc_y + loc_h / 2) | 154 | self.pointing_device.move(loc_x + loc_w - 10, loc_y + loc_h / 2) |
1060 | 155 | self.pointing_device.release() | 155 | self.pointing_device.release() |
1061 | 156 | 156 | ||
1064 | 157 | # toolbar disappears since no locations defined | 157 | def test_remove_location(self): |
1065 | 158 | self.assertThat(self.main_window.get_toolbar().opened, Eventually(Equals(False))) | 158 | """Removes location""" |
1066 | 159 | # wait till data is loaded | ||
1067 | 160 | loadingPage = self.main_window.get_object("Tabs", "rootTabs") | ||
1068 | 161 | self.assertThat(loadingPage.visible, Eventually(Equals(True))) | ||
1069 | 162 | |||
1070 | 163 | # count locations at start | ||
1071 | 164 | tabObjects = self.main_window.get_objects('LocationTab','LocationTab') | ||
1072 | 165 | tabsSumStart = len(tabObjects) | ||
1073 | 166 | |||
1074 | 167 | # go to the location manager and remove location | ||
1075 | 168 | self._open_location_manager() | ||
1076 | 169 | self._swipe_location_to_remove() | ||
1077 | 170 | self._click_sheet_confirm() | ||
1078 | 171 | |||
1079 | 172 | # back to locations, only one is left | ||
1080 | 173 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') | ||
1081 | 174 | self.assertThat(load_indicator.running, Eventually(Equals(False))) | ||
1082 | 175 | tabObjects = self.main_window.get_objects('LocationTab','LocationTab') | ||
1083 | 176 | self.assertEqual(tabsSumStart-1, len(tabObjects)) | ||
1084 | 177 | |||
1085 | 178 | def test_cancel_remove_location(self): | ||
1086 | 179 | """Cancels removing of location""" | ||
1087 | 180 | # wait data is loaded | ||
1088 | 181 | loadingPage = self.main_window.get_object("Tabs", "rootTabs") | ||
1089 | 182 | self.assertThat(loadingPage.visible, Eventually(Equals(True))) | ||
1090 | 183 | |||
1091 | 184 | # count locations at start | ||
1092 | 185 | tabObjects = self.main_window.get_objects('LocationTab','LocationTab') | ||
1093 | 186 | tabsSumStart = len(tabObjects) | ||
1094 | 187 | |||
1095 | 188 | # go to the location manager, remove location, but click cancel | ||
1096 | 189 | self._open_location_manager() | ||
1097 | 190 | self._swipe_location_to_remove() | ||
1098 | 191 | self._click_sheet_cancel() | ||
1099 | 192 | |||
1100 | 193 | # back to locations, no loction is removed | ||
1101 | 194 | loadingPage = self.main_window.get_object("Tabs", "rootTabs") | ||
1102 | 195 | self.assertThat(loadingPage.visible, Eventually(Equals(True))) | ||
1103 | 196 | tabObjects = self.main_window.get_objects('LocationTab','LocationTab') | ||
1104 | 197 | self.assertEqual(tabsSumStart, len(tabObjects)) | ||
1105 | 159 | 198 | ||
1106 | 160 | def test_toolbar_opened_when_location_is_defined(self): | 199 | def test_toolbar_opened_when_location_is_defined(self): |
1107 | 161 | """Toolbar is visible since there's a location defined""" | 200 | """Toolbar is visible since there's a location defined""" |
1108 | 162 | 201 | ||
1109 | === modified file 'tests/autopilot/ubuntu_weather_app/tests/test_settings.py' | |||
1110 | --- tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-07-16 19:43:28 +0000 | |||
1111 | +++ tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-07-20 16:54:27 +0000 | |||
1112 | @@ -12,10 +12,10 @@ | |||
1113 | 12 | from testtools.matchers import Equals | 12 | from testtools.matchers import Equals |
1114 | 13 | from autopilot.matchers import Eventually | 13 | from autopilot.matchers import Eventually |
1115 | 14 | 14 | ||
1117 | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin | 15 | from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin, SheetMixin |
1118 | 16 | from ubuntu_weather_app.tests.weatherdata import locations_data | 16 | from ubuntu_weather_app.tests.weatherdata import locations_data |
1119 | 17 | 17 | ||
1121 | 18 | class TestSettings(WeatherTestCase, DatabaseMixin): | 18 | class TestSettings(WeatherTestCase, DatabaseMixin, SheetMixin): |
1122 | 19 | def setUp(self): | 19 | def setUp(self): |
1123 | 20 | self.clean_db() | 20 | self.clean_db() |
1124 | 21 | self.launch_and_quit_app() | 21 | self.launch_and_quit_app() |
1125 | @@ -35,14 +35,6 @@ | |||
1126 | 35 | sheet = self.main_window.get_object('ComposerSheet', 'SettingsSheet') | 35 | sheet = self.main_window.get_object('ComposerSheet', 'SettingsSheet') |
1127 | 36 | self.pointing_device.move_to_object(sheet) | 36 | self.pointing_device.move_to_object(sheet) |
1128 | 37 | 37 | ||
1129 | 38 | def _click_confirm(self): | ||
1130 | 39 | """Clicks the confirm button""" | ||
1131 | 40 | self.pointing_device.click_object(self.main_window.app.select_many('Button')[1]) | ||
1132 | 41 | |||
1133 | 42 | def _click_cancel(self): | ||
1134 | 43 | """Clicks the cancel button""" | ||
1135 | 44 | self.pointing_device.click_object(self.main_window.app.select_many('Button')[0]) | ||
1136 | 45 | |||
1137 | 46 | def _check_units(self, units): | 38 | def _check_units(self, units): |
1138 | 47 | """Checks selected units by values from the first location tab""" | 39 | """Checks selected units by values from the first location tab""" |
1139 | 48 | current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText') | 40 | current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText') |
1140 | @@ -69,7 +61,7 @@ | |||
1141 | 69 | imperial_option = units_selector.get_children()[3] | 61 | imperial_option = units_selector.get_children()[3] |
1142 | 70 | self.pointing_device.click_object(imperial_option) | 62 | self.pointing_device.click_object(imperial_option) |
1143 | 71 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) | 63 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) |
1145 | 72 | self._click_confirm() | 64 | self._click_sheet_confirm() |
1146 | 73 | 65 | ||
1147 | 74 | # wait for reload and check the imperial values | 66 | # wait for reload and check the imperial values |
1148 | 75 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') | 67 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') |
1149 | @@ -90,7 +82,7 @@ | |||
1150 | 90 | 82 | ||
1151 | 91 | # confirm | 83 | # confirm |
1152 | 92 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) | 84 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) |
1154 | 93 | self._click_confirm() | 85 | self._click_sheet_confirm() |
1155 | 94 | 86 | ||
1156 | 95 | # wait for reload and check the metric values again | 87 | # wait for reload and check the metric values again |
1157 | 96 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') | 88 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') |
1158 | @@ -114,6 +106,6 @@ | |||
1159 | 114 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) | 106 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) |
1160 | 115 | 107 | ||
1161 | 116 | # cancel and check | 108 | # cancel and check |
1163 | 117 | self._click_cancel() | 109 | self._click_sheet_cancel() |
1164 | 118 | self._check_units('metric') | 110 | self._check_units('metric') |
1165 | 119 | 111 | ||
1166 | 120 | 112 | ||
1167 | === modified file 'ubuntu-weather-app.qml' | |||
1168 | --- ubuntu-weather-app.qml 2013-07-16 19:34:12 +0000 | |||
1169 | +++ ubuntu-weather-app.qml 2013-07-20 16:54:27 +0000 | |||
1170 | @@ -31,6 +31,10 @@ | |||
1171 | 31 | width: units.gu(50) | 31 | width: units.gu(50) |
1172 | 32 | height: units.gu(75) | 32 | height: units.gu(75) |
1173 | 33 | 33 | ||
1174 | 34 | headerColor: "#57365E" | ||
1175 | 35 | backgroundColor: "#A55263" | ||
1176 | 36 | footerColor: "#D75669" | ||
1177 | 37 | |||
1178 | 34 | property var locationsList: [] | 38 | property var locationsList: [] |
1179 | 35 | property var tabsObject: null | 39 | property var tabsObject: null |
1180 | 36 | // set default values for settings here | 40 | // set default values for settings here |
1181 | @@ -61,13 +65,14 @@ | |||
1182 | 61 | var locLength = locations.length, | 65 | var locLength = locations.length, |
1183 | 62 | locBeforeLen = locationsList.length, | 66 | locBeforeLen = locationsList.length, |
1184 | 63 | focusToLast = (locBeforeLen > 0 && locLength > locBeforeLen) ? true : false; | 67 | focusToLast = (locBeforeLen > 0 && locLength > locBeforeLen) ? true : false; |
1185 | 68 | loading.running = false; | ||
1186 | 64 | // show locationmanager when no location is added | 69 | // show locationmanager when no location is added |
1187 | 65 | if(locLength === 0) { | 70 | if(locLength === 0) { |
1188 | 66 | showLocationManager() | 71 | showLocationManager() |
1189 | 67 | return; | 72 | return; |
1190 | 68 | } | 73 | } |
1191 | 69 | 74 | ||
1193 | 70 | locationsList = locations; | 75 | locationsList = locations; |
1194 | 71 | if(tabsObject !== null) { | 76 | if(tabsObject !== null) { |
1195 | 72 | tabsObject.destroy() | 77 | tabsObject.destroy() |
1196 | 73 | } | 78 | } |
1197 | @@ -79,19 +84,13 @@ | |||
1198 | 79 | }; | 84 | }; |
1199 | 80 | } | 85 | } |
1200 | 81 | tabsString += "}"; // END Tabs componen | 86 | tabsString += "}"; // END Tabs componen |
1201 | 82 | if(bigLoading !== null) { | ||
1202 | 83 | bigLoading.destroy(); | ||
1203 | 84 | } | ||
1204 | 85 | loading.running = false; | ||
1205 | 86 | tabsObject = Qt.createQmlObject(tabsString, tabPage, "tabs") | 87 | tabsObject = Qt.createQmlObject(tabsString, tabPage, "tabs") |
1206 | 87 | if(focusToLast) | 88 | if(focusToLast) |
1207 | 88 | tabsObject.selectedTabIndex = locLength -1; | 89 | tabsObject.selectedTabIndex = locLength -1; |
1208 | 89 | } | 90 | } |
1209 | 90 | 91 | ||
1210 | 91 | function refreshData(from_storage, force_refresh) { | 92 | function refreshData(from_storage, force_refresh) { |
1214 | 92 | if(bigLoading === null) { | 93 | loading.running = true; |
1212 | 93 | loading.running = true; | ||
1213 | 94 | } | ||
1215 | 95 | // | 94 | // |
1216 | 96 | if(from_storage === true && force_refresh !== true) { | 95 | if(from_storage === true && force_refresh !== true) { |
1217 | 97 | storage.getLocations(buildTabs); | 96 | storage.getLocations(buildTabs); |
1218 | @@ -106,8 +105,7 @@ | |||
1219 | 106 | } | 105 | } |
1220 | 107 | 106 | ||
1221 | 108 | function showLocationManager() { | 107 | function showLocationManager() { |
1224 | 109 | pageStack.push(locationManager) | 108 | PopupUtils.open(locationManager) |
1223 | 110 | locationManager.loadData() | ||
1225 | 111 | } | 109 | } |
1226 | 112 | 110 | ||
1227 | 113 | function showSettings() { | 111 | function showSettings() { |
1228 | @@ -131,43 +129,24 @@ | |||
1229 | 131 | 129 | ||
1230 | 132 | Components.Storage{ | 130 | Components.Storage{ |
1231 | 133 | id: storage | 131 | id: storage |
1271 | 134 | } | 132 | } |
1272 | 135 | 133 | ||
1273 | 136 | Components.LocationManagerPage { | 134 | Components.LocationManagerSheet { |
1274 | 137 | id:locationManager | 135 | id:locationManager |
1275 | 138 | } | 136 | } |
1276 | 139 | 137 | ||
1277 | 140 | Components.AddLocationPage { | 138 | ActivityIndicator{ |
1278 | 141 | id:addLocationPage | 139 | id:loading |
1279 | 142 | } | 140 | objectName: "LoadingSpinner" |
1280 | 143 | 141 | running: false | |
1281 | 144 | PageStack { | 142 | z: 1 |
1282 | 145 | id: pageStack | 143 | anchors.centerIn: parent |
1283 | 146 | Component.onCompleted: push(tabPage) | 144 | } |
1284 | 147 | 145 | ||
1285 | 148 | Page { | 146 | Item { |
1286 | 149 | id: tabPage | 147 | id:tabPage |
1287 | 150 | objectName: "MainPage" | 148 | width: parent.width |
1288 | 151 | visible: false | 149 | height:parent.height |
1289 | 152 | ActivityIndicator{ | 150 | } |
1290 | 153 | id:loading | 151 | |
1252 | 154 | objectName: "LoadingSpinner" | ||
1253 | 155 | running: false | ||
1254 | 156 | z: 1 | ||
1255 | 157 | anchors{ | ||
1256 | 158 | top: parent.top | ||
1257 | 159 | topMargin: units.gu(0.5) | ||
1258 | 160 | right: parent.right | ||
1259 | 161 | rightMargin: units.gu(1) | ||
1260 | 162 | } | ||
1261 | 163 | } | ||
1262 | 164 | ActivityIndicator{ | ||
1263 | 165 | id:bigLoading | ||
1264 | 166 | objectName: "LoadingSpinner" | ||
1265 | 167 | running: true | ||
1266 | 168 | z: 1 | ||
1267 | 169 | anchors.centerIn: parent | ||
1268 | 170 | } | ||
1269 | 171 | } | ||
1270 | 172 | } | ||
1291 | 173 | } | 152 | } |
PASSED: Continuous integration, rev:70 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 15/ 91.189. 93.70:8080/ job/ubuntu- weather- app-precise- amd64-ci/ 7 91.189. 93.70:8080/ job/ubuntu- weather- app-quantal- amd64-ci/ 14 91.189. 93.70:8080/ job/ubuntu- weather- app-raring- amd64-ci/ 14 91.189. 93.70:8080/ job/ubuntu- weather- app-saucy- amd64-ci/ 7
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 15/rebuild
http://