Merge lp:~martin-borho/ubuntu-weather-app/reboot-nav-and-snap-scrolling into lp:ubuntu-weather-app
- reboot-nav-and-snap-scrolling
- Merge into reboot
Status: | Merged |
---|---|
Approved by: | Victor Thompson |
Approved revision: | 19 |
Merged at revision: | 11 |
Proposed branch: | lp:~martin-borho/ubuntu-weather-app/reboot-nav-and-snap-scrolling |
Merge into: | lp:ubuntu-weather-app |
Diff against target: |
429 lines (+217/-110) 5 files modified
app/ubuntu-weather-app.qml (+10/-12) app/ui/HomePage.qml (+53/-93) app/ui/LocationPane.qml (+145/-0) app/ui/LocationsPage.qml (+7/-3) po/com.ubuntu.weather.pot (+2/-2) |
To merge this branch: | bzr merge lp:~martin-borho/ubuntu-weather-app/reboot-nav-and-snap-scrolling |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Victor Thompson | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Andrew Hayzen | Approve | ||
Review via email: mp+249772@code.launchpad.net |
Commit message
Implemented horizontal scrolling through loctions and a functional bottom edge.
Description of the change
Implemented horizontal scrolling through locations and a functional bottom edge.
But there are some caveats:
- newly added ListView for horizontal scrolling cannot be used with "snapMode: ListView.
- jumping through the bottom edge to a location does't work reliable all the time. Some things are broken somehow (Qt/SDK?). Log output:
qml: WARNING! Do not put Page/Tabs/PageStack inside another Page because that causes confusion which is the active page that sets the title and actions.
file://
qml: WARNING! Do not put Page/Tabs/PageStack inside another Page because that causes confusion which is the active page that sets the title and actions.
qml: WARNING! Do not put Page/Tabs/PageStack inside another Page because that causes confusion which is the active page that sets the title and actions.
I think it's good to go for the moment, shortcomings above shouldn't stop us from moving forward.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
Andrew Hayzen (ahayzen) wrote : | # |
- newly added ListView for horizontal scrolling cannot be used with "snapMode: ListView.
This sounds strange I'll investigate to see if i can figure out what is going on.
- app won't start on device, claiming "LocationPane is no type". But works on desktop!
The component is probably missing in the cmake and not being included in the .click? or an import is failing somewhere.
- jumping through the bottom edge to a location does't work reliable all the time. Some things are broken somehow (Qt/SDK?). Log output:
Most of those warnings you can safely ignore, but it should be able to work all of the time, i'll double check if there isn't something causing it to break.
1 inline comment:
- I wonder if we can change this to mainPageStack.
- I have some massive OCD over formatting, could you ensure that all of the properties have a space between the : and the value?
- 14. By Martin Borho
-
added current property to settings
Andrew Hayzen (ahayzen) wrote : | # |
Thanks for adding the settings as discussed :)
One further thing, the Rectangle in LocationsPane L24 could probably be a Item as there is no colour set? This will help with performance.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:14
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrew Hayzen (ahayzen) wrote : | # |
I've also found that the currentIndex can get out of sync
1) Start the app with two locations
2) Use the bottom edge to switch to the second location
3) Restart the app, notice that it starts at the first index and not the second
4) Now try and use the bottom edge to switch to the second location, note nothing happens
It appears from the app log that as the location list is reset and loaded the currentIndex is lost.
- 15. By Martin Borho
-
removed highlightMoveDu
ration - 16. By Martin Borho
-
currentIndex gets set from settings.current
- 17. By Martin Borho
-
formatting
- 18. By Martin Borho
-
pushing HomePage.qml directly to pagestack
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:18
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
Andrew Hayzen (ahayzen) wrote : | # |
LGTM, thanks for the extra changes :)
@Victor can you double check there isn't anything else :)
Victor Thompson (vthompson) wrote : | # |
The code looks good, maybe we can do something like the following to workaround the snapMode issue?
=== modified file 'app/ui/
--- app/ui/HomePage.qml 2015-02-15 15:44:33 +0000
+++ app/ui/HomePage.qml 2015-02-15 18:22:31 +0000
@@ -88,6 +88,13 @@
+ // TODO: workaround for not being able to use snapMode property
+ Component.
+ var scaleFactor = units.gridUnit * 10;
+ maximumFlickVel
+ flickDeceleration = flickDeceleration * scaleFactor;
+ }
+
- 19. By Martin Borho
-
added workaround by victor for snapMode bug
Martin Borho (martin-borho) wrote : | # |
@vthompson workaround added!
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:19
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild:
http://
Victor Thompson (vthompson) wrote : | # |
Thanks! lgtm, thanks Martin!
Preview Diff
1 | === modified file 'app/ubuntu-weather-app.qml' | |||
2 | --- app/ubuntu-weather-app.qml 2015-02-10 14:09:17 +0000 | |||
3 | +++ app/ubuntu-weather-app.qml 2015-02-15 19:22:09 +0000 | |||
4 | @@ -45,7 +45,7 @@ | |||
5 | 45 | /* | 45 | /* |
6 | 46 | List of locations and their data, accessible through index | 46 | List of locations and their data, accessible through index |
7 | 47 | */ | 47 | */ |
9 | 48 | property var locationsList: [] | 48 | property var locationsList: [] |
10 | 49 | 49 | ||
11 | 50 | /* | 50 | /* |
12 | 51 | Index of Location before a refresh, to go back after | 51 | Index of Location before a refresh, to go back after |
13 | @@ -81,9 +81,8 @@ | |||
14 | 81 | 81 | ||
15 | 82 | /* Fill the location pages with their data. */ | 82 | /* Fill the location pages with their data. */ |
16 | 83 | function fillPages(locations) { | 83 | function fillPages(locations) { |
17 | 84 | locationsList = [] | ||
18 | 84 | locationsList = locations; | 85 | locationsList = locations; |
19 | 85 | // refactor this when Location are in a ListView! | ||
20 | 86 | homePage.renderData(); | ||
21 | 87 | } | 86 | } |
22 | 88 | 87 | ||
23 | 89 | /* | 88 | /* |
24 | @@ -98,9 +97,9 @@ | |||
25 | 98 | WeatherApi.sendRequest({ | 97 | WeatherApi.sendRequest({ |
26 | 99 | action: "updateData", | 98 | action: "updateData", |
27 | 100 | params: { | 99 | params: { |
31 | 101 | locations:locations, | 100 | locations: locations, |
32 | 102 | force:force_refresh, | 101 | force: force_refresh, |
33 | 103 | service:settings.service, | 102 | service: settings.service, |
34 | 104 | api_key: Key.twcKey, | 103 | api_key: Key.twcKey, |
35 | 105 | interval: settings.refreshInterval | 104 | interval: settings.refreshInterval |
36 | 106 | } | 105 | } |
37 | @@ -112,6 +111,10 @@ | |||
38 | 112 | Settings { | 111 | Settings { |
39 | 113 | id: settings | 112 | id: settings |
40 | 114 | category: "weatherSettings" | 113 | category: "weatherSettings" |
41 | 114 | /* | ||
42 | 115 | Index of the current locationList of locations and their data, accessible through index | ||
43 | 116 | */ | ||
44 | 117 | property int current: 0 | ||
45 | 115 | 118 | ||
46 | 116 | property int refreshInterval: 1800 | 119 | property int refreshInterval: 1800 |
47 | 117 | property string precipUnits | 120 | property string precipUnits |
48 | @@ -142,11 +145,6 @@ | |||
49 | 142 | 145 | ||
50 | 143 | PageStack { | 146 | PageStack { |
51 | 144 | id: mainPageStack | 147 | id: mainPageStack |
58 | 145 | 148 | Component.onCompleted: mainPageStack.push(Qt.resolvedUrl("ui/HomePage.qml")) | |
53 | 146 | HomePage { | ||
54 | 147 | id: homePage | ||
55 | 148 | } | ||
56 | 149 | |||
57 | 150 | Component.onCompleted: mainPageStack.push(homePage) | ||
59 | 151 | } | 149 | } |
60 | 152 | } | 150 | } |
61 | 153 | 151 | ||
62 | === modified file 'app/ui/HomePage.qml' | |||
63 | --- app/ui/HomePage.qml 2015-02-11 04:14:16 +0000 | |||
64 | +++ app/ui/HomePage.qml 2015-02-15 19:22:09 +0000 | |||
65 | @@ -18,7 +18,6 @@ | |||
66 | 18 | 18 | ||
67 | 19 | import QtQuick 2.3 | 19 | import QtQuick 2.3 |
68 | 20 | import Ubuntu.Components 1.1 | 20 | import Ubuntu.Components 1.1 |
69 | 21 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
70 | 22 | import "../components" | 21 | import "../components" |
71 | 23 | 22 | ||
72 | 24 | 23 | ||
73 | @@ -32,16 +31,6 @@ | |||
74 | 32 | tipColor: UbuntuColors.orange | 31 | tipColor: UbuntuColors.orange |
75 | 33 | tipLabelColor: "#FFF" | 32 | tipLabelColor: "#FFF" |
76 | 34 | 33 | ||
77 | 35 | /* | ||
78 | 36 | Data properties | ||
79 | 37 | */ | ||
80 | 38 | property string name | ||
81 | 39 | property string conditionText | ||
82 | 40 | property string currentTemp | ||
83 | 41 | property string todayMaxTemp | ||
84 | 42 | property string todayMinTemp | ||
85 | 43 | property string iconName | ||
86 | 44 | |||
87 | 45 | // TODO map iconnames to source image names | 34 | // TODO map iconnames to source image names |
88 | 46 | property var iconMap: { | 35 | property var iconMap: { |
89 | 47 | "moon": "moon.svg" | 36 | "moon": "moon.svg" |
90 | @@ -57,89 +46,60 @@ | |||
91 | 57 | } | 46 | } |
92 | 58 | 47 | ||
93 | 59 | /* | 48 | /* |
99 | 60 | Extracts values from the location weather data and puts them into the appropriate components | 49 | Flickable to scroll the location vertically. |
100 | 61 | to display them. | 50 | The respective contentHeight gets calculated after the Location is filled with data. |
96 | 62 | |||
97 | 63 | Attention: Data access happens through "weatherApp.locationList[]" by index, since complex | ||
98 | 64 | data in models will lead to type problems. | ||
101 | 65 | */ | 51 | */ |
179 | 66 | function renderData() { | 52 | Flickable { |
180 | 67 | var index = Math.floor(Math.random()*weatherApp.locationsList.length), // TODO get this value from ListView.currentIndex later! | 53 | id: locationFlickable |
181 | 68 | data = weatherApp.locationsList[index], | 54 | width: parent.width |
182 | 69 | current = data.data[0].current, | 55 | height: parent.height |
183 | 70 | forecasts = data.data, | 56 | contentWidth: parent.width |
184 | 71 | forecastsLength = forecasts.length, | 57 | |
185 | 72 | today = forecasts[0]; | 58 | /* |
186 | 73 | 59 | ListView for locations with snap-scrolling horizontally. | |
187 | 74 | var tempUnits = settings.tempScale === "°C" ? "metric" : "imperial" | 60 | */ |
188 | 75 | 61 | ListView { | |
189 | 76 | // set general location data | 62 | id: locationPages |
190 | 77 | name = data.location.name; | 63 | anchors.fill: parent |
191 | 78 | 64 | width: parent.width | |
192 | 79 | // set current temps and condition | 65 | height: childrenRect.height |
193 | 80 | iconName = (current.icon) ? current.icon : "" | 66 | contentWidth: parent.width |
194 | 81 | conditionText = (current.condition.main) ? current.condition.main : current.condition; // difference TWC/OWM | 67 | contentHeight: childrenRect.height |
195 | 82 | todayMaxTemp = (today[tempUnits].tempMax !== undefined) ? Math.round(today[tempUnits].tempMax).toString() + settings.tempScale: ""; | 68 | model: weatherApp.locationsList.length |
196 | 83 | todayMinTemp = Math.round(today[tempUnits].tempMin).toString() + settings.tempScale; | 69 | // TODO with snapMode, currentIndex is not properly set and setting currentIndex fails |
197 | 84 | currentTemp = Math.round(current[tempUnits].temp).toString() + String("°"); | 70 | //snapMode: ListView.SnapOneItem |
198 | 85 | 71 | orientation: ListView.Horizontal | |
199 | 86 | // reset days list | 72 | currentIndex: settings.current |
200 | 87 | mainPageWeekdayListView.model.clear() | 73 | highlightRangeMode: ListView.StrictlyEnforceRange |
201 | 88 | 74 | onCurrentIndexChanged: { | |
202 | 89 | // set daily forecasts | 75 | print("CI: "+currentIndex) |
203 | 90 | if(forecastsLength > 0) { | 76 | if (loaded) { |
204 | 91 | for(var x=1;x<forecastsLength;x++) { | 77 | settings.current = currentIndex |
205 | 92 | // print(JSON.stringify(forecasts[x][units])) | 78 | } |
206 | 93 | var dayData = { | 79 | } |
207 | 94 | day: formatTimestamp(forecasts[x].date, 'dddd'), | 80 | onModelChanged: { |
208 | 95 | low: Math.round(forecasts[x][tempUnits].tempMin).toString() + settings.tempScale, | 81 | currentIndex = settings.current |
209 | 96 | high: (forecasts[x][tempUnits].tempMax !== undefined) ? Math.round(forecasts[x][tempUnits].tempMax).toString() + settings.tempScale : "", | 82 | |
210 | 97 | image: (forecasts[x].icon !== undefined && iconMap[forecasts[x].icon] !== undefined) ? iconMap[forecasts[x].icon] + settings.tempScale : "" | 83 | if (model > 0) { |
211 | 98 | } | 84 | loaded = true |
212 | 99 | mainPageWeekdayListView.model.append(dayData); | 85 | } |
213 | 100 | } | 86 | } |
214 | 101 | } | 87 | delegate: LocationPane {} |
215 | 102 | } | 88 | |
216 | 103 | 89 | property bool loaded: false | |
217 | 104 | ListView { | 90 | // TODO: workaround for not being able to use snapMode property |
218 | 105 | id: mainPageWeekdayListView | 91 | Component.onCompleted: { |
219 | 106 | anchors { | 92 | var scaleFactor = units.gridUnit * 10; |
220 | 107 | fill: parent | 93 | maximumFlickVelocity = maximumFlickVelocity * scaleFactor; |
221 | 108 | margins: units.gu(2) | 94 | flickDeceleration = flickDeceleration * scaleFactor; |
222 | 109 | } | 95 | } |
223 | 110 | 96 | ||
224 | 111 | header: Column { | 97 | Connections { |
225 | 112 | anchors { | 98 | target: settings |
226 | 113 | left: parent.left | 99 | onCurrentChanged: { |
227 | 114 | right: parent.right | 100 | locationPages.currentIndex = settings.current |
228 | 115 | } | 101 | } |
229 | 116 | spacing: units.gu(1) | 102 | } |
153 | 117 | |||
154 | 118 | HeaderRow { | ||
155 | 119 | locationName: locationPage.name | ||
156 | 120 | } | ||
157 | 121 | |||
158 | 122 | HomeGraphic { | ||
159 | 123 | icon: locationPage.iconName | ||
160 | 124 | } | ||
161 | 125 | |||
162 | 126 | HomeTempInfo { | ||
163 | 127 | description: locationPage.conditionText | ||
164 | 128 | high: locationPage.todayMaxTemp | ||
165 | 129 | low: locationPage.todayMinTemp | ||
166 | 130 | now: locationPage.currentTemp | ||
167 | 131 | } | ||
168 | 132 | |||
169 | 133 | ListItem.ThinDivider { | ||
170 | 134 | |||
171 | 135 | } | ||
172 | 136 | } | ||
173 | 137 | model: ListModel {} | ||
174 | 138 | |||
175 | 139 | delegate: DayDelegate { | ||
176 | 140 | day: model.day | ||
177 | 141 | high: model.high | ||
178 | 142 | low: model.low | ||
230 | 143 | } | 103 | } |
231 | 144 | } | 104 | } |
232 | 145 | } | 105 | } |
233 | 146 | 106 | ||
234 | === added file 'app/ui/LocationPane.qml' | |||
235 | --- app/ui/LocationPane.qml 1970-01-01 00:00:00 +0000 | |||
236 | +++ app/ui/LocationPane.qml 2015-02-15 19:22:09 +0000 | |||
237 | @@ -0,0 +1,145 @@ | |||
238 | 1 | /* | ||
239 | 2 | * Copyright (C) 2015 Canonical Ltd | ||
240 | 3 | * | ||
241 | 4 | * This file is part of Ubuntu Weather App | ||
242 | 5 | * | ||
243 | 6 | * Ubuntu Weather App is free software: you can redistribute it and/or modify | ||
244 | 7 | * it under the terms of the GNU General Public License version 3 as | ||
245 | 8 | * published by the Free Software Foundation. | ||
246 | 9 | * | ||
247 | 10 | * Ubuntu Weather App is distributed in the hope that it will be useful, | ||
248 | 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
249 | 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
250 | 13 | * GNU General Public License for more details. | ||
251 | 14 | * | ||
252 | 15 | * You should have received a copy of the GNU General Public License | ||
253 | 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
254 | 17 | */ | ||
255 | 18 | |||
256 | 19 | import QtQuick 2.3 | ||
257 | 20 | import Ubuntu.Components 1.1 | ||
258 | 21 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
259 | 22 | import "../components" | ||
260 | 23 | |||
261 | 24 | Rectangle { | ||
262 | 25 | id: locationItem | ||
263 | 26 | /* | ||
264 | 27 | Data properties | ||
265 | 28 | */ | ||
266 | 29 | property string name | ||
267 | 30 | property string conditionText | ||
268 | 31 | property string currentTemp | ||
269 | 32 | property string todayMaxTemp | ||
270 | 33 | property string todayMinTemp | ||
271 | 34 | property string iconName | ||
272 | 35 | |||
273 | 36 | Component.onCompleted: renderData(index) | ||
274 | 37 | |||
275 | 38 | width: locationPage.width | ||
276 | 39 | height: childrenRect.height | ||
277 | 40 | anchors.fill: parent.fill | ||
278 | 41 | |||
279 | 42 | /* | ||
280 | 43 | Calculates the height of all location data components, to set the Flickable.contentHeight right. | ||
281 | 44 | */ | ||
282 | 45 | function setFlickableContentHeight() { | ||
283 | 46 | var contentHeightGu = (homeTempInfo.height+homeGraphic.height | ||
284 | 47 | +(weekdayColumn.height*mainPageWeekdayListView.model.count))/units.gridUnit; | ||
285 | 48 | locationFlickable.contentHeight = units.gu(contentHeightGu+25); | ||
286 | 49 | } | ||
287 | 50 | |||
288 | 51 | /* | ||
289 | 52 | Extracts values from the location weather data and puts them into the appropriate components | ||
290 | 53 | to display them. | ||
291 | 54 | |||
292 | 55 | Attention: Data access happens through "weatherApp.locationList[]" by index, since complex | ||
293 | 56 | data in models will lead to type problems. | ||
294 | 57 | */ | ||
295 | 58 | function renderData(index) { | ||
296 | 59 | var data = weatherApp.locationsList[index], | ||
297 | 60 | current = data.data[0].current, | ||
298 | 61 | forecasts = data.data, | ||
299 | 62 | forecastsLength = forecasts.length, | ||
300 | 63 | today = forecasts[0]; | ||
301 | 64 | |||
302 | 65 | var tempUnits = settings.tempScale === "°C" ? "metric" : "imperial" | ||
303 | 66 | |||
304 | 67 | // set general location data | ||
305 | 68 | name = data.location.name; | ||
306 | 69 | |||
307 | 70 | // set current temps and condition | ||
308 | 71 | iconName = (current.icon) ? current.icon : "" | ||
309 | 72 | conditionText = (current.condition.main) ? current.condition.main : current.condition; // difference TWC/OWM | ||
310 | 73 | todayMaxTemp = (today[tempUnits].tempMax !== undefined) ? Math.round(today[tempUnits].tempMax).toString() + settings.tempScale: ""; | ||
311 | 74 | todayMinTemp = Math.round(today[tempUnits].tempMin).toString() + settings.tempScale; | ||
312 | 75 | currentTemp = Math.round(current[tempUnits].temp).toString() + String("°"); | ||
313 | 76 | |||
314 | 77 | // reset days list | ||
315 | 78 | mainPageWeekdayListView.model.clear() | ||
316 | 79 | |||
317 | 80 | // set daily forecasts | ||
318 | 81 | if(forecastsLength > 0) { | ||
319 | 82 | for(var x=1;x<forecastsLength;x++) { | ||
320 | 83 | // print(JSON.stringify(forecasts[x][units])) | ||
321 | 84 | var dayData = { | ||
322 | 85 | day: formatTimestamp(forecasts[x].date, 'dddd'), | ||
323 | 86 | low: Math.round(forecasts[x][tempUnits].tempMin).toString() + settings.tempScale, | ||
324 | 87 | high: (forecasts[x][tempUnits].tempMax !== undefined) ? Math.round(forecasts[x][tempUnits].tempMax).toString() + settings.tempScale : "", | ||
325 | 88 | image: (forecasts[x].icon !== undefined && iconMap[forecasts[x].icon] !== undefined) ? iconMap[forecasts[x].icon] + settings.tempScale : "" | ||
326 | 89 | } | ||
327 | 90 | mainPageWeekdayListView.model.append(dayData); | ||
328 | 91 | } | ||
329 | 92 | } | ||
330 | 93 | setFlickableContentHeight(); | ||
331 | 94 | } | ||
332 | 95 | |||
333 | 96 | Column { | ||
334 | 97 | id: locationTop | ||
335 | 98 | anchors { | ||
336 | 99 | left: parent.left | ||
337 | 100 | right: parent.right | ||
338 | 101 | margins: units.gu(2) | ||
339 | 102 | } | ||
340 | 103 | spacing: units.gu(1) | ||
341 | 104 | |||
342 | 105 | HeaderRow { | ||
343 | 106 | id: headerRow | ||
344 | 107 | locationName: locationItem.name | ||
345 | 108 | } | ||
346 | 109 | |||
347 | 110 | HomeGraphic { | ||
348 | 111 | id: homeGraphic | ||
349 | 112 | icon: locationItem.iconName | ||
350 | 113 | } | ||
351 | 114 | |||
352 | 115 | HomeTempInfo { | ||
353 | 116 | id: homeTempInfo | ||
354 | 117 | description: conditionText | ||
355 | 118 | high: locationItem.todayMaxTemp | ||
356 | 119 | low: locationItem.todayMinTemp | ||
357 | 120 | now: locationItem.currentTemp | ||
358 | 121 | } | ||
359 | 122 | |||
360 | 123 | ListItem.ThinDivider {} | ||
361 | 124 | } | ||
362 | 125 | Column { | ||
363 | 126 | id: weekdayColumn | ||
364 | 127 | width: parent.width | ||
365 | 128 | height: childrenRect.height | ||
366 | 129 | anchors { | ||
367 | 130 | top: locationTop.bottom | ||
368 | 131 | left: parent.left | ||
369 | 132 | right: parent.right | ||
370 | 133 | margins: units.gu(2) | ||
371 | 134 | } | ||
372 | 135 | Repeater { | ||
373 | 136 | id: mainPageWeekdayListView | ||
374 | 137 | model: ListModel{} | ||
375 | 138 | DayDelegate { | ||
376 | 139 | day: model.day | ||
377 | 140 | high: model.high | ||
378 | 141 | low: model.low | ||
379 | 142 | } | ||
380 | 143 | } | ||
381 | 144 | } | ||
382 | 145 | } | ||
383 | 0 | 146 | ||
384 | === modified file 'app/ui/LocationsPage.qml' | |||
385 | --- app/ui/LocationsPage.qml 2015-02-08 19:09:07 +0000 | |||
386 | +++ app/ui/LocationsPage.qml 2015-02-15 19:22:09 +0000 | |||
387 | @@ -36,14 +36,18 @@ | |||
388 | 36 | } | 36 | } |
389 | 37 | delegate: ListItem.Standard { | 37 | delegate: ListItem.Standard { |
390 | 38 | text: model.location.name | 38 | text: model.location.name |
391 | 39 | onClicked: { | ||
392 | 40 | settings.current = index; | ||
393 | 41 | pageStack.pop() | ||
394 | 42 | } | ||
395 | 39 | } | 43 | } |
396 | 40 | } | 44 | } |
397 | 41 | 45 | ||
398 | 42 | function populateLocationsModel(locations) { | 46 | function populateLocationsModel(locations) { |
401 | 43 | for (var i=0; i < locations.length; i++) { | 47 | for (var i=0; i < weatherApp.locationsList.length; i++) { |
402 | 44 | locationsModel.append(locations[i]) | 48 | locationsModel.append(weatherApp.locationsList[i]) |
403 | 45 | } | 49 | } |
404 | 46 | } | 50 | } |
405 | 47 | 51 | ||
407 | 48 | Component.onCompleted: storage.getLocations(populateLocationsModel) | 52 | Component.onCompleted: populateLocationsModel() |
408 | 49 | } | 53 | } |
409 | 50 | 54 | ||
410 | === modified file 'po/com.ubuntu.weather.pot' | |||
411 | --- po/com.ubuntu.weather.pot 2015-02-11 04:29:28 +0000 | |||
412 | +++ po/com.ubuntu.weather.pot 2015-02-15 19:22:09 +0000 | |||
413 | @@ -8,7 +8,7 @@ | |||
414 | 8 | msgstr "" | 8 | msgstr "" |
415 | 9 | "Project-Id-Version: ubuntu-weather-app\n" | 9 | "Project-Id-Version: ubuntu-weather-app\n" |
416 | 10 | "Report-Msgid-Bugs-To: \n" | 10 | "Report-Msgid-Bugs-To: \n" |
418 | 11 | "POT-Creation-Date: 2015-02-11 04:15+0000\n" | 11 | "POT-Creation-Date: 2015-02-15 14:57+0100\n" |
419 | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" | 12 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
420 | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" | 13 | "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
421 | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" | 14 | "Language-Team: LANGUAGE <LL@li.org>\n" |
422 | @@ -21,7 +21,7 @@ | |||
423 | 21 | msgid "Today" | 21 | msgid "Today" |
424 | 22 | msgstr "" | 22 | msgstr "" |
425 | 23 | 23 | ||
427 | 24 | #: ../app/ui/HomePage.qml:31 ../app/ui/LocationsPage.qml:28 | 24 | #: ../app/ui/HomePage.qml:30 ../app/ui/LocationsPage.qml:28 |
428 | 25 | msgid "Locations" | 25 | msgid "Locations" |
429 | 26 | msgstr "" | 26 | msgstr "" |
430 | 27 | 27 |
PASSED: Continuous integration, rev:13 91.189. 93.70:8080/ job/ubuntu- weather- app-reboot- ci/26/ 91.189. 93.70:8080/ job/ubuntu- weather- app-reboot- vivid-amd64- ci/26
http://
Executed test runs:
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- weather- app-reboot- ci/26/rebuild
http://