Merge lp:~martin-borho/ubuntu-weather-app/icon_codes into lp:ubuntu-weather-app/obsolete.trunk

Proposed by Martin Borho on 2013-08-09
Status: Merged
Approved by: Martin Borho on 2013-08-12
Approved revision: 90
Merged at revision: 90
Proposed branch: lp:~martin-borho/ubuntu-weather-app/icon_codes
Merge into: lp:ubuntu-weather-app/obsolete.trunk
Diff against target: 741 lines (+274/-221)
10 files modified
components/AddLocationSheet.qml (+13/-11)
components/LocationTab.qml (+1/-1)
components/WeatherApi.js (+26/-1)
components/WeatherConditionIconComponent.qml (+194/-197)
tests/autopilot/ubuntu_weather_app/tests/__init__.py (+2/-2)
tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py (+18/-4)
tests/autopilot/ubuntu_weather_app/tests/test_mainview.py (+1/-1)
tests/autopilot/ubuntu_weather_app/tests/test_settings.py (+2/-2)
tests/autopilot/ubuntu_weather_app/tests/weatherdata.py (+2/-2)
ubuntu-weather-app.qml (+15/-0)
To merge this branch: bzr merge lp:~martin-borho/ubuntu-weather-app/icon_codes
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) 2013-08-09 Approve on 2013-08-12
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2013-08-10
Review via email: mp+179453@code.launchpad.net

Commit message

own icon codes added, ActivityIndicator is shown while searching for location, notification when http calls are failing

Description of the change

* added ActivityIndicator for location search
* showing a notification when http calls are failing
* using own icon-codes in weather data
* added assertions to detect when network connection is missing

To post a comment you must log in.
89. By Martin Borho on 2013-08-10

autopilot: added assertions to detect when network connection is missing

Nicholas Skaggs (nskaggs) wrote :

Going to try this out -- is this ready to merge?

Nicholas Skaggs (nskaggs) :
review: Approve
Nicholas Skaggs (nskaggs) wrote :

Martin, I'll wait for you on this.. Can we bump all the timeout's to like 2 mins? Look at where it's failing in the smoke tests and bump those timeouts to 2 mins just in case there's SOME odd reason the lab device is running really really slow.

90. By Martin Borho on 2013-08-12

autopilot: increased timeouts to 120 secs

Martin Borho (martin-borho) wrote :

