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

Proposed by Martin Borho
Status: Merged
Approved by: Martin Borho
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) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
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.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
89. By Martin Borho

autopilot: added assertions to detect when network connection is missing

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

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

Revision history for this message
Nicholas Skaggs (nskaggs) :
review: Approve
Revision history for this message
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

autopilot: increased timeouts to 120 secs

Revision history for this message
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
=== modified file 'components/AddLocationSheet.qml'
--- components/AddLocationSheet.qml 2013-08-02 22:35:44 +0000
+++ components/AddLocationSheet.qml 2013-08-12 18:18:29 +0000
@@ -34,26 +34,24 @@
34 id: searchWorker34 id: searchWorker
35 source: "./WeatherApi.js"35 source: "./WeatherApi.js"
36 onMessage: {36 onMessage: {
37 searching.running = false;
37 if(!messageObject.error) {38 if(!messageObject.error) {
38 listView.visible = true39 listView.visible = true
39 messageObject.result.locations.forEach(function(loc) {40 messageObject.result.locations.forEach(function(loc) {
40 citiesModel.append(loc);41 citiesModel.append(loc);
41 noCityError.visible = false42 noCityError.visible = false
42 });43 });
44 if (!citiesModel.count) {
45 noCityError.visible = true
46 noCityError.text = i18n.tr("No location was found for ") + locationString.text
47 }
43 } else {48 } else {
44 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)49 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)
45 }50 httpFailedDialog.show();
46 if (!citiesModel.count) {
47 noCityError.visible = true
48 noCityError.text = i18n.tr("No location was found for ") + locationString.text
49 }51 }
50 }52 }
51 }53 }
5254
53 Component.onCompleted: {
54
55 }
56
57 function clear() {55 function clear() {
58 locationString.text = '';56 locationString.text = '';
59 citiesModel.clear();57 citiesModel.clear();
@@ -81,6 +79,7 @@
81 hasClearButton: true79 hasClearButton: true
82 onAccepted: {80 onAccepted: {
83 citiesModel.clear();81 citiesModel.clear();
82 searching.running = true;
84 searchWorker.sendMessage({83 searchWorker.sendMessage({
85 action: "searchByName",84 action: "searchByName",
86 params: {name:locationString.text, units:"metric"}85 params: {name:locationString.text, units:"metric"}
@@ -116,11 +115,8 @@
116 progression: true;115 progression: true;
117 onClicked: {116 onClicked: {
118 var location = citiesModel.get(index)117 var location = citiesModel.get(index)
119 //locationManager.addLocation(location)
120 //mainView.newLocationAdded(location)
121 locationManagerSheet.addLocation(location)118 locationManagerSheet.addLocation(location)
122 PopupUtils.close(addLocationSheet)119 PopupUtils.close(addLocationSheet)
123 //pageStack.pop()
124 clear()120 clear()
125 }121 }
126 }122 }
@@ -129,6 +125,12 @@
129 align: Qt.AlignTrailing;125 align: Qt.AlignTrailing;
130 }126 }
131 }127 }
128 ActivityIndicator{
129 id:searching
130 objectName: "SearchingSpinner"
131 running: false
132 anchors.centerIn: parent
133 }
132 }134 }
133 }135 }
134 }136 }
135137
=== modified file 'components/LocationTab.qml'
--- components/LocationTab.qml 2013-08-05 18:53:33 +0000
+++ components/LocationTab.qml 2013-08-12 18:18:29 +0000
@@ -81,7 +81,7 @@
81 tempMax: (dailyForecasts[x]["current"] !== undefined) ? dailyForecasts[x][units].tempMax :81 tempMax: (dailyForecasts[x]["current"] !== undefined) ? dailyForecasts[x][units].tempMax :
82 null,82 null,
83 cond: dailyForecasts[x].condition.id,83 cond: dailyForecasts[x].condition.id,
84 condIcon: dailyForecasts[x].condition.icon,84 condIcon: dailyForecasts[x].icon,
85 wind_speed: dailyForecasts[x][units].windSpeed,85 wind_speed: dailyForecasts[x][units].windSpeed,
86 wind_dir: direction,86 wind_dir: direction,
87 humid: dailyForecasts[x].humidity,87 humid: dailyForecasts[x].humidity,
8888
=== modified file 'components/WeatherApi.js'
--- components/WeatherApi.js 2013-08-05 18:53:33 +0000
+++ components/WeatherApi.js 2013-08-12 18:18:29 +0000
@@ -3,7 +3,7 @@
3* Version of the response data format.3* Version of the response data format.
4* Increase this number to force a refresh.4* Increase this number to force a refresh.
5*/5*/
6var RESPONSE_DATA_VERSION = 20130801;6var RESPONSE_DATA_VERSION = 20130808;
77
8/**8/**
9* Helper functions9* Helper functions
@@ -21,12 +21,35 @@
21 return ms*3.6;21 return ms*3.6;
22}22}
2323
24
25
24var OpenWeatherMapApi = (function() {26var OpenWeatherMapApi = (function() {
25 /**27 /**
26 provides neccessary methods for requesting and preparing data from OpenWeatherMap.org28 provides neccessary methods for requesting and preparing data from OpenWeatherMap.org
27 */29 */
28 var _baseUrl = "http://api.openweathermap.org/data/2.5/";30 var _baseUrl = "http://api.openweathermap.org/data/2.5/";
29 //31 //
32 var _icon_map = {
33 "01d": "clear_day",
34 "01n": "clear_night",
35 "02d": "few_clouds_day",
36 "02n": "few_clouds_night",
37 "03d": "scattered_clouds_day",
38 "03n": "scattered_clouds_night",
39 "04d": "broken_clouds_day",
40 "04n": "broken_clouds_night",
41 "09d": "shower_rain_day",
42 "09n": "shower_rain_night",
43 "10d": "rain_day",
44 "10n": "rain_night",
45 "11d": "thunderstorm_day",
46 "11n": "thunderstorm_night",
47 "13d": "snow_day",
48 "13n": "snow_night",
49 "50d": "mist_day",
50 "50n": "mist_night"
51 }
52 //
30 function _buildSearchResult(request, data) {53 function _buildSearchResult(request, data) {
31 var searchResult = { locations: [], request: request };54 var searchResult = { locations: [], request: request };
32 if(data.cod === "200" && data.list) {55 if(data.cod === "200" && data.list) {
@@ -53,6 +76,7 @@
53 humidity: data.main.humidity,76 humidity: data.main.humidity,
54 pressure: data.main.pressure,77 pressure: data.main.pressure,
55 windDeg: data.main.deg,78 windDeg: data.main.deg,
79 icon: _icon_map[data.weather[0].icon],
56 condition: data.weather[0]80 condition: data.weather[0]
57 };81 };
58 if(data.id !== undefined) {82 if(data.id !== undefined) {
@@ -80,6 +104,7 @@
80 },104 },
81 pressure: data.pressure,105 pressure: data.pressure,
82 humidity: data.humidity,106 humidity: data.humidity,
107 icon: _icon_map[data.weather[0].icon],
83 condition: data.weather[0],108 condition: data.weather[0],
84 windDeg: data.deg,109 windDeg: data.deg,
85 hourly: []110 hourly: []
86111
=== modified file 'components/WeatherConditionIconComponent.qml'
--- components/WeatherConditionIconComponent.qml 2013-06-14 15:34:09 +0000
+++ components/WeatherConditionIconComponent.qml 2013-08-12 18:18:29 +0000
@@ -19,9 +19,6 @@
19 property bool __fog: false19 property bool __fog: false
2020
21 onConditionChanged: {21 onConditionChanged: {
22 // hotfix for inaccurate api data
23 // see http://bugs.openweathermap.org/issues/72
24 if(condition === "10") condition ="10d"
25 weatherCondition.state = condition22 weatherCondition.state = condition
26 }23 }
2724
@@ -575,7 +572,7 @@
575572
576 states: [573 states: [
577 State {574 State {
578 name: "01d"575 name: "clear_day"
579 StateChangeScript {576 StateChangeScript {
580 script: {577 script: {
581 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();578 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
@@ -590,7 +587,7 @@
590 }587 }
591 },588 },
592 State {589 State {
593 name: "01n"590 name: "clear_night"
594 StateChangeScript {591 StateChangeScript {
595 script: {592 script: {
596 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();593 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
@@ -605,7 +602,7 @@
605 }602 }
606 },603 },
607 State {604 State {
608 name: "02d"605 name: "few_clouds_day"
609 StateChangeScript {606 StateChangeScript {
610 script: {607 script: {
611 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();608 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
@@ -620,7 +617,7 @@
620 }617 }
621 },618 },
622 State {619 State {
623 name: "02n"620 name: "few_clouds_night"
624 StateChangeScript {621 StateChangeScript {
625 script: {622 script: {
626 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();623 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
@@ -640,195 +637,195 @@
640 }637 }
641 },638 },
642 State {639 State {
643 name: "03d"640 name: "scattered_clouds_day"
644 StateChangeScript {641 StateChangeScript {
645 script: {642 script: {
646 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();643 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
647 if(__fewClouds) anim_fewCloudsOut.start();644 if(__fewClouds) anim_fewCloudsOut.start();
648 if(__rain) anim_rainOut.start();645 if(__rain) anim_rainOut.start();
649 if(__storm) anim_stormOut.start();646 if(__storm) anim_stormOut.start();
650 if(__snow) anim_snowOut.start();647 if(__snow) anim_snowOut.start();
651 if(__broken) anim_brokenCloudsOut.start();648 if(__broken) anim_brokenCloudsOut.start();
652 if(__fog) anim_fogOut.start();649 if(__fog) anim_fogOut.start();
653 if(!__scattered) anim_scatCloudsIn.start();650 if(!__scattered) anim_scatCloudsIn.start();
654 }651 }
655 }652 }
656 },653 },
657 State {654 State {
658 name: "03n"655 name: "scattered_clouds_night"
659 StateChangeScript {656 StateChangeScript {
660 script: {657 script: {
661 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();658 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
662 if(__fewClouds) anim_fewCloudsOut.start();659 if(__fewClouds) anim_fewCloudsOut.start();
663 if(__rain) anim_rainOut.start();660 if(__rain) anim_rainOut.start();
664 if(__storm) anim_stormOut.start();661 if(__storm) anim_stormOut.start();
665 if(__snow) anim_snowOut.start();662 if(__snow) anim_snowOut.start();
666 if(__broken) anim_brokenCloudsOut.start();663 if(__broken) anim_brokenCloudsOut.start();
667 if(__fog) anim_fogOut.start();664 if(__fog) anim_fogOut.start();
668 if(!__scattered) anim_scatCloudsIn.start();665 if(!__scattered) anim_scatCloudsIn.start();
669 }666 }
670 }667 }
671 },668 },
672 State {669 State {
673 name: "04d"670 name: "broken_clouds_day"
674 StateChangeScript {671 StateChangeScript {
675 script: {672 script: {
676 if(__moon) anim_moonOut.start();673 if(__moon) anim_moonOut.start();
677 if(__sun) anim_sunOut.start();674 if(__sun) anim_sunOut.start();
678 if(__fewClouds) anim_fewCloudsOut.start();675 if(__fewClouds) anim_fewCloudsOut.start();
679 if(__scattered) anim_scatCloudsOut.start();676 if(__scattered) anim_scatCloudsOut.start();
680 if(__rain) anim_rainOut.start();677 if(__rain) anim_rainOut.start();
681 if(__storm) anim_stormOut.start();678 if(__storm) anim_stormOut.start();
682 if(__snow) anim_snowOut.start();679 if(__snow) anim_snowOut.start();
683 if(__fog) anim_fogOut.start();680 if(__fog) anim_fogOut.start();
684 if(!__broken) anim_brokenCloudsIn.start();681 if(!__broken) anim_brokenCloudsIn.start();
685 }682 }
686 }683 }
687 },684 },
688 State {685 State {
689 name: "04n"686 name: "broken_clouds_night"
690 StateChangeScript {687 StateChangeScript {
691 script: {688 script: {
692 if(__moon) anim_moonOut.start();689 if(__moon) anim_moonOut.start();
693 if(__sun) anim_sunOut.start();690 if(__sun) anim_sunOut.start();
694 if(__fewClouds) anim_fewCloudsOut.start();691 if(__fewClouds) anim_fewCloudsOut.start();
695 if(__scattered) anim_scatCloudsOut.start();692 if(__scattered) anim_scatCloudsOut.start();
696 if(__rain) anim_rainOut.start();693 if(__rain) anim_rainOut.start();
697 if(__storm) anim_stormOut.start();694 if(__storm) anim_stormOut.start();
698 if(__snow) anim_snowOut.start();695 if(__snow) anim_snowOut.start();
699 if(__fog) anim_fogOut.start();696 if(__fog) anim_fogOut.start();
700 if(!__broken) anim_brokenCloudsIn.start();697 if(!__broken) anim_brokenCloudsIn.start();
701 }698 }
702 }699 }
703 },700 },
704 State {701 State {
705 name: "09d"702 name: "shower_rain_day"
706 StateChangeScript {703 StateChangeScript {
707 script: {704 script: {
708 if(__moon) anim_moonOut.start();705 if(__moon) anim_moonOut.start();
709 if(__sun) anim_sunOut.start();706 if(__sun) anim_sunOut.start();
710 if(__fewClouds) anim_fewCloudsOut.start();707 if(__fewClouds) anim_fewCloudsOut.start();
711 if(__scattered) anim_scatCloudsOut.start();708 if(__scattered) anim_scatCloudsOut.start();
712 if(__storm) anim_stormOut.start();709 if(__storm) anim_stormOut.start();
713 if(__snow) anim_snowOut.start();710 if(__snow) anim_snowOut.start();
714 if(__fog) anim_fogOut.start();711 if(__fog) anim_fogOut.start();
715 if(!__broken) anim_brokenCloudsIn.start();712 if(!__broken) anim_brokenCloudsIn.start();
716 if(!__rain) anim_rainIn.start();713 if(!__rain) anim_rainIn.start();
717 }714 }
718 }715 }
719 },716 },
720 State {717 State {
721 name: "09n"718 name: "shower_rain_night"
722 StateChangeScript {719 StateChangeScript {
723 script: {720 script: {
724 if(__moon) anim_moonOut.start();721 if(__moon) anim_moonOut.start();
725 if(__sun) anim_sunOut.start();722 if(__sun) anim_sunOut.start();
726 if(__fewClouds) anim_fewCloudsOut.start();723 if(__fewClouds) anim_fewCloudsOut.start();
727 if(__scattered) anim_scatCloudsOut.start();724 if(__scattered) anim_scatCloudsOut.start();
728 if(__storm) anim_stormOut.start();725 if(__storm) anim_stormOut.start();
729 if(__snow) anim_snowOut.start();726 if(__snow) anim_snowOut.start();
730 if(__fog) anim_fogOut.start();727 if(__fog) anim_fogOut.start();
731 if(!__broken) anim_brokenCloudsIn.start();728 if(!__broken) anim_brokenCloudsIn.start();
732 if(!__rain) anim_rainIn.start();729 if(!__rain) anim_rainIn.start();
733 }730 }
734 }731 }
735 },732 },
736 State {733 State {
737 name: "10d"734 name: "rain_day"
738 StateChangeScript {735 StateChangeScript {
739 script: {736 script: {
740 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();737 if(__moon) anim_moon2sun.start(); else if(!__sun) anim_sunIn.start();
741 if(__fewClouds) anim_fewCloudsOut.start();738 if(__fewClouds) anim_fewCloudsOut.start();
742 if(__broken) anim_brokenCloudsOut.start();739 if(__broken) anim_brokenCloudsOut.start();
743 if(__storm) anim_stormOut.start();740 if(__storm) anim_stormOut.start();
744 if(__snow) anim_snowOut.start();741 if(__snow) anim_snowOut.start();
745 if(__fog) anim_fogOut.start();742 if(__fog) anim_fogOut.start();
746 if(!__scattered) anim_scatCloudsIn.start();743 if(!__scattered) anim_scatCloudsIn.start();
747 if(!__rain) anim_rainIn.start();744 if(!__rain) anim_rainIn.start();
748 }745 }
749 }746 }
750 },747 },
751 State {748 State {
752 name: "10n"749 name: "rain_night"
753 StateChangeScript {750 StateChangeScript {
754 script: {751 script: {
755 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();752 if(__sun) anim_sun2moon.start(); else if(!__moon) anim_moonIn.start();
756 if(__fewClouds) anim_fewCloudsOut.start();753 if(__fewClouds) anim_fewCloudsOut.start();
757 if(__broken) anim_brokenCloudsOut.start();754 if(__broken) anim_brokenCloudsOut.start();
758 if(__storm) anim_stormOut.start();755 if(__storm) anim_stormOut.start();
759 if(__snow) anim_snowOut.start();756 if(__snow) anim_snowOut.start();
760 if(__fog) anim_fogOut.start();757 if(__fog) anim_fogOut.start();
761 if(!__scattered) anim_scatCloudsIn.start();758 if(!__scattered) anim_scatCloudsIn.start();
762 if(!__rain) anim_rainIn.start();759 if(!__rain) anim_rainIn.start();
763 }760 }
764 }761 }
765 },762 },
766 State {763 State {
767 name: "11d"764 name: "thunderstorm_day"
768 StateChangeScript {765 StateChangeScript {
769 script: {766 script: {
770 if(__moon) anim_moonOut.start();767 if(__moon) anim_moonOut.start();
771 if(__sun) anim_sunOut.start();768 if(__sun) anim_sunOut.start();
772 if(__fewClouds) anim_fewCloudsOut.start();769 if(__fewClouds) anim_fewCloudsOut.start();
773 if(__scattered) anim_scatCloudsOut.start();770 if(__scattered) anim_scatCloudsOut.start();
774 if(__rain) anim_rainOut.start();771 if(__rain) anim_rainOut.start();
775 if(__snow) anim_snowOut.start();772 if(__snow) anim_snowOut.start();
776 if(__fog) anim_fogOut.start();773 if(__fog) anim_fogOut.start();
777 if(!__broken) anim_brokenCloudsIn.start();774 if(!__broken) anim_brokenCloudsIn.start();
778 if(!__storm) anim_stormIn.start();775 if(!__storm) anim_stormIn.start();
779 }776 }
780 }777 }
781 },778 },
782 State {779 State {
783 name: "11n"780 name: "thunderstorm_night"
784 StateChangeScript {781 StateChangeScript {
785 script: {782 script: {
786 if(__moon) anim_moonOut.start();783 if(__moon) anim_moonOut.start();
787 if(__sun) anim_sunOut.start();784 if(__sun) anim_sunOut.start();
788 if(__fewClouds) anim_fewCloudsOut.start();785 if(__fewClouds) anim_fewCloudsOut.start();
789 if(__scattered) anim_scatCloudsOut.start();786 if(__scattered) anim_scatCloudsOut.start();
790 if(__rain) anim_rainOut.start();787 if(__rain) anim_rainOut.start();
791 if(__snow) anim_snowOut.start();788 if(__snow) anim_snowOut.start();
792 if(__fog) anim_fogOut.start();789 if(__fog) anim_fogOut.start();
793 if(!__broken) anim_brokenCloudsIn.start();790 if(!__broken) anim_brokenCloudsIn.start();
794 if(!__storm) anim_stormIn.start();791 if(!__storm) anim_stormIn.start();
795 }792 }
796 }793 }
797 },794 },
798 State {795 State {
799 name: "13d"796 name: "snow_day"
800 StateChangeScript {797 StateChangeScript {
801 script: {798 script: {
802 if(__moon) anim_moonOut.start();799 if(__moon) anim_moonOut.start();
803 if(__sun) anim_sunOut.start();800 if(__sun) anim_sunOut.start();
804 if(__fewClouds) anim_fewCloudsOut.start();801 if(__fewClouds) anim_fewCloudsOut.start();
805 if(__scattered) anim_scatCloudsOut.start();802 if(__scattered) anim_scatCloudsOut.start();
806 if(__rain) anim_rainOut.start();803 if(__rain) anim_rainOut.start();
807 if(__storm) anim_stormOut.start();804 if(__storm) anim_stormOut.start();
808 if(__fog) anim_fogOut.start();805 if(__fog) anim_fogOut.start();
809 if(!__broken) anim_brokenCloudsIn.start();806 if(!__broken) anim_brokenCloudsIn.start();
810 if(!__snow) anim_snowIn.start();807 if(!__snow) anim_snowIn.start();
811 }808 }
812 }809 }
813 },810 },
814 State {811 State {
815 name: "13n"812 name: "snow_night"
816 StateChangeScript {813 StateChangeScript {
817 script: {814 script: {
818 if(__moon) anim_moonOut.start();815 if(__moon) anim_moonOut.start();
819 if(__sun) anim_sunOut.start();816 if(__sun) anim_sunOut.start();
820 if(__fewClouds) anim_fewCloudsOut.start();817 if(__fewClouds) anim_fewCloudsOut.start();
821 if(__scattered) anim_scatCloudsOut.start();818 if(__scattered) anim_scatCloudsOut.start();
822 if(__rain) anim_rainOut.start();819 if(__rain) anim_rainOut.start();
823 if(__storm) anim_stormOut.start();820 if(__storm) anim_stormOut.start();
824 if(__fog) anim_fogOut.start();821 if(__fog) anim_fogOut.start();
825 if(!__broken) anim_brokenCloudsIn.start();822 if(!__broken) anim_brokenCloudsIn.start();
826 if(!__snow) anim_snowIn.start();823 if(!__snow) anim_snowIn.start();
827 }824 }
828 }825 }
829 },826 },
830 State {827 State {
831 name: "50d"828 name: "mist_day"
832 StateChangeScript {829 StateChangeScript {
833 script: {830 script: {
834 if(__moon) anim_moonOut.start();831 if(__moon) anim_moonOut.start();
@@ -844,7 +841,7 @@
844 }841 }
845 },842 },
846 State {843 State {
847 name: "50n"844 name: "mist_night"
848 StateChangeScript {845 StateChangeScript {
849 script: {846 script: {
850 if(__moon) anim_moonOut.start();847 if(__moon) anim_moonOut.start();
851848
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py'
--- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-08-04 11:09:32 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2013-08-12 18:18:29 +0000
@@ -88,11 +88,11 @@
88 """A mixin to to give access to common sheet elements"""88 """A mixin to to give access to common sheet elements"""
89 def _click_sheet_confirm(self):89 def _click_sheet_confirm(self):
90 """Clicks the confirm button"""90 """Clicks the confirm button"""
91 self.pointing_device.click_object(self.main_window.select_many('Button')[1])91 self.pointing_device.click_object(self.main_window.select_many('Button')[2])
9292
93 def _click_sheet_cancel(self):93 def _click_sheet_cancel(self):
94 """Clicks the cancel button"""94 """Clicks the cancel button"""
95 self.pointing_device.click_object(self.main_window.select_many('Button')[0])95 self.pointing_device.click_object(self.main_window.select_many('Button')[1])
9696
97class DatabaseMixin(object):97class DatabaseMixin(object):
9898
9999
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py'
--- tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-08-09 21:01:16 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py 2013-08-12 18:18:29 +0000
@@ -73,8 +73,12 @@
73 self.search_for_city("London")73 self.search_for_city("London")
7474
75 # wait for results and click on the first item75 # wait for results and click on the first item
76 http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog')
77 self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True)))
78 load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
79 self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
76 resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList')80 resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList')
77 self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))81 self.assertThat(resultsList.visible, Eventually(Equals(True)))
78 firstResult = self.main_window.get_object('Standard', 'searchResult0')82 firstResult = self.main_window.get_object('Standard', 'searchResult0')
79 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))83 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))
80 self.pointing_device.move_to_object(firstResult)84 self.pointing_device.move_to_object(firstResult)
@@ -106,8 +110,12 @@
106 searchField = self.search_for_city("London")110 searchField = self.search_for_city("London")
107111
108 # wait for results and click on the first item112 # wait for results and click on the first item
113 http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog')
114 self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True)))
115 load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
116 self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
109 resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList')117 resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList')
110 self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))118 self.assertThat(resultsList.visible, Eventually(Equals(True)))
111 firstResult = self.select_single_retry("Standard", objectName="searchResult0")119 firstResult = self.select_single_retry("Standard", objectName="searchResult0")
112 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))120 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))
113 self.assertThat(firstResult.text, Eventually(Equals("London, GB")))121 self.assertThat(firstResult.text, Eventually(Equals("London, GB")))
@@ -121,7 +129,9 @@
121 self.pointing_device.click_object(searchField)129 self.pointing_device.click_object(searchField)
122 self.keyboard.type("Hamburg")130 self.keyboard.type("Hamburg")
123 self.keyboard.press_and_release('Enter')131 self.keyboard.press_and_release('Enter')
124 self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))132 load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
133 self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
134 self.assertThat(resultsList.visible, Eventually(Equals(True)))
125 firstResult = self.select_single_retry("Standard", objectName="searchResult0")135 firstResult = self.select_single_retry("Standard", objectName="searchResult0")
126 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))136 self.assertThat(lambda: firstResult, Eventually(NotEquals(None)))
127 self.assertThat(firstResult.text, Eventually(Equals("Hamburg, DE")))137 self.assertThat(firstResult.text, Eventually(Equals("Hamburg, DE")))
@@ -141,8 +151,12 @@
141 self.search_for_city("UbuntuCity")151 self.search_for_city("UbuntuCity")
142152
143 # wait for result and look if label is shown153 # wait for result and look if label is shown
154 http_failed = self.main_window.get_object('Dialog', 'HTTPFailedDialog')
155 self.assertThat(lambda: http_failed.visible, Eventually(NotEquals(True)))
156 load_indicator = self.main_window.get_object('ActivityIndicator', 'SearchingSpinner')
157 self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
144 errorLabel = self.main_window.get_object('Label', 'noCityError')158 errorLabel = self.main_window.get_object('Label', 'noCityError')
145 self.assertThat(errorLabel.visible, Eventually(Equals(True), timeout=30))159 self.assertThat(errorLabel.visible, Eventually(Equals(True)))
146160
147161
148class TestLocationManagerWithLocation(WeatherTestCase, DatabaseMixin, SheetMixin):162class TestLocationManagerWithLocation(WeatherTestCase, DatabaseMixin, SheetMixin):
149163
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_mainview.py'
--- tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-08-09 21:01:16 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/test_mainview.py 2013-08-12 18:18:29 +0000
@@ -60,7 +60,7 @@
60 # refresh and wait till loading has finished60 # refresh and wait till loading has finished
61 self.main_window.open_toolbar().click_button("RefreshButton")61 self.main_window.open_toolbar().click_button("RefreshButton")
62 load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner')62 load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner')
63 self.assertThat(load_indicator.running, Eventually(Equals(False)))63 self.assertThat(load_indicator.running, Eventually(Equals(False), timeout=120))
6464
65 # get the data from the refreshed tabs, have to be new65 # get the data from the refreshed tabs, have to be new
66 refreshed_dates = self.main_window.get_objects('Label','DayDateLabel')66 refreshed_dates = self.main_window.get_objects('Label','DayDateLabel')
6767
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_settings.py'
--- tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-08-07 17:27:32 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-08-12 18:18:29 +0000
@@ -39,10 +39,10 @@
39 current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText')39 current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText')
40 if units == "imperial":40 if units == "imperial":
41 self.assertThat(current_temps[0].text, Eventually(Equals(u'70°F')))41 self.assertThat(current_temps[0].text, Eventually(Equals(u'70°F')))
42 self.assertThat(current_temps[2].text, Eventually(Equals(u'72°F')))42 self.assertThat(current_temps[2].text, Eventually(Equals(u'73°F')))
43 else:43 else:
44 self.assertThat(current_temps[0].text, Eventually(Equals(u'21°C')))44 self.assertThat(current_temps[0].text, Eventually(Equals(u'21°C')))
45 self.assertThat(current_temps[2].text, Eventually(Equals(u'22°C')))45 self.assertThat(current_temps[2].text, Eventually(Equals(u'23°C')))
4646
47 def test_switch_scale(self):47 def test_switch_scale(self):
48 """Tests switching the scale in the settings"""48 """Tests switching the scale in the settings"""
4949
=== modified file 'tests/autopilot/ubuntu_weather_app/tests/weatherdata.py'
--- tests/autopilot/ubuntu_weather_app/tests/weatherdata.py 2013-08-06 19:35:53 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/weatherdata.py 2013-08-12 18:18:29 +0000
@@ -6,7 +6,7 @@
6# by the Free Software Foundation.6# by the Free Software Foundation.
7locations_data = []7locations_data = []
88
9locations_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}""")9locations_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"}}""")
1010
11locations_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}""")11locations_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"}}""")
1212
1313
=== modified file 'ubuntu-weather-app.qml'
--- ubuntu-weather-app.qml 2013-07-20 16:52:37 +0000
+++ ubuntu-weather-app.qml 2013-08-12 18:18:29 +0000
@@ -55,6 +55,8 @@
55 }55 }
56 } else {56 } else {
57 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)57 console.log(messageObject.error.msg+" / "+messageObject.error.request.url)
58 httpFailedDialog.show();
59 refreshData(true, null);
58 }60 }
59 }61 }
60 }62 }
@@ -149,4 +151,17 @@
149 height:parent.height151 height:parent.height
150 }152 }
151153
154 Dialog {
155 id:httpFailedDialog
156 objectName: "HTTPFailedDialog"
157 title: i18n.tr("Something went wrong!")
158 text: i18n.tr("Please make sure, you are connected to the internet.")
159 z:10
160 Button {
161 text: i18n.tr("OK")
162 onClicked: PopupUtils.close(httpFailedDialog)
163 }
164 }
165
166
152}167}

Subscribers

People subscribed via source and target branches