Merge lp:~ahayzen/ubuntu-weather-app/reboot-fix-ap-location-detect into lp:ubuntu-weather-app
- reboot-fix-ap-location-detect
- Merge into reboot
Status: | Merged |
---|---|
Approved by: | Victor Thompson |
Approved revision: | 79 |
Merged at revision: | 70 |
Proposed branch: | lp:~ahayzen/ubuntu-weather-app/reboot-fix-ap-location-detect |
Merge into: | lp:ubuntu-weather-app |
Diff against target: |
413 lines (+155/-28) 10 files modified
app/components/CurrentLocation.qml (+18/-5) app/ubuntu-weather-app.qml (+25/-4) app/ui/LocationsPage.qml (+3/-2) app/ui/SettingsPage.qml (+5/-0) app/ui/settings/LocationPage.qml (+36/-0) debian/changelog (+2/-0) po/com.ubuntu.weather.pot (+19/-11) tests/autopilot/ubuntu_weather_app/databases/CMakeLists.txt (+1/-1) tests/autopilot/ubuntu_weather_app/databases/location_added.conf (+3/-0) tests/autopilot/ubuntu_weather_app/tests/__init__.py (+43/-5) |
To merge this branch: | bzr merge lp:~ahayzen/ubuntu-weather-app/reboot-fix-ap-location-detect |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Victor Thompson | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+265908@code.launchpad.net |
Commit message
* Add auto detect location option in the settings
* Set auto detect location to false when running autopilot
Description of the change
* Add auto detect location option in the settings
* Set auto detect location to false when running autopilot
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 71. By Andrew Hayzen
-
* Fixes for PEP8
- 72. By Andrew Hayzen
-
* Add changelog
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:72
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
There's a few things we'll need to fix.
1. Currently you only hide the current location from the LocationsPage. However, the location is still in the horizontal listview.
2. Perhaps because of #1, when you click on a city from the LocationsPage you get the wrong one.
3. If PositionSource is inactive, do we still need to also check the settings.
4. Let's change "Auto detect location" to "Detect current location"
5. I'm on the fence about this one, but would "Privacy" be better labeled as "Location"? I understand why we'd call it "Privacy", but perhaps "Location" would make it seem less likely to be malicious.
6. Do we need to explicitly refresh when we change the autoDetectLocation setting? Won't getting a new location from PositionSource do this for us?
- 73. By Andrew Hayzen
-
* Change to detectCurrentLo
cation and use lazy refresh
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:73
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrew Hayzen (ahayzen) wrote : | # |
1) This is working for me please retest
2) As in response to #1
3) Not sure which case you are referring to?
4) Changed to "Detect current location"
5) Changed to "Location"
6) I've changed it to lazy refresh, but we need to call the refresh to ensure in the true->false case it is removed from the location list
- 74. By Andrew Hayzen
-
* Fix for wrong currentIndex when auto detect location is false and selecting from the LocationsPage
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:74
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
Currently the swipe to remove and the reordering (and delete) of the locations in the LocationsPage seems to have broken with this MP.
- 75. By Andrew Hayzen
-
* Fixes for move and remove when without location
Andrew Hayzen (ahayzen) wrote : | # |
I believe this has been fixed, please test both cases of with/without the auto location :-)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:75
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
When there are no locations and we have location detection off, using the bottom edge is a bit weird. This probably wasn't introduced by your MP, but in the future we should consider disabling the bottom edge hint when we show the button to manually add.
Things to fix:
1. IMO we should make the new setting checkbox toggle when the list item is pressed, rather than requiring the user tap the checkbox. If you have a different opinion let me know.
2. When I try to delete a location using the multiselect I get the following error and the location(s) are not removed:
file://
property 'db' of undefined^
Victor Thompson (vthompson) wrote : | # |
For that last item, I think it only happens if you remove the last location--so it's probably the same offset issue as the others.
- 76. By Andrew Hayzen
-
* Selecting the listitem now flips the control
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:76
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 77. By Andrew Hayzen
-
* Fix for setting not being saved when selecting the listitem portion
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:77
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 78. By Andrew Hayzen
-
* Fix for multiselect breaking
Andrew Hayzen (ahayzen) wrote : | # |
Multiselect delete has been fixed and the checkbox is not flipped when you click *anywhere* in the listitem, please retest :-)
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:78
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 79. By Andrew Hayzen
-
* Change to actually removing the old detected location from the db
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:79
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
lgtm! AP passes locally and on the device.
Preview Diff
1 | === modified file 'app/components/CurrentLocation.qml' | |||
2 | --- app/components/CurrentLocation.qml 2015-06-18 01:42:03 +0000 | |||
3 | +++ app/components/CurrentLocation.qml 2015-07-27 00:58:09 +0000 | |||
4 | @@ -41,7 +41,7 @@ | |||
5 | 41 | } | 41 | } |
6 | 42 | 42 | ||
7 | 43 | function searchResponseHandler(msgObject) { | 43 | function searchResponseHandler(msgObject) { |
9 | 44 | if (!msgObject.error) { | 44 | if (!msgObject.error && settings.detectCurrentLocation) { |
10 | 45 | console.log("Loc to add:", JSON.stringify(msgObject.result.locations[0])) | 45 | console.log("Loc to add:", JSON.stringify(msgObject.result.locations[0])) |
11 | 46 | storage.updateCurrentLocation(msgObject.result.locations[0]) | 46 | storage.updateCurrentLocation(msgObject.result.locations[0]) |
12 | 47 | } | 47 | } |
13 | @@ -51,7 +51,7 @@ | |||
14 | 51 | PositionSource { | 51 | PositionSource { |
15 | 52 | id: currentPosition | 52 | id: currentPosition |
16 | 53 | updateInterval: 1000 | 53 | updateInterval: 1000 |
18 | 54 | active: true | 54 | active: settings.detectCurrentLocation |
19 | 55 | 55 | ||
20 | 56 | onPositionChanged: { | 56 | onPositionChanged: { |
21 | 57 | var coord = currentPosition.position.coordinate | 57 | var coord = currentPosition.position.coordinate |
22 | @@ -75,9 +75,22 @@ | |||
23 | 75 | onCountChanged: { | 75 | onCountChanged: { |
24 | 76 | // Update the currentLocation if one is found and it does not match the stored location | 76 | // Update the currentLocation if one is found and it does not match the stored location |
25 | 77 | if (count > 0 && currentLocation.string !== geocodeModel.get(0).address.city) { | 77 | if (count > 0 && currentLocation.string !== geocodeModel.get(0).address.city) { |
29 | 78 | var loc = geocodeModel.get(0) | 78 | search(); |
30 | 79 | currentLocation.string = loc.address.city | 79 | } |
31 | 80 | searchForLocation(loc.coordinate.latitude, loc.coordinate.longitude) | 80 | } |
32 | 81 | |||
33 | 82 | function search() { | ||
34 | 83 | var loc = geocodeModel.get(0) | ||
35 | 84 | currentLocation.string = loc.address.city | ||
36 | 85 | searchForLocation(loc.coordinate.latitude, loc.coordinate.longitude) | ||
37 | 86 | } | ||
38 | 87 | } | ||
39 | 88 | |||
40 | 89 | Connections { | ||
41 | 90 | target: settings | ||
42 | 91 | onDetectCurrentLocationChanged: { | ||
43 | 92 | if (settings.detectCurrentLocation) { | ||
44 | 93 | geocodeModel.search(); | ||
45 | 81 | } | 94 | } |
46 | 82 | } | 95 | } |
47 | 83 | } | 96 | } |
48 | 84 | 97 | ||
49 | === modified file 'app/ubuntu-weather-app.qml' | |||
50 | --- app/ubuntu-weather-app.qml 2015-07-25 22:06:50 +0000 | |||
51 | +++ app/ubuntu-weather-app.qml 2015-07-27 00:58:09 +0000 | |||
52 | @@ -132,6 +132,7 @@ | |||
53 | 132 | */ | 132 | */ |
54 | 133 | property int current: 0 | 133 | property int current: 0 |
55 | 134 | 134 | ||
56 | 135 | property bool detectCurrentLocation: true | ||
57 | 135 | property int refreshInterval: 1800 | 136 | property int refreshInterval: 1800 |
58 | 136 | property string precipUnits | 137 | property string precipUnits |
59 | 137 | property string service | 138 | property string service |
60 | @@ -142,6 +143,17 @@ | |||
61 | 142 | property bool addedCurrentLocation: false | 143 | property bool addedCurrentLocation: false |
62 | 143 | property bool migrated: false | 144 | property bool migrated: false |
63 | 144 | 145 | ||
64 | 146 | onDetectCurrentLocationChanged: { | ||
65 | 147 | if (!detectCurrentLocation) { | ||
66 | 148 | if (addedCurrentLocation) { | ||
67 | 149 | storage.removeLocation(-1); // indexes are increased by 1 | ||
68 | 150 | addedCurrentLocation = false; | ||
69 | 151 | } | ||
70 | 152 | |||
71 | 153 | refreshData(); | ||
72 | 154 | } | ||
73 | 155 | } | ||
74 | 156 | |||
75 | 145 | Component.onCompleted: { | 157 | Component.onCompleted: { |
76 | 146 | if (units === "") { // No settings so load defaults | 158 | if (units === "") { // No settings so load defaults |
77 | 147 | console.debug("No settings, using defaults") | 159 | console.debug("No settings, using defaults") |
78 | @@ -233,8 +245,10 @@ | |||
79 | 233 | 245 | ||
80 | 234 | function moveLocation(from, to) { | 246 | function moveLocation(from, to) { |
81 | 235 | // Indexes are offset by 1 to account for current location | 247 | // Indexes are offset by 1 to account for current location |
84 | 236 | from += 1 | 248 | if (settings.addedCurrentLocation) { |
85 | 237 | to += 1 | 249 | from += 1 |
86 | 250 | to += 1 | ||
87 | 251 | } | ||
88 | 238 | 252 | ||
89 | 239 | // Update settings to respect new changes | 253 | // Update settings to respect new changes |
90 | 240 | if (from === settings.current) { | 254 | if (from === settings.current) { |
91 | @@ -253,7 +267,10 @@ | |||
92 | 253 | // Remove a location from the list | 267 | // Remove a location from the list |
93 | 254 | function removeLocation(index) { | 268 | function removeLocation(index) { |
94 | 255 | // Indexes are offset by 1 to account for current location | 269 | // Indexes are offset by 1 to account for current location |
96 | 256 | index += 1 | 270 | if (settings.addedCurrentLocation) { |
97 | 271 | index += 1 | ||
98 | 272 | } | ||
99 | 273 | |||
100 | 257 | if (settings.current >= index) { // Update settings to respect new changes | 274 | if (settings.current >= index) { // Update settings to respect new changes |
101 | 258 | settings.current -= settings.current; | 275 | settings.current -= settings.current; |
102 | 259 | } | 276 | } |
103 | @@ -279,7 +296,11 @@ | |||
104 | 279 | var locations = [] | 296 | var locations = [] |
105 | 280 | 297 | ||
106 | 281 | for (i=0; i < indexes.length; i++) { | 298 | for (i=0; i < indexes.length; i++) { |
108 | 282 | locations.push(locationsList[indexes[i] + 1].db.id) | 299 | if (settings.addedCurrentLocation) { |
109 | 300 | locations.push(locationsList[indexes[i] + 1].db.id) | ||
110 | 301 | } else { | ||
111 | 302 | locations.push(locationsList[indexes[i]].db.id) | ||
112 | 303 | } | ||
113 | 283 | } | 304 | } |
114 | 284 | 305 | ||
115 | 285 | storage.clearMultiLocation(locations); | 306 | storage.clearMultiLocation(locations); |
116 | 286 | 307 | ||
117 | === modified file 'app/ui/LocationsPage.qml' | |||
118 | --- app/ui/LocationsPage.qml 2015-06-28 19:04:43 +0000 | |||
119 | +++ app/ui/LocationsPage.qml 2015-07-27 00:58:09 +0000 | |||
120 | @@ -50,7 +50,7 @@ | |||
121 | 50 | removable: true | 50 | removable: true |
122 | 51 | thisPage: locationsPage | 51 | thisPage: locationsPage |
123 | 52 | 52 | ||
125 | 53 | onRemoved: storage.removeMultiLocations(selectedItems.slice()) | 53 | onRemoved: storage.removeMultiLocations(selectedItems.slice()); |
126 | 54 | } | 54 | } |
127 | 55 | ] | 55 | ] |
128 | 56 | 56 | ||
129 | @@ -72,7 +72,7 @@ | |||
130 | 72 | left: parent.left | 72 | left: parent.left |
131 | 73 | right: parent.right | 73 | right: parent.right |
132 | 74 | } | 74 | } |
134 | 75 | height: settings.addedCurrentLocation ? units.gu(8) : units.gu(0) | 75 | height: settings.addedCurrentLocation && settings.detectCurrentLocation ? units.gu(8) : units.gu(0) |
135 | 76 | interactive: false | 76 | interactive: false |
136 | 77 | model: currentLocationModel | 77 | model: currentLocationModel |
137 | 78 | delegate: WeatherListItem { | 78 | delegate: WeatherListItem { |
138 | @@ -160,6 +160,7 @@ | |||
139 | 160 | 160 | ||
140 | 161 | onItemClicked: { | 161 | onItemClicked: { |
141 | 162 | settings.current = index + 1; | 162 | settings.current = index + 1; |
142 | 163 | |||
143 | 163 | pageStack.pop() | 164 | pageStack.pop() |
144 | 164 | } | 165 | } |
145 | 165 | onReorder: { | 166 | onReorder: { |
146 | 166 | 167 | ||
147 | === modified file 'app/ui/SettingsPage.qml' | |||
148 | --- app/ui/SettingsPage.qml 2015-06-28 22:54:14 +0000 | |||
149 | +++ app/ui/SettingsPage.qml 2015-07-27 00:58:09 +0000 | |||
150 | @@ -42,5 +42,10 @@ | |||
151 | 42 | title: i18n.tr("Refresh Interval") | 42 | title: i18n.tr("Refresh Interval") |
152 | 43 | onClicked: mainPageStack.push(Qt.resolvedUrl("settings/RefreshIntervalPage.qml")) | 43 | onClicked: mainPageStack.push(Qt.resolvedUrl("settings/RefreshIntervalPage.qml")) |
153 | 44 | } | 44 | } |
154 | 45 | |||
155 | 46 | StandardListItem { | ||
156 | 47 | title: i18n.tr("Location") | ||
157 | 48 | onClicked: mainPageStack.push(Qt.resolvedUrl("settings/LocationPage.qml")) | ||
158 | 49 | } | ||
159 | 45 | } | 50 | } |
160 | 46 | } | 51 | } |
161 | 47 | 52 | ||
162 | === added file 'app/ui/settings/LocationPage.qml' | |||
163 | --- app/ui/settings/LocationPage.qml 1970-01-01 00:00:00 +0000 | |||
164 | +++ app/ui/settings/LocationPage.qml 2015-07-27 00:58:09 +0000 | |||
165 | @@ -0,0 +1,36 @@ | |||
166 | 1 | /* | ||
167 | 2 | * Copyright (C) 2015 Canonical Ltd | ||
168 | 3 | * | ||
169 | 4 | * This file is part of Ubuntu Weather App | ||
170 | 5 | * | ||
171 | 6 | * Ubuntu Weather App is free software: you can redistribute it and/or modify | ||
172 | 7 | * it under the terms of the GNU General Public License version 3 as | ||
173 | 8 | * published by the Free Software Foundation. | ||
174 | 9 | * | ||
175 | 10 | * Ubuntu Weather App is distributed in the hope that it will be useful, | ||
176 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
177 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
178 | 13 | * GNU General Public License for more details. | ||
179 | 14 | * | ||
180 | 15 | * You should have received a copy of the GNU General Public License | ||
181 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
182 | 17 | */ | ||
183 | 18 | |||
184 | 19 | import QtQuick 2.4 | ||
185 | 20 | import Ubuntu.Components 1.2 | ||
186 | 21 | import Ubuntu.Components.ListItems 1.0 as ListItem | ||
187 | 22 | |||
188 | 23 | Page { | ||
189 | 24 | title: i18n.tr("Location") | ||
190 | 25 | |||
191 | 26 | ListItem.Standard { | ||
192 | 27 | control: CheckBox { | ||
193 | 28 | checked: settings.detectCurrentLocation | ||
194 | 29 | |||
195 | 30 | onCheckedChanged: settings.detectCurrentLocation = checked; | ||
196 | 31 | } | ||
197 | 32 | text: i18n.tr("Detect current location") | ||
198 | 33 | |||
199 | 34 | onClicked: control.checked = !control.checked | ||
200 | 35 | } | ||
201 | 36 | } | ||
202 | 0 | 37 | ||
203 | === modified file 'debian/changelog' | |||
204 | --- debian/changelog 2015-07-25 21:53:40 +0000 | |||
205 | +++ debian/changelog 2015-07-27 00:58:09 +0000 | |||
206 | @@ -10,6 +10,8 @@ | |||
207 | 10 | 10 | ||
208 | 11 | [ Andrew Hayzen ] | 11 | [ Andrew Hayzen ] |
209 | 12 | * Add mocked locations for autopilot and add a test using the data | 12 | * Add mocked locations for autopilot and add a test using the data |
210 | 13 | * Add setting to disable auto detecting location | ||
211 | 14 | * When running under autopilot do not auto detect location | ||
212 | 13 | 15 | ||
213 | 14 | -- Victor Thompson <victor.thompson@gmail.com> Mon, 01 Jun 2015 20:11:23 -0500 | 16 | -- Victor Thompson <victor.thompson@gmail.com> Mon, 01 Jun 2015 20:11:23 -0500 |
214 | 15 | 17 | ||
215 | 16 | 18 | ||
216 | === modified file 'po/com.ubuntu.weather.pot' | |||
217 | --- po/com.ubuntu.weather.pot 2015-07-18 19:08:21 +0000 | |||
218 | +++ po/com.ubuntu.weather.pot 2015-07-27 00:58:09 +0000 | |||
219 | @@ -8,7 +8,7 @@ | |||
220 | 8 | msgstr "" | 8 | msgstr "" |
221 | 9 | "Project-Id-Version: ubuntu-weather-app\n" | 9 | "Project-Id-Version: ubuntu-weather-app\n" |
222 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
224 | 11 | "POT-Creation-Date: 2015-07-18 18:04+0100\n" | 11 | "POT-Creation-Date: 2015-07-27 01:55+0100\n" |
225 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
226 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
227 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
228 | @@ -18,31 +18,31 @@ | |||
229 | 18 | "Content-Transfer-Encoding: 8bit\n" | 18 | "Content-Transfer-Encoding: 8bit\n" |
230 | 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" | 19 | "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" |
231 | 20 | 20 | ||
233 | 21 | #: ../app/components/DayDelegate.qml:193 | 21 | #: ../app/components/DayDelegate.qml:199 |
234 | 22 | msgid "Chance of rain" | 22 | msgid "Chance of rain" |
235 | 23 | msgstr "" | 23 | msgstr "" |
236 | 24 | 24 | ||
238 | 25 | #: ../app/components/DayDelegate.qml:202 | 25 | #: ../app/components/DayDelegate.qml:205 |
239 | 26 | msgid "Winds" | 26 | msgid "Winds" |
240 | 27 | msgstr "" | 27 | msgstr "" |
241 | 28 | 28 | ||
243 | 29 | #: ../app/components/DayDelegate.qml:209 | 29 | #: ../app/components/DayDelegate.qml:212 |
244 | 30 | msgid "UV Index" | 30 | msgid "UV Index" |
245 | 31 | msgstr "" | 31 | msgstr "" |
246 | 32 | 32 | ||
248 | 33 | #: ../app/components/DayDelegate.qml:214 | 33 | #: ../app/components/DayDelegate.qml:217 |
249 | 34 | msgid "Pollen" | 34 | msgid "Pollen" |
250 | 35 | msgstr "" | 35 | msgstr "" |
251 | 36 | 36 | ||
253 | 37 | #: ../app/components/DayDelegate.qml:220 | 37 | #: ../app/components/DayDelegate.qml:223 |
254 | 38 | msgid "Humidity" | 38 | msgid "Humidity" |
255 | 39 | msgstr "" | 39 | msgstr "" |
256 | 40 | 40 | ||
258 | 41 | #: ../app/components/DayDelegate.qml:226 | 41 | #: ../app/components/DayDelegate.qml:229 |
259 | 42 | msgid "Sunrise" | 42 | msgid "Sunrise" |
260 | 43 | msgstr "" | 43 | msgstr "" |
261 | 44 | 44 | ||
263 | 45 | #: ../app/components/DayDelegate.qml:232 | 45 | #: ../app/components/DayDelegate.qml:235 |
264 | 46 | msgid "Sunset" | 46 | msgid "Sunset" |
265 | 47 | msgstr "" | 47 | msgstr "" |
266 | 48 | 48 | ||
267 | @@ -66,11 +66,11 @@ | |||
268 | 66 | msgid "Cancel selection" | 66 | msgid "Cancel selection" |
269 | 67 | msgstr "" | 67 | msgstr "" |
270 | 68 | 68 | ||
272 | 69 | #: ../app/ubuntu-weather-app.qml:168 | 69 | #: ../app/ubuntu-weather-app.qml:184 |
273 | 70 | msgid "Searching for current location..." | 70 | msgid "Searching for current location..." |
274 | 71 | msgstr "" | 71 | msgstr "" |
275 | 72 | 72 | ||
277 | 73 | #: ../app/ubuntu-weather-app.qml:177 | 73 | #: ../app/ubuntu-weather-app.qml:193 |
278 | 74 | msgid "Add a manual location" | 74 | msgid "Add a manual location" |
279 | 75 | msgstr "" | 75 | msgstr "" |
280 | 76 | 76 | ||
281 | @@ -122,7 +122,7 @@ | |||
282 | 122 | msgid "Units" | 122 | msgid "Units" |
283 | 123 | msgstr "" | 123 | msgstr "" |
284 | 124 | 124 | ||
286 | 125 | #: ../app/ui/SettingsPage.qml:37 ../app/ui/settings/DataProviderPage.qml:24 | 125 | #: ../app/ui/SettingsPage.qml:37 ../app/ui/settings/DataProviderPage.qml:25 |
287 | 126 | msgid "Data Provider" | 126 | msgid "Data Provider" |
288 | 127 | msgstr "" | 127 | msgstr "" |
289 | 128 | 128 | ||
290 | @@ -130,10 +130,18 @@ | |||
291 | 130 | msgid "Refresh Interval" | 130 | msgid "Refresh Interval" |
292 | 131 | msgstr "" | 131 | msgstr "" |
293 | 132 | 132 | ||
294 | 133 | #: ../app/ui/SettingsPage.qml:47 ../app/ui/settings/LocationPage.qml:24 | ||
295 | 134 | msgid "Location" | ||
296 | 135 | msgstr "" | ||
297 | 136 | |||
298 | 133 | #: ../app/ui/settings/DataProviderPage.qml:37 | 137 | #: ../app/ui/settings/DataProviderPage.qml:37 |
299 | 134 | msgid "Provider" | 138 | msgid "Provider" |
300 | 135 | msgstr "" | 139 | msgstr "" |
301 | 136 | 140 | ||
302 | 141 | #: ../app/ui/settings/LocationPage.qml:32 | ||
303 | 142 | msgid "Detect current location" | ||
304 | 143 | msgstr "" | ||
305 | 144 | |||
306 | 137 | #: ../app/ui/settings/RefreshIntervalPage.qml:30 | 145 | #: ../app/ui/settings/RefreshIntervalPage.qml:30 |
307 | 138 | #: ../app/ui/settings/RefreshIntervalPage.qml:31 | 146 | #: ../app/ui/settings/RefreshIntervalPage.qml:31 |
308 | 139 | #: ../app/ui/settings/RefreshIntervalPage.qml:32 | 147 | #: ../app/ui/settings/RefreshIntervalPage.qml:32 |
309 | 140 | 148 | ||
310 | === modified file 'tests/autopilot/ubuntu_weather_app/databases/CMakeLists.txt' | |||
311 | --- tests/autopilot/ubuntu_weather_app/databases/CMakeLists.txt 2015-07-25 13:52:18 +0000 | |||
312 | +++ tests/autopilot/ubuntu_weather_app/databases/CMakeLists.txt 2015-07-27 00:58:09 +0000 | |||
313 | @@ -1,6 +1,6 @@ | |||
314 | 1 | # make the database files visible on qtcreator | 1 | # make the database files visible on qtcreator |
315 | 2 | file(GLOB PYTHON_TEST_DATABASE_FILES | 2 | file(GLOB PYTHON_TEST_DATABASE_FILES |
316 | 3 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} | 3 | RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} |
318 | 4 | *.ini) | 4 | *.ini *.conf) |
319 | 5 | 5 | ||
320 | 6 | add_custom_target(ubuntu-weather-app_PYTHONTestDatabaseFiles ALL SOURCES ${PYTHON_TEST_DATABASE_FILES}) | 6 | add_custom_target(ubuntu-weather-app_PYTHONTestDatabaseFiles ALL SOURCES ${PYTHON_TEST_DATABASE_FILES}) |
321 | 7 | 7 | ||
322 | === added file 'tests/autopilot/ubuntu_weather_app/databases/location_added.conf' | |||
323 | --- tests/autopilot/ubuntu_weather_app/databases/location_added.conf 1970-01-01 00:00:00 +0000 | |||
324 | +++ tests/autopilot/ubuntu_weather_app/databases/location_added.conf 2015-07-27 00:58:09 +0000 | |||
325 | @@ -0,0 +1,3 @@ | |||
326 | 1 | [weatherSettings] | ||
327 | 2 | detectCurrentLocation=false | ||
328 | 3 | migrated=true | ||
329 | 0 | 4 | ||
330 | === modified file 'tests/autopilot/ubuntu_weather_app/tests/__init__.py' | |||
331 | --- tests/autopilot/ubuntu_weather_app/tests/__init__.py 2015-07-23 00:50:12 +0000 | |||
332 | +++ tests/autopilot/ubuntu_weather_app/tests/__init__.py 2015-07-27 00:58:09 +0000 | |||
333 | @@ -223,7 +223,7 @@ | |||
334 | 223 | 223 | ||
335 | 224 | return result | 224 | return result |
336 | 225 | 225 | ||
338 | 226 | def load_vars(self): | 226 | def load_database_vars(self): |
339 | 227 | self.app_dir = os.path.join( | 227 | self.app_dir = os.path.join( |
340 | 228 | os.environ.get('HOME'), | 228 | os.environ.get('HOME'), |
341 | 229 | ".local/share/com.ubuntu.weather") | 229 | ".local/share/com.ubuntu.weather") |
342 | @@ -235,30 +235,68 @@ | |||
343 | 235 | os.path.join(os.path.dirname(__file__), '..', 'files')) | 235 | os.path.join(os.path.dirname(__file__), '..', 'files')) |
344 | 236 | 236 | ||
345 | 237 | 237 | ||
347 | 238 | class UbuntuWeatherAppTestCase(BaseTestCaseWithPatchedHome, DatabaseMixin): | 238 | class SettingsMixin(object): |
348 | 239 | |||
349 | 240 | """ | ||
350 | 241 | Helper functions for dealing with the settings file | ||
351 | 242 | """ | ||
352 | 243 | |||
353 | 244 | def create_settings_with_location_added(self): | ||
354 | 245 | logger.debug("Creating settings with location added") | ||
355 | 246 | |||
356 | 247 | if not os.path.exists(self.settings_dir): | ||
357 | 248 | os.makedirs(self.settings_dir) | ||
358 | 249 | |||
359 | 250 | shutil.copyfile(self.settings_location_added, self.settings_filepath) | ||
360 | 251 | |||
361 | 252 | self.assertThat( | ||
362 | 253 | lambda: os.path.exists(self.settings_filepath), | ||
363 | 254 | Eventually(Equals(True))) | ||
364 | 255 | |||
365 | 256 | def load_settings_vars(self): | ||
366 | 257 | self.db_dir = os.path.abspath( | ||
367 | 258 | os.path.join(os.path.dirname(__file__), '..', 'databases')) | ||
368 | 259 | self.settings_dir = os.path.join( | ||
369 | 260 | os.environ.get('HOME'), | ||
370 | 261 | ".config/com.ubuntu.weather") | ||
371 | 262 | self.settings_filepath = os.path.join(self.settings_dir, | ||
372 | 263 | 'com.ubuntu.weather.conf') | ||
373 | 264 | self.settings_location_added = os.path.join(self.db_dir, | ||
374 | 265 | "location_added.conf") | ||
375 | 266 | |||
376 | 267 | |||
377 | 268 | class UbuntuWeatherAppTestCase(BaseTestCaseWithPatchedHome, DatabaseMixin, | ||
378 | 269 | SettingsMixin): | ||
379 | 239 | 270 | ||
380 | 240 | """Base test case that launches the ubuntu-weather-app.""" | 271 | """Base test case that launches the ubuntu-weather-app.""" |
381 | 241 | 272 | ||
382 | 242 | def setUp(self): | 273 | def setUp(self): |
383 | 243 | super(UbuntuWeatherAppTestCase, self).setUp() | 274 | super(UbuntuWeatherAppTestCase, self).setUp() |
384 | 244 | 275 | ||
386 | 245 | self.load_vars() | 276 | self.load_database_vars() |
387 | 246 | self.create_blank_db() | 277 | self.create_blank_db() |
388 | 247 | 278 | ||
389 | 279 | self.load_settings_vars() | ||
390 | 280 | self.create_settings_with_location_added() | ||
391 | 281 | |||
392 | 248 | self.app = UbuntuWeatherApp(self.launcher()) | 282 | self.app = UbuntuWeatherApp(self.launcher()) |
393 | 249 | 283 | ||
394 | 250 | 284 | ||
395 | 251 | class UbuntuWeatherAppTestCaseWithData(BaseTestCaseWithPatchedHome, | 285 | class UbuntuWeatherAppTestCaseWithData(BaseTestCaseWithPatchedHome, |
397 | 252 | DatabaseMixin): | 286 | DatabaseMixin, |
398 | 287 | SettingsMixin): | ||
399 | 253 | 288 | ||
400 | 254 | """Base test case that launches the ubuntu-weather-app with data.""" | 289 | """Base test case that launches the ubuntu-weather-app with data.""" |
401 | 255 | 290 | ||
402 | 256 | def setUp(self): | 291 | def setUp(self): |
403 | 257 | super(UbuntuWeatherAppTestCaseWithData, self).setUp() | 292 | super(UbuntuWeatherAppTestCaseWithData, self).setUp() |
404 | 258 | 293 | ||
406 | 259 | self.load_vars() | 294 | self.load_database_vars() |
407 | 260 | self.create_blank_db() | 295 | self.create_blank_db() |
408 | 261 | 296 | ||
409 | 297 | self.load_settings_vars() | ||
410 | 298 | self.create_settings_with_location_added() | ||
411 | 299 | |||
412 | 262 | logger.debug("Adding fake data to new database") | 300 | logger.debug("Adding fake data to new database") |
413 | 263 | self.add_locations_to_database() | 301 | self.add_locations_to_database() |
414 | 264 | 302 |
FAILED: Continuous integration, rev:70 91.189. 93.70:8080/ job/ubuntu- weather- app-reboot- ci/148/ 91.189. 93.70:8080/ job/ubuntu- weather- app-reboot- utopic- amd64-ci/ 118/console 91.189. 93.70:8080/ job/ubuntu- weather- app-reboot- vivid-amd64- ci/148/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- weather- app-reboot- ci/148/ rebuild
http://