Nicholas, the timeouts now 120 seconds!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components/AddLocationSheet.qml'
2--- components/AddLocationSheet.qml 2013-08-02 22:35:44 +0000
3+++ components/AddLocationSheet.qml 2013-08-12 18:18:29 +0000
4@@ -34,26 +34,24 @@
5 id: searchWorker
6 source: "./WeatherApi.js"
7 onMessage: {
8+ searching.running = false;
9 if(!messageObject.error) {
10 listView.visible = true
11 messageObject.result.locations.forEach(function(loc) {
12 citiesModel.append(loc);
13 noCityError.visible = false
14 });
15+ if (!citiesModel.count) {
16+ noCityError.visible = true
17+ noCityError.text = i18n.tr("No location was found for ") + locationString.text
18+ }
19 } else {
20 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)
21- }
22- if (!citiesModel.count) {
23- noCityError.visible = true
24- noCityError.text = i18n.tr("No location was found for ") + locationString.text
25+ httpFailedDialog.show();
26 }
27 }
28 }
29
30- Component.onCompleted: {
31-
32- }
33-
34 function clear() {
35 locationString.text = '';
36 citiesModel.clear();
37@@ -81,6 +79,7 @@
38 hasClearButton: true
39 onAccepted: {
40 citiesModel.clear();
41+ searching.running = true;
42 searchWorker.sendMessage({
43 action: "searchByName",
44 params: {name:locationString.text, units:"metric"}
45@@ -116,11 +115,8 @@
46 progression: true;
47 onClicked: {
48 var location = citiesModel.get(index)
49- //locationManager.addLocation(location)
50- //mainView.newLocationAdded(location)
51 locationManagerSheet.addLocation(location)
52 PopupUtils.close(addLocationSheet)
53- //pageStack.pop()
54 clear()
55 }
56 }
57@@ -129,6 +125,12 @@
58 align: Qt.AlignTrailing;
59 }
60 }
61+ ActivityIndicator{
62+ id:searching
63+ objectName: "SearchingSpinner"
64+ running: false
65+ anchors.centerIn: parent
66+ }
67 }
68 }
69 }
70
71=== modified file 'components/LocationTab.qml'
72--- components/LocationTab.qml 2013-08-05 18:53:33 +0000
73+++ components/LocationTab.qml 2013-08-12 18:18:29 +0000
74@@ -81,7 +81,7 @@
75 tempMax: (dailyForecasts[x]["current"] !== undefined) ? dailyForecasts[x][units].tempMax :
76 null,
77 cond: dailyForecasts[x].condition.id,
78- condIcon: dailyForecasts[x].condition.icon,
79+ condIcon: dailyForecasts[x].icon,
80 wind_speed: dailyForecasts[x][units].windSpeed,
81 wind_dir: direction,
82 humid: dailyForecasts[x].humidity,
83
84=== modified file 'components/WeatherApi.js'
85--- components/WeatherApi.js 2013-08-05 18:53:33 +0000
86+++ components/WeatherApi.js 2013-08-12 18:18:29 +0000
87@@ -3,7 +3,7 @@
88 * Version of the response data format.
89 * Increase this number to force a refresh.
90 */
91-var RESPONSE_DATA_VERSION = 20130801;
92+var RESPONSE_DATA_VERSION = 20130808;
93
94 /**
95 * Helper functions
96@@ -21,12 +21,35 @@
97 return ms*3.6;
98 }
99
100+
101+
102 var OpenWeatherMapApi = (function() {
103 /**
104 provides neccessary methods for requesting and preparing data from OpenWeatherMap.org
105 */
106 var _baseUrl = "http://api.openweathermap.org/data/2.5/";
107 //
108+ var _icon_map = {
109+ "01d": "clear_day",
110+ "01n": "clear_night",
111+ "02d": "few_clouds_day",
112+ "02n": "few_clouds_night",
113+ "03d": "scattered_clouds_day",
114+ "03n": "scattered_clouds_night",
115+ "04d": "broken_clouds_day",
116+ "04n": "broken_clouds_night",
117+ "09d": "shower_rain_day",
118+ "09n": "shower_rain_night",
119+ "10d": "rain_day",
120+ "10n": "rain_night",
121+ "11d": "thunderstorm_day",
122+ "11n": "thunderstorm_night",
123+ "13d": "snow_day",
124+ "13n": "snow_night",
125+ "50d": "mist_day",
126+ "50n": "mist_night"
127+ }
128+ //
129 function _buildSearchResult(request, data) {
130 var searchResult = { locations: [], request: request };
131 if(data.cod === "200" && data.list) {
132@@ -53,6 +76,7 @@
133 humidity: data.main.humidity,
134 pressure: data.main.pressure,
135 windDeg: data.main.deg,
136+ icon: _icon_map[data.weather[0].icon],
137 condition: data.weather[0]
138 };
139 if(data.id !== undefined) {
140@@ -80,6 +104,7 @@
141 },
142 pressure: data.pressure,
143 humidity: data.humidity,
144+ icon: _icon_map[data.weather[0].icon],
145 condition: data.weather[0],
146 windDeg: data.deg,
147 hourly: []
148
149=== modified file 'components/WeatherConditionIconComponent.qml'
150--- components/WeatherConditionIconComponent.qml 2013-06-14 15:34:09 +0000
151+++ components/WeatherConditionIconComponent.qml 2013-08-12 18:18:29 +0000
152@@ -19,9 +19,6 @@
153 property bool __fog: false
154
155 onConditionChanged: {
156- // hotfix for inaccurate api data
157- // see http://bugs.openweathermap.org/issues/72
158- if(condition === "10") condition ="10d"
159 weatherCondition.state = condition
160 }
161
162@@ -575,7 +572,7 @@
163
164 states: [
165 State {
166- name: "01d"
167+ name: "clear_day"
168 StateChangeScript {
169 script: {
170 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
171@@ -590,7 +587,7 @@
172 }
173 },
174 State {
175- name: "01n"
176+ name: "clear_night"
177 StateChangeScript {
178 script: {
179 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
180@@ -605,7 +602,7 @@
181 }
182 },
183 State {
184- name: "02d"
185+ name: "few_clouds_day"
186 StateChangeScript {
187 script: {
188 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
189@@ -620,7 +617,7 @@
190 }
191 },
192 State {
193- name: "02n"
194+ name: "few_clouds_night"
195 StateChangeScript {
196 script: {
197 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
198@@ -640,195 +637,195 @@
199 }
200 },
201 State {
202- name: "03d"
203- StateChangeScript {
204- script: {
205- if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
206- if(__fewClouds) anim_fewCloudsOut.start();
207- if(__rain) anim_rainOut.start();
208- if(__storm) anim_stormOut.start();
209- if(__snow) anim_snowOut.start();
210- if(__broken) anim_brokenCloudsOut.start();
211- if(__fog) anim_fogOut.start();
212- if(!__scattered) anim_scatCloudsIn.start();
213- }
214- }
215- },
216- State {
217- name: "03n"
218- StateChangeScript {
219- script: {
220- if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
221- if(__fewClouds) anim_fewCloudsOut.start();
222- if(__rain) anim_rainOut.start();
223- if(__storm) anim_stormOut.start();
224- if(__snow) anim_snowOut.start();
225- if(__broken) anim_brokenCloudsOut.start();
226- if(__fog) anim_fogOut.start();
227- if(!__scattered) anim_scatCloudsIn.start();
228- }
229- }
230- },
231- State {
232- name: "04d"
233- StateChangeScript {
234- script: {
235- if(__moon) anim_moonOut.start();
236- if(__sun) anim_sunOut.start();
237- if(__fewClouds) anim_fewCloudsOut.start();
238- if(__scattered) anim_scatCloudsOut.start();
239- if(__rain) anim_rainOut.start();
240- if(__storm) anim_stormOut.start();
241- if(__snow) anim_snowOut.start();
242- if(__fog) anim_fogOut.start();
243- if(!__broken) anim_brokenCloudsIn.start();
244- }
245- }
246- },
247- State {
248- name: "04n"
249- StateChangeScript {
250- script: {
251- if(__moon) anim_moonOut.start();
252- if(__sun) anim_sunOut.start();
253- if(__fewClouds) anim_fewCloudsOut.start();
254- if(__scattered) anim_scatCloudsOut.start();
255- if(__rain) anim_rainOut.start();
256- if(__storm) anim_stormOut.start();
257- if(__snow) anim_snowOut.start();
258- if(__fog) anim_fogOut.start();
259- if(!__broken) anim_brokenCloudsIn.start();
260- }
261- }
262- },
263- State {
264- name: "09d"
265- StateChangeScript {
266- script: {
267- if(__moon) anim_moonOut.start();
268- if(__sun) anim_sunOut.start();
269- if(__fewClouds) anim_fewCloudsOut.start();
270- if(__scattered) anim_scatCloudsOut.start();
271- if(__storm) anim_stormOut.start();
272- if(__snow) anim_snowOut.start();
273- if(__fog) anim_fogOut.start();
274- if(!__broken) anim_brokenCloudsIn.start();
275- if(!__rain) anim_rainIn.start();
276- }
277- }
278- },
279- State {
280- name: "09n"
281- StateChangeScript {
282- script: {
283- if(__moon) anim_moonOut.start();
284- if(__sun) anim_sunOut.start();
285- if(__fewClouds) anim_fewCloudsOut.start();
286- if(__scattered) anim_scatCloudsOut.start();
287- if(__storm) anim_stormOut.start();
288- if(__snow) anim_snowOut.start();
289- if(__fog) anim_fogOut.start();
290- if(!__broken) anim_brokenCloudsIn.start();
291- if(!__rain) anim_rainIn.start();
292- }
293- }
294- },
295- State {
296- name: "10d"
297- StateChangeScript {
298- script: {
299- if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
300- if(__fewClouds) anim_fewCloudsOut.start();
301- if(__broken) anim_brokenCloudsOut.start();
302- if(__storm) anim_stormOut.start();
303- if(__snow) anim_snowOut.start();
304- if(__fog) anim_fogOut.start();
305- if(!__scattered) anim_scatCloudsIn.start();
306- if(!__rain) anim_rainIn.start();
307- }
308- }
309- },
310- State {
311- name: "10n"
312- StateChangeScript {
313- script: {
314- if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
315- if(__fewClouds) anim_fewCloudsOut.start();
316- if(__broken) anim_brokenCloudsOut.start();
317- if(__storm) anim_stormOut.start();
318- if(__snow) anim_snowOut.start();
319- if(__fog) anim_fogOut.start();
320- if(!__scattered) anim_scatCloudsIn.start();
321- if(!__rain) anim_rainIn.start();
322- }
323- }
324- },
325- State {
326- name: "11d"
327- StateChangeScript {
328- script: {
329- if(__moon) anim_moonOut.start();
330- if(__sun) anim_sunOut.start();
331- if(__fewClouds) anim_fewCloudsOut.start();
332- if(__scattered) anim_scatCloudsOut.start();
333- if(__rain) anim_rainOut.start();
334- if(__snow) anim_snowOut.start();
335- if(__fog) anim_fogOut.start();
336- if(!__broken) anim_brokenCloudsIn.start();
337- if(!__storm) anim_stormIn.start();
338- }
339- }
340- },
341- State {
342- name: "11n"
343- StateChangeScript {
344- script: {
345- if(__moon) anim_moonOut.start();
346- if(__sun) anim_sunOut.start();
347- if(__fewClouds) anim_fewCloudsOut.start();
348- if(__scattered) anim_scatCloudsOut.start();
349- if(__rain) anim_rainOut.start();
350- if(__snow) anim_snowOut.start();
351- if(__fog) anim_fogOut.start();
352- if(!__broken) anim_brokenCloudsIn.start();
353- if(!__storm) anim_stormIn.start();
354- }
355- }
356- },
357- State {
358- name: "13d"
359- StateChangeScript {
360- script: {
361- if(__moon) anim_moonOut.start();
362- if(__sun) anim_sunOut.start();
363- if(__fewClouds) anim_fewCloudsOut.start();
364- if(__scattered) anim_scatCloudsOut.start();
365- if(__rain) anim_rainOut.start();
366- if(__storm) anim_stormOut.start();
367- if(__fog) anim_fogOut.start();
368- if(!__broken) anim_brokenCloudsIn.start();
369- if(!__snow) anim_snowIn.start();
370- }
371- }
372- },
373- State {
374- name: "13n"
375- StateChangeScript {
376- script: {
377- if(__moon) anim_moonOut.start();
378- if(__sun) anim_sunOut.start();
379- if(__fewClouds) anim_fewCloudsOut.start();
380- if(__scattered) anim_scatCloudsOut.start();
381- if(__rain) anim_rainOut.start();
382- if(__storm) anim_stormOut.start();
383- if(__fog) anim_fogOut.start();
384- if(!__broken) anim_brokenCloudsIn.start();
385- if(!__snow) anim_snowIn.start();
386- }
387- }
388- },
389- State {
390- name: "50d"
391+ name: "scattered_clouds_day"
392+ StateChangeScript {
393+ script: {
394+ if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
395+ if(__fewClouds) anim_fewCloudsOut.start();
396+ if(__rain) anim_rainOut.start();
397+ if(__storm) anim_stormOut.start();
398+ if(__snow) anim_snowOut.start();
399+ if(__broken) anim_brokenCloudsOut.start();
400+ if(__fog) anim_fogOut.start();
401+ if(!__scattered) anim_scatCloudsIn.start();
402+ }
403+ }
404+ },
405+ State {
406+ name: "scattered_clouds_night"
407+ StateChangeScript {
408+ script: {
409+ if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
410+ if(__fewClouds) anim_fewCloudsOut.start();
411+ if(__rain) anim_rainOut.start();
412+ if(__storm) anim_stormOut.start();
413+ if(__snow) anim_snowOut.start();
414+ if(__broken) anim_brokenCloudsOut.start();
415+ if(__fog) anim_fogOut.start();
416+ if(!__scattered) anim_scatCloudsIn.start();
417+ }
418+ }
419+ },
420+ State {
421+ name: "broken_clouds_day"
422+ StateChangeScript {
423+ script: {
424+ if(__moon) anim_moonOut.start();
425+ if(__sun) anim_sunOut.start();
426+ if(__fewClouds) anim_fewCloudsOut.start();
427+ if(__scattered) anim_scatCloudsOut.start();
428+ if(__rain) anim_rainOut.start();
429+ if(__storm) anim_stormOut.start();
430+ if(__snow) anim_snowOut.start();
431+ if(__fog) anim_fogOut.start();
432+ if(!__broken) anim_brokenCloudsIn.start();
433+ }
434+ }
435+ },
436+ State {
437+ name: "broken_clouds_night"
438+ StateChangeScript {
439+ script: {
440+ if(__moon) anim_moonOut.start();
441+ if(__sun) anim_sunOut.start();
442+ if(__fewClouds) anim_fewCloudsOut.start();
443+ if(__scattered) anim_scatCloudsOut.start();
444+ if(__rain) anim_rainOut.start();
445+ if(__storm) anim_stormOut.start();
446+ if(__snow) anim_snowOut.start();
447+ if(__fog) anim_fogOut.start();
448+ if(!__broken) anim_brokenCloudsIn.start();
449+ }
450+ }
451+ },
452+ State {
453+ name: "shower_rain_day"
454+ StateChangeScript {
455+ script: {
456+ if(__moon) anim_moonOut.start();
457+ if(__sun) anim_sunOut.start();
458+ if(__fewClouds) anim_fewCloudsOut.start();
459+ if(__scattered) anim_scatCloudsOut.start();
460+ if(__storm) anim_stormOut.start();
461+ if(__snow) anim_snowOut.start();
462+ if(__fog) anim_fogOut.start();
463+ if(!__broken) anim_brokenCloudsIn.start();
464+ if(!__rain) anim_rainIn.start();
465+ }
466+ }
467+ },
468+ State {
469+ name: "shower_rain_night"
470+ StateChangeScript {
471+ script: {
472+ if(__moon) anim_moonOut.start();
473+ if(__sun) anim_sunOut.start();
474+ if(__fewClouds) anim_fewCloudsOut.start();
475+ if(__scattered) anim_scatCloudsOut.start();
476+ if(__storm) anim_stormOut.start();
477+ if(__snow) anim_snowOut.start();
478+ if(__fog) anim_fogOut.start();
479+ if(!__broken) anim_brokenCloudsIn.start();
480+ if(!__rain) anim_rainIn.start();
481+ }
482+ }
483+ },
484+ State {
485+ name: "rain_day"
486+ StateChangeScript {
487+ script: {
488+ if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
489+ if(__fewClouds) anim_fewCloudsOut.start();
490+ if(__broken) anim_brokenCloudsOut.start();
491+ if(__storm) anim_stormOut.start();
492+ if(__snow) anim_snowOut.start();
493+ if(__fog) anim_fogOut.start();
494+ if(!__scattered) anim_scatCloudsIn.start();
495+ if(!__rain) anim_rainIn.start();
496+ }
497+ }
498+ },
499+ State {
500+ name: "rain_night"
501+ StateChangeScript {
502+ script: {
503+ if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
504+ if(__fewClouds) anim_fewCloudsOut.start();
505+ if(__broken) anim_brokenCloudsOut.start();
506+ if(__storm) anim_stormOut.start();
507+ if(__snow) anim_snowOut.start();
508+ if(__fog) anim_fogOut.start();
509+ if(!__scattered) anim_scatCloudsIn.start();
510+ if(!__rain) anim_rainIn.start();
511+ }
512+ }
513+ },
514+ State {
515+ name: "thunderstorm_day"
516+ StateChangeScript {
517+ script: {
518+ if(__moon) anim_moonOut.start();
519+ if(__sun) anim_sunOut.start();
520+ if(__fewClouds) anim_fewCloudsOut.start();
521+ if(__scattered) anim_scatCloudsOut.start();
522+ if(__rain) anim_rainOut.start();
523+ if(__snow) anim_snowOut.start();
524+ if(__fog) anim_fogOut.start();
525+ if(!__broken) anim_brokenCloudsIn.start();
526+ if(!__storm) anim_stormIn.start();
527+ }
528+ }
529+ },
530+ State {
531+ name: "thunderstorm_night"
532+ StateChangeScript {
533+ script: {
534+ if(__moon) anim_moonOut.start();
535+ if(__sun) anim_sunOut.start();
536+ if(__fewClouds) anim_fewCloudsOut.start();
537+ if(__scattered) anim_scatCloudsOut.start();
538+ if(__rain) anim_rainOut.start();
539+ if(__snow) anim_snowOut.start();
540+ if(__fog) anim_fogOut.start();
541+ if(!__broken) anim_brokenCloudsIn.start();
542+ if(!__storm) anim_stormIn.start();
543+ }
544+ }
545+ },
546+ State {
547+ name: "snow_day"
548+ StateChangeScript {
549+ script: {
550+ if(__moon) anim_moonOut.start();
551+ if(__sun) anim_sunOut.start();
552+ if(__fewClouds) anim_fewCloudsOut.start();
553+ if(__scattered) anim_scatCloudsOut.start();
554+ if(__rain) anim_rainOut.start();
555+ if(__storm) anim_stormOut.start();
556+ if(__fog) anim_fogOut.start();
557+ if(!__broken) anim_brokenCloudsIn.start();
558+ if(!__snow) anim_snowIn.start();
559+ }
560+ }
561+ },
562+ State {
563+ name: "snow_night"
564+ StateChangeScript {
565+ script: {
566+ if(__moon) anim_moonOut.start();
567+ if(__sun) anim_sunOut.start();
568+ if(__fewClouds) anim_fewCloudsOut.start();
569+ if(__scattered) anim_scatCloudsOut.start();
570+ if(__rain) anim_rainOut.start();
571+ if(__storm) anim_stormOut.start();
572+ if(__fog) anim_fogOut.start();
573+ if(!__broken) anim_brokenCloudsIn.start();
574+ if(!__snow) anim_snowIn.start();
575+ }
576+ }
577+ },
578+ State {
579+ name: "mist_day"
580 StateChangeScript {
581 script: {
582 if(__moon) anim_moonOut.start();
583@@ -844,7 +841,7 @@
584 }
585 },
586 State {
587- name: "50n"
588+ name: "mist_night"
589 StateChangeScript {
590 script: {
591 if(__moon) anim_moonOut.start();
592
593=== modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py'
594--- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-08-04 11:09:32 +0000
595+++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-08-12 18:18:29 +0000
596@@ -88,11 +88,11 @@
597 """A mixin to to give access to common sheet elements"""
598 def _click_sheet_confirm(self):
599 """Clicks the confirm button"""
600- self.pointing_device.click_object(self.main_window.select_many('Button')[1])
601+ self.pointing_device.click_object(self.main_window.select_many('Button')[2])
602
603 def _click_sheet_cancel(self):
604 """Clicks the cancel button"""
605- self.pointing_device.click_object(self.main_window.select_many('Button')[0])
606+ self.pointing_device.click_object(self.main_window.select_many('Button')[1])
607
608 class DatabaseMixin(object):
609
610
611=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py'
612--- tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-08-09 21:01:16 +0000
613+++ tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-08-12 18:18:29 +0000
614@@ -73,8 +73,12 @@
615 self.search_for_city("London")
616
617 # wait for results and click on the first item
618+ http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog')
619+ self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True)))
620+ load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
621+ self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
622 resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList')
623- self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))
624+ self.assertThat(resultsList.visible, Eventually(Equals(True)))
625 firstResult = self.main_window.get_object('Standard', 'searchResult0')
626 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))
627 self.pointing_device.move_to_object(firstResult)
628@@ -106,8 +110,12 @@
629 searchField = self.search_for_city("London")
630
631 # wait for results and click on the first item
632+ http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog')
633+ self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True)))
634+ load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
635+ self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
636 resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList')
637- self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))
638+ self.assertThat(resultsList.visible, Eventually(Equals(True)))
639 firstResult = self.select_single_retry("Standard", objectName="searchResult0")
640 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))
641 self.assertThat(firstResult.text, Eventually(Equals("London, GB")))
642@@ -121,7 +129,9 @@
643 self.pointing_device.click_object(searchField)
644 self.keyboard.type("Hamburg")
645 self.keyboard.press_and_release('Enter')
646- self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))
647+ load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
648+ self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
649+ self.assertThat(resultsList.visible, Eventually(Equals(True)))
650 firstResult = self.select_single_retry("Standard", objectName="searchResult0")
651 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))
652 self.assertThat(firstResult.text, Eventually(Equals("Hamburg, DE")))
653@@ -141,8 +151,12 @@
654 self.search_for_city("UbuntuCity")
655
656 # wait for result and look if label is shown
657+ http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog')
658+ self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True)))
659+ load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
660+ self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
661 errorLabel = self.main_window.get_object('Label', 'noCityError')
662- self.assertThat(errorLabel.visible, Eventually(Equals(True), timeout=30))
663+ self.assertThat(errorLabel.visible, Eventually(Equals(True)))
664
665
666 class TestLocationManagerWithLocation(WeatherTestCase, DatabaseMixin, SheetMixin):
667
668=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_mainview.py'
669--- tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-08-09 21:01:16 +0000
670+++ tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-08-12 18:18:29 +0000
671@@ -60,7 +60,7 @@
672 # refresh and wait till loading has finished
673 self.main_window.open_toolbar().click_button("RefreshButton")
674 load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner')
675- self.assertThat(load_indicator.running, Eventually(Equals(False)))
676+ self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
677
678 # get the data from the refreshed tabs, have to be new
679 refreshed_dates = self.main_window.get_objects('Label','DayDateLabel')
680
681=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_settings.py'
682--- tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-08-07 17:27:32 +0000
683+++ tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-08-12 18:18:29 +0000
684@@ -39,10 +39,10 @@
685 current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText')
686 if units == "imperial":
687 self.assertThat(current_temps[0].text, Eventually(Equals(u'70°F')))
688- self.assertThat(current_temps[2].text, Eventually(Equals(u'72°F')))
689+ self.assertThat(current_temps[2].text, Eventually(Equals(u'73°F')))
690 else:
691 self.assertThat(current_temps[0].text, Eventually(Equals(u'21°C')))
692- self.assertThat(current_temps[2].text, Eventually(Equals(u'22°C')))
693+ self.assertThat(current_temps[2].text, Eventually(Equals(u'23°C')))
694
695 def test_switch_scale(self):
696 """Tests switching the scale in the settings"""
697
698=== modified file 'tests/autopilot/ubuntu_weather_app/tests/weatherdata.py'
699--- tests/autopilot/ubuntu_weather_app/tests/weatherdata.py 2013-08-06 19:35:53 +0000
700+++ tests/autopilot/ubuntu_weather_app/tests/weatherdata.py 2013-08-12 18:18:29 +0000
701@@ -6,7 +6,7 @@
702 # by the Free Software Foundation.
703 locations_data = []
704
705-locations_data.append("""{"location":{"service_id":2643743,"name":"London","country":"GB","service":"openweathermap"},"db":{"updated":"2013-08-06T18:31:16.155Z","id":1},"format":20130801,"data":[{"date":"2013-08-06","timestamp":1375738207,"metric":{"tempMin":17.38,"tempMax":21.29,"windSpeed":5.22},"imperial":{"tempMin":63.284,"tempMax":70.322,"windSpeed":3.248,"rain":null},"pressure":1020.63,"humidity":58,"condition":{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"},"windDeg":272,"hourly":[],"current":{"timestamp":1375813805,"date":"2013-08-06 20:30","metric":{"temp":21.29,"windSpeed":null},"imperial":{"temp":70.322,"windSpeed":null,"rain":null},"humidity":56,"pressure":1013,"condition":{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"},"service":"openweathermap","service_id":2643743}},{"date":"2013-08-07","timestamp":1375876800,"metric":{"tempMin":14.25,"tempMax":22.14,"windSpeed":9.54},"imperial":{"tempMin":57.650000000000006,"tempMax":71.852,"windSpeed":5.936,"rain":null},"pressure":1019.36,"humidity":58,"condition":{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"},"windDeg":66,"hourly":[]},{"date":"2013-08-08","timestamp":1375963200,"metric":{"tempMin":13.13,"tempMax":22.86,"windSpeed":5.796},"imperial":{"tempMin":55.634,"tempMax":73.148,"windSpeed":3.6064000000000007,"rain":null},"pressure":1026.02,"humidity":58,"condition":{"id":800,"main":"Clear","description":"sky is clear","icon":"01d"},"windDeg":357,"hourly":[]},{"date":"2013-08-09","timestamp":1376049600,"metric":{"tempMin":14.09,"tempMax":23.71,"windSpeed":12.276000000000002},"imperial":{"tempMin":57.362,"tempMax":74.678,"windSpeed":7.638400000000001,"rain":null},"pressure":1025.05,"humidity":56,"condition":{"id":800,"main":"Clear","description":"sky is clear","icon":"01d"},"windDeg":260,"hourly":[]},{"date":"2013-08-10","timestamp":1376136000,"metric":{"tempMin":11.82,"tempMax":21.31,"windSpeed":9.395999999999999,"rain":1},"imperial":{"tempMin":53.275999999999996,"tempMax":70.358,"windSpeed":5.8464,"rain":0.03937007874015748},"pressure":1026.7,"humidity":69,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":224,"hourly":[]},{"date":"2013-08-11","timestamp":1376222400,"metric":{"tempMin":15.38,"tempMax":22.5,"windSpeed":11.916},"imperial":{"tempMin":59.684,"tempMax":72.5,"windSpeed":7.4144000000000005,"rain":null},"pressure":1021.58,"humidity":61,"condition":{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"},"windDeg":255,"hourly":[]},{"date":"2013-08-12","timestamp":1376308800,"metric":{"tempMin":12.79,"tempMax":20.71,"windSpeed":14.148000000000001,"rain":1.14},"imperial":{"tempMin":55.022,"tempMax":69.278,"windSpeed":8.8032,"rain":0.04488188976377953},"pressure":1025.21,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":40,"hourly":[]},{"date":"2013-08-13","timestamp":1376395200,"metric":{"tempMin":11.61,"tempMax":22.22,"windSpeed":11.448,"rain":0.73},"imperial":{"tempMin":52.897999999999996,"tempMax":71.99600000000001,"windSpeed":7.123200000000001,"rain":0.02874015748031496},"pressure":1025.5,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":201,"hourly":[]},{"date":"2013-08-14","timestamp":1376481600,"metric":{"tempMin":16.09,"tempMax":22.97,"windSpeed":28.08,"rain":0.21},"imperial":{"tempMin":60.962,"tempMax":73.346,"windSpeed":17.472,"rain":0.00826771653543307},"pressure":1023.75,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":252,"hourly":[]},{"date":"2013-08-15","timestamp":1376568000,"metric":{"tempMin":14.36,"tempMax":22.61,"windSpeed":16.02,"rain":1.08},"imperial":{"tempMin":57.848,"tempMax":72.69800000000001,"windSpeed":9.968000000000002,"rain":0.042519685039370085},"pressure":1023.89,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":229,"hourly":[]}],"save":true}""")
706+locations_data.append("""{"updated":1375990401745,"save":false,"db":{"updated":"2013-08-08T19:33:21.745Z","id":1},"data":[{"icon":"broken_clouds_day","timestamp":1375963200,"hourly":[],"windDeg":233,"pressure":1023.82,"current":{"icon":"clear_day","timestamp":1375987800,"pressure":1019,"service_id":2643743,"metric":{"temp":21.25,"windSpeed":null},"date":"2013-08-08 20:50","condition":{"icon":"01d","description":"Sky is Clear","id":800,"main":"Clear"},"humidity":53,"imperial":{"rain":null,"temp":70.25,"windSpeed":null},"service":"openweathermap"},"metric":{"tempMin":16.51,"windSpeed":13.5,"tempMax":21.25},"date":"2013-08-08","condition":{"icon":"04d","description":"overcast clouds","id":804,"main":"Clouds"},"humidity":44,"imperial":{"rain":null,"tempMin":61.718,"windSpeed":8.4,"tempMax":70.25}},{"icon":"rain_day","timestamp":1376049600,"hourly":[],"windDeg":269,"pressure":1022.18,"metric":{"rain":1.5,"tempMin":14.27,"windSpeed":7.416,"tempMax":22.75},"date":"2013-08-09","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":68,"imperial":{"rain":0.05905511811023623,"tempMin":57.686,"windSpeed":4.614400000000001,"tempMax":72.95}},{"icon":"few_clouds_day","timestamp":1376136000,"hourly":[],"windDeg":275,"pressure":1027.61,"metric":{"tempMin":11.26,"windSpeed":5.796,"tempMax":21.17},"date":"2013-08-10","condition":{"icon":"02d","description":"few clouds","id":801,"main":"Clouds"},"humidity":63,"imperial":{"rain":null,"tempMin":52.268,"windSpeed":3.6064000000000007,"tempMax":70.106}},{"icon":"rain_day","timestamp":1376222400,"hourly":[],"windDeg":218,"pressure":1021.06,"metric":{"rain":1.5,"tempMin":14.67,"windSpeed":16.956,"tempMax":20.26},"date":"2013-08-11","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":80,"imperial":{"rain":0.05905511811023623,"tempMin":58.406,"windSpeed":10.550400000000002,"tempMax":68.468}},{"icon":"few_clouds_day","timestamp":1376308800,"hourly":[],"windDeg":293,"pressure":1024.95,"metric":{"tempMin":10.61,"windSpeed":10.44,"tempMax":19.58},"date":"2013-08-12","condition":{"icon":"02d","description":"few clouds","id":801,"main":"Clouds"},"humidity":62,"imperial":{"rain":null,"tempMin":51.098,"windSpeed":6.496,"tempMax":67.244}},{"icon":"broken_clouds_day","timestamp":1376395200,"hourly":[],"windDeg":241,"pressure":1025.32,"metric":{"tempMin":10.71,"windSpeed":12.96,"tempMax":21.34},"date":"2013-08-13","condition":{"icon":"04d","description":"broken clouds","id":803,"main":"Clouds"},"humidity":60,"imperial":{"rain":null,"tempMin":51.278000000000006,"windSpeed":8.064000000000002,"tempMax":70.412}},{"icon":"clear_day","timestamp":1376481600,"hourly":[],"windDeg":327,"pressure":1031.59,"metric":{"tempMin":11.87,"windSpeed":14.832,"tempMax":21.43},"date":"2013-08-14","condition":{"icon":"01d","description":"sky is clear","id":800,"main":"Clear"},"humidity":0,"imperial":{"rain":null,"tempMin":53.366,"windSpeed":9.228800000000001,"tempMax":70.574}},{"icon":"rain_day","timestamp":1376568000,"hourly":[],"windDeg":247,"pressure":1032.73,"metric":{"tempMin":11.77,"windSpeed":15.840000000000002,"tempMax":23.18},"date":"2013-08-15","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":0,"imperial":{"rain":null,"tempMin":53.186,"windSpeed":9.856000000000002,"tempMax":73.724}},{"icon":"clear_day","timestamp":1376654400,"hourly":[],"windDeg":294,"pressure":1031.85,"metric":{"tempMin":15.81,"windSpeed":12.708,"tempMax":24.87},"date":"2013-08-16","condition":{"icon":"01d","description":"sky is clear","id":800,"main":"Clear"},"humidity":0,"imperial":{"rain":null,"tempMin":60.458,"windSpeed":7.9072000000000005,"tempMax":76.766}},{"icon":"rain_day","timestamp":1376740800,"hourly":[],"windDeg":295,"pressure":1029.08,"metric":{"rain":1.02,"tempMin":16.39,"windSpeed":12.024,"tempMax":25.05},"date":"2013-08-17","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":0,"imperial":{"rain":0.040157480314960636,"tempMin":61.502,"windSpeed":7.4816,"tempMax":77.09}}],"format":20130808,"location":{"service_id":2643743,"name":"London","country":"GB","service":"openweathermap"}}""")
707
708-locations_data.append("""{"location":{"coord":{"lon":10,"lat":53.549999},"service_id":2911298,"name":"Hamburg","country":"DE","service":"openweathermap"},"db":{"updated":"2013-08-06T18:35:14.332Z","id":2},"format":20130801,"data":[{"date":"2013-08-06","timestamp":1375738207,"metric":{"tempMin":13.37,"tempMax":20,"windSpeed":18.18},"imperial":{"tempMin":56.066,"tempMax":68,"windSpeed":11.312000000000001,"rain":null},"pressure":1024.52,"humidity":55,"condition":{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"},"windDeg":302,"hourly":[],"current":{"timestamp":1375813203,"date":"2013-08-06 20:20","metric":{"temp":20,"windSpeed":null},"imperial":{"temp":68,"windSpeed":null,"rain":null},"humidity":64,"pressure":1015,"condition":{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"},"service":"openweathermap","service_id":2911298}},{"date":"2013-08-07","timestamp":1375873200,"metric":{"tempMin":11.38,"tempMax":16.98,"windSpeed":13.860000000000001,"rain":22},"imperial":{"tempMin":52.484,"tempMax":62.564,"windSpeed":8.624,"rain":0.8661417322834646},"pressure":1025.03,"humidity":100,"condition":{"id":502,"main":"Rain","description":"heavy intensity rain","icon":"10d"},"windDeg":7,"hourly":[]},{"date":"2013-08-08","timestamp":1375959600,"metric":{"tempMin":13.56,"tempMax":15.36,"windSpeed":15.515999999999998,"rain":13},"imperial":{"tempMin":56.408,"tempMax":59.647999999999996,"windSpeed":9.6544,"rain":0.5118110236220472},"pressure":1026.42,"humidity":100,"condition":{"id":502,"main":"Rain","description":"heavy intensity rain","icon":"10d"},"windDeg":31,"hourly":[]},{"date":"2013-08-09","timestamp":1376046000,"metric":{"tempMin":11.19,"tempMax":20.06,"windSpeed":14.436},"imperial":{"tempMin":52.141999999999996,"tempMax":68.108,"windSpeed":8.9824,"rain":null},"pressure":1030.49,"humidity":91,"condition":{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"},"windDeg":304,"hourly":[]},{"date":"2013-08-10","timestamp":1376132400,"metric":{"tempMin":13.81,"tempMax":21.32,"windSpeed":17.136},"imperial":{"tempMin":56.858000000000004,"tempMax":70.376,"windSpeed":10.6624,"rain":null},"pressure":1030.51,"humidity":80,"condition":{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"},"windDeg":250,"hourly":[]},{"date":"2013-08-11","timestamp":1376218800,"metric":{"tempMin":16.51,"tempMax":23.68,"windSpeed":22.715999999999998,"rain":3},"imperial":{"tempMin":61.718,"tempMax":74.624,"windSpeed":14.134400000000001,"rain":0.11811023622047245},"pressure":1024.9,"humidity":68,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":238,"hourly":[]},{"date":"2013-08-12","timestamp":1376305200,"metric":{"tempMin":14.79,"tempMax":20.61,"windSpeed":10.044,"rain":0.59},"imperial":{"tempMin":58.622,"tempMax":69.098,"windSpeed":6.249600000000001,"rain":0.023228346456692913},"pressure":1028.45,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":275,"hourly":[]},{"date":"2013-08-13","timestamp":1376391600,"metric":{"tempMin":13.23,"tempMax":21.47,"windSpeed":5.184},"imperial":{"tempMin":55.814,"tempMax":70.646,"windSpeed":3.2256,"rain":null},"pressure":1029.35,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":48,"hourly":[]},{"date":"2013-08-14","timestamp":1376478000,"metric":{"tempMin":15.49,"tempMax":22.37,"windSpeed":7.704000000000001,"rain":0.33},"imperial":{"tempMin":59.882000000000005,"tempMax":72.266,"windSpeed":4.7936000000000005,"rain":0.01299212598425197},"pressure":1027.6,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":226,"hourly":[]},{"date":"2013-08-15","timestamp":1376564400,"metric":{"tempMin":15.3,"tempMax":23.26,"windSpeed":26.316},"imperial":{"tempMin":59.540000000000006,"tempMax":73.868,"windSpeed":16.3744,"rain":null},"pressure":1027.33,"humidity":0,"condition":{"id":500,"main":"Rain","description":"light rain","icon":"10d"},"windDeg":253,"hourly":[]}],"save":true}""")
709+locations_data.append("""{"updated":1375990401770,"save":false,"db":{"updated":"2013-08-08T19:33:21.770Z","id":2},"data":[{"icon":"broken_clouds_day","timestamp":1375959600,"hourly":[],"windDeg":293,"pressure":1025.28,"current":{"icon":"scattered_clouds_day","timestamp":1375987800,"pressure":1018,"service_id":2911298,"metric":{"temp":17.5,"windSpeed":null},"date":"2013-08-08 20:50","condition":{"icon":"03d","description":"scattered clouds","id":802,"main":"Clouds"},"humidity":67,"imperial":{"rain":null,"temp":63.5,"windSpeed":null},"service":"openweathermap"},"metric":{"tempMin":13.44,"windSpeed":21.06,"tempMax":16.5},"date":"2013-08-08","condition":{"icon":"04d","description":"broken clouds","id":803,"main":"Clouds"},"humidity":71,"imperial":{"rain":null,"tempMin":56.192,"windSpeed":13.104000000000001,"tempMax":61.7}},{"icon":"few_clouds_day","timestamp":1376046000,"hourly":[],"windDeg":262,"pressure":1028.74,"metric":{"tempMin":13.02,"windSpeed":13.895999999999999,"tempMax":18.91},"date":"2013-08-09","condition":{"icon":"02d","description":"few clouds","id":801,"main":"Clouds"},"humidity":79,"imperial":{"rain":null,"tempMin":55.436,"windSpeed":8.6464,"tempMax":66.03800000000001}},{"icon":"rain_day","timestamp":1376132400,"hourly":[],"windDeg":228,"pressure":1028.09,"metric":{"rain":1,"tempMin":12.4,"windSpeed":14.076,"tempMax":20.13},"date":"2013-08-10","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":80,"imperial":{"rain":0.03937007874015748,"tempMin":54.32,"windSpeed":8.758400000000002,"tempMax":68.23400000000001}},{"icon":"rain_day","timestamp":1376218800,"hourly":[],"windDeg":249,"pressure":1028.28,"metric":{"rain":1,"tempMin":15.2,"windSpeed":12.636,"tempMax":20.18},"date":"2013-08-11","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":87,"imperial":{"rain":0.03937007874015748,"tempMin":59.36,"windSpeed":7.8624,"tempMax":68.324}},{"icon":"broken_clouds_day","timestamp":1376305200,"hourly":[],"windDeg":283,"pressure":1022.93,"metric":{"tempMin":14.51,"windSpeed":29.880000000000003,"tempMax":19.23},"date":"2013-08-12","condition":{"icon":"04d","description":"overcast clouds","id":804,"main":"Clouds"},"humidity":84,"imperial":{"rain":null,"tempMin":58.117999999999995,"windSpeed":18.592000000000002,"tempMax":66.614}},{"icon":"rain_day","timestamp":1376391600,"hourly":[],"windDeg":275,"pressure":1027.51,"metric":{"rain":1,"tempMin":14.66,"windSpeed":24.3,"tempMax":18.18},"date":"2013-08-13","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":79,"imperial":{"rain":0.03937007874015748,"tempMin":58.388000000000005,"windSpeed":15.120000000000001,"tempMax":64.724}},{"icon":"rain_day","timestamp":1376478000,"hourly":[],"windDeg":306,"pressure":1029.36,"metric":{"rain":2.46,"tempMin":13.09,"windSpeed":25.2,"tempMax":17.76},"date":"2013-08-14","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":0,"imperial":{"rain":0.09685039370078741,"tempMin":55.562,"windSpeed":15.680000000000001,"tempMax":63.968}},{"icon":"rain_day","timestamp":1376564400,"hourly":[],"windDeg":275,"pressure":1034.36,"metric":{"rain":3.75,"tempMin":15.32,"windSpeed":15.048,"tempMax":19.03},"date":"2013-08-15","condition":{"icon":"10d","description":"moderate rain","id":501,"main":"Rain"},"humidity":0,"imperial":{"rain":0.14763779527559057,"tempMin":59.576,"windSpeed":9.3632,"tempMax":66.254}},{"icon":"rain_day","timestamp":1376650800,"hourly":[],"windDeg":286,"pressure":1027.6,"metric":{"rain":2.84,"tempMin":15.45,"windSpeed":27.791999999999998,"tempMax":20.46},"date":"2013-08-16","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":0,"imperial":{"rain":0.11181102362204724,"tempMin":59.81,"windSpeed":17.2928,"tempMax":68.828}},{"icon":"rain_day","timestamp":1376737200,"hourly":[],"windDeg":297,"pressure":1028.67,"metric":{"rain":2.18,"tempMin":14.79,"windSpeed":28.836,"tempMax":19.03},"date":"2013-08-17","condition":{"icon":"10d","description":"light rain","id":500,"main":"Rain"},"humidity":0,"imperial":{"rain":0.08582677165354331,"tempMin":58.622,"windSpeed":17.942400000000003,"tempMax":66.254}}],"format":20130808,"location":{"coord":{"lon":10,"lat":53.549999},"service_id":2911298,"name":"Hamburg","country":"DE","service":"openweathermap"}}""")
710
711
712=== modified file 'ubuntu-weather-app.qml'
713--- ubuntu-weather-app.qml 2013-07-20 16:52:37 +0000
714+++ ubuntu-weather-app.qml 2013-08-12 18:18:29 +0000
715@@ -55,6 +55,8 @@
716 }
717 } else {
718 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)
719+ httpFailedDialog.show();
720+ refreshData(true, null);
721 }
722 }
723 }
724@@ -149,4 +151,17 @@
725 height:parent.height
726 }
727
728+ Dialog {
729+ id:httpFailedDialog
730+ objectName: "HTTPFailedDialog"
731+ title: i18n.tr("Something went wrong!")
732+ text: i18n.tr("Please make sure, you are connected to the internet.")
733+ z:10
734+ Button {
735+ text: i18n.tr("OK")
736+ onClicked: PopupUtils.close(httpFailedDialog)
737+ }
738+ }
739+
740+
741 }

Subscribers

People subscribed via source and target branches