Merge lp:~nik90/ubuntu-weather-app/dev-migrate-new-listitems into lp:ubuntu-weather-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 59
Merged at revision: 56
Proposed branch: lp:~nik90/ubuntu-weather-app/dev-migrate-new-listitems
Merge into: lp:ubuntu-weather-app
Diff against target: 756 lines (+194/-194)
11 files modified
app/components/DayDelegate.qml (+64/-64)
app/components/ForecastDetailsDelegate.qml (+0/-1)
app/components/StandardListItem.qml (+48/-0)
app/components/WeatherListItem.qml (+0/-2)
app/ui/AddLocationPage.qml (+10/-5)
app/ui/LocationPane.qml (+5/-9)
app/ui/SettingsPage.qml (+13/-21)
app/ui/settings/DataProviderPage.qml (+5/-14)
app/ui/settings/RefreshIntervalPage.qml (+5/-14)
app/ui/settings/UnitsPage.qml (+16/-40)
po/com.ubuntu.weather.pot (+28/-24)
To merge this branch: bzr merge lp:~nik90/ubuntu-weather-app/dev-migrate-new-listitems
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+262539@code.launchpad.net

Commit message

Migrates the following pages to the new SDK list items,
- SettingsPage.qml
- DayDelegate.qml
- Individual settings page like DataProviderPage.qml, RefreshIntervalPage.qml and UnitsPage.qml.
- AddLocationsPage.qml

Description of the change

Migrates the following pages to the new SDK list items,
- SettingsPage.qml
- DayDelegate.qml
- Individual settings page like DataProviderPage.qml, RefreshIntervalPage.qml and UnitsPage.qml.
- AddLocationsPage.qml

The LocationsPage itself has not been migrated since it involves also migrating the multiselection and reorder features. I rather do that in a separate MP for easier review.

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)
59. By Nekhelesh Ramananthan

merged lp:ubuntu-weather-app/reboot

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
Victor Thompson (vthompson) wrote :

This looks good. Do you intend on doing the WeatherListItem.qml/ListItemWithActions leading/trailing actions changes in a future MP? I'm not sure what else would need to be done to the ExpandableListItem either. I take it we will need to look into those at a later time as well?

review: Needs Information
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Yeah I intend on focusing on the locations page (ListItemWithActions) in a separate MP to handle all aspects such as multi-select, drag & reorder together in one MP. As for the ExpandableListItem, there is no equivalent of it in the new SDK listitems. That's why I left that as it is.

Revision history for this message
Victor Thompson (vthompson) wrote :

lgtm then!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'app/components/DayDelegate.qml'
--- app/components/DayDelegate.qml 2015-06-18 01:42:03 +0000
+++ app/components/DayDelegate.qml 2015-06-21 20:14:47 +0000
@@ -18,14 +18,13 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.2
21import Ubuntu.Components.ListItems 0.1 as ListItem
2221
23ListItem.Standard {22ListItem {
24 id: dayDelegate23 id: dayDelegate
25 height: collapsedHeight24 height: collapsedHeight
2625
27 property int collapsedHeight: units.gu(8)26 property int collapsedHeight: units.gu(8)
28 property int expandedHeight: collapsedHeight + units.gu(4) + extraInfoColumn.childrenRect.height27 property int expandedHeight: collapsedHeight + units.gu(4) + extraInfoColumn.height
2928
30 property alias day: dayLabel.text29 property alias day: dayLabel.text
31 property alias image: weatherImage.name30 property alias image: weatherImage.name
@@ -40,9 +39,6 @@
40 property alias wind: windForecast.value39 property alias wind: windForecast.value
41 property alias uvIndex: uvIndexForecast.value40 property alias uvIndex: uvIndexForecast.value
4241
43 // Standard divider is not full width so add a ThinDivider to the bottom
44 showDivider: false
45
46 state: "normal"42 state: "normal"
47 states: [43 states: [
48 State {44 State {
@@ -101,65 +97,70 @@
101 locationPages.collapseOtherDelegates(index)97 locationPages.collapseOtherDelegates(index)
102 }98 }
10399
104 ListItem.ThinDivider {100 Item {
105 anchors {101 id: mainInfo
106 bottom: parent.bottom
107 }
108 }
109102
110 Label {103 height: collapsedHeight
111 id: dayLabel
112 anchors {104 anchors {
113 left: parent.left105 left: parent.left
114 right: weatherImage.left
115 rightMargin: units.gu(1)
116 top: parent.top
117 topMargin: (collapsedHeight - dayLabel.height) / 2
118 }
119 elide: Text.ElideRight
120 font.weight: Font.Light
121 fontSize: "medium"
122 }
123
124 Icon {
125 id: weatherImage
126 anchors {
127 horizontalCenter: parent.horizontalCenter
128 verticalCenter: dayLabel.verticalCenter
129 }
130 height: units.gu(3)
131 width: units.gu(3)
132 }
133
134 Label {
135 id: lowLabel
136 anchors {
137 left: weatherImage.right
138 right: highLabel.left
139 rightMargin: units.gu(1)
140 verticalCenter: dayLabel.verticalCenter
141 }
142 elide: Text.ElideRight
143 font.pixelSize: units.gu(2)
144 font.weight: Font.Light
145 fontSize: "medium"
146 height: units.gu(2)
147 horizontalAlignment: Text.AlignRight
148 verticalAlignment: Text.AlignTop // AlignTop appears to align bottom?
149 }
150
151 Label {
152 id: highLabel
153 anchors {
154 bottom: lowLabel.bottom
155 right: parent.right106 right: parent.right
156 }107 margins: units.gu(2)
157 color: UbuntuColors.orange108 }
158 elide: Text.ElideRight109
159 font.pixelSize: units.gu(3)110 Label {
160 font.weight: Font.Normal111 id: dayLabel
161 height: units.gu(3)112 anchors {
162 verticalAlignment: Text.AlignTop // AlignTop appears to align bottom?113 left: parent.left
114 right: weatherImage.left
115 rightMargin: units.gu(1)
116 top: parent.top
117 topMargin: (collapsedHeight - dayLabel.height) / 2
118 }
119 elide: Text.ElideRight
120 font.weight: Font.Light
121 fontSize: "medium"
122 }
123
124 Icon {
125 id: weatherImage
126 anchors {
127 horizontalCenter: parent.horizontalCenter
128 verticalCenter: dayLabel.verticalCenter
129 }
130 height: units.gu(3)
131 width: units.gu(3)
132 }
133
134 Label {
135 id: lowLabel
136 anchors {
137 left: weatherImage.right
138 right: highLabel.left
139 rightMargin: units.gu(1)
140 verticalCenter: dayLabel.verticalCenter
141 }
142 elide: Text.ElideRight
143 font.pixelSize: units.gu(2)
144 font.weight: Font.Light
145 fontSize: "medium"
146 height: units.gu(2)
147 horizontalAlignment: Text.AlignRight
148 verticalAlignment: Text.AlignTop // AlignTop appears to align bottom?
149 }
150
151 Label {
152 id: highLabel
153 anchors {
154 bottom: lowLabel.bottom
155 right: parent.right
156 }
157 color: UbuntuColors.orange
158 elide: Text.ElideRight
159 font.pixelSize: units.gu(3)
160 font.weight: Font.Normal
161 height: units.gu(3)
162 verticalAlignment: Text.AlignTop // AlignTop appears to align bottom?
163 }
163 }164 }
164165
165 Item {166 Item {
@@ -168,13 +169,12 @@
168 bottom: parent.bottom169 bottom: parent.bottom
169 left: parent.left170 left: parent.left
170 right: parent.right171 right: parent.right
171 top: dayLabel.bottom172 top: mainInfo.bottom
172 topMargin: units.gu(2)173 bottomMargin: units.gu(2)
173 }174 }
174 opacity: 0175 opacity: 0
175 visible: opacity !== 0176 visible: opacity !== 0
176177
177
178 Column {178 Column {
179 id: extraInfoColumn179 id: extraInfoColumn
180 anchors {180 anchors {
181181
=== modified file 'app/components/ForecastDetailsDelegate.qml'
--- app/components/ForecastDetailsDelegate.qml 2015-06-18 01:42:03 +0000
+++ app/components/ForecastDetailsDelegate.qml 2015-06-21 20:14:47 +0000
@@ -18,7 +18,6 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.2
21import Ubuntu.Components.ListItems 0.1 as ListItem
2221
23Row {22Row {
24 height: icon.height23 height: icon.height
2524
=== added file 'app/components/StandardListItem.qml'
--- app/components/StandardListItem.qml 1970-01-01 00:00:00 +0000
+++ app/components/StandardListItem.qml 2015-06-21 20:14:47 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd
3 *
4 * This file is part of Ubuntu Weather App
5 *
6 * Ubuntu Weather App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Weather App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import QtQuick 2.4
20import QtQuick.Layouts 1.1
21import Ubuntu.Components 1.2
22
23ListItem {
24 id: listItem
25
26 property alias title: _title.text
27 property alias icon: _icon.name
28 property alias showIcon: _icon.visible
29
30 RowLayout {
31 anchors { left: parent.left; right: parent.right; verticalCenter: parent.verticalCenter; margins: units.gu(2) }
32 height: _icon.height
33 spacing: units.gu(2)
34
35 Label {
36 id: _title
37 anchors.verticalCenter: _icon.verticalCenter
38 elide: Text.ElideRight
39 Layout.fillWidth: true
40 }
41
42 Icon {
43 id: _icon
44 height: units.gu(2); width: height
45 name: "go-next"
46 }
47 }
48}
049
=== modified file 'app/components/WeatherListItem.qml'
--- app/components/WeatherListItem.qml 2015-06-18 01:42:03 +0000
+++ app/components/WeatherListItem.qml 2015-06-21 20:14:47 +0000
@@ -19,8 +19,6 @@
1919
20import QtQuick 2.420import QtQuick 2.4
21import Ubuntu.Components 1.221import Ubuntu.Components 1.2
22import Ubuntu.Components.ListItems 0.1 as ListItem
23
2422
25ListItemWithActions {23ListItemWithActions {
26 id: root24 id: root
2725
=== modified file 'app/ui/AddLocationPage.qml'
--- app/ui/AddLocationPage.qml 2015-06-21 16:05:58 +0000
+++ app/ui/AddLocationPage.qml 2015-06-21 20:14:47 +0000
@@ -18,7 +18,6 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.2
21import Ubuntu.Components.ListItems 1.0 as ListItem
22import Ubuntu.Components.Popups 1.021import Ubuntu.Components.Popups 1.0
23import "../components"22import "../components"
24import "../data/CitiesList.js" as Cities23import "../data/CitiesList.js" as Cities
@@ -186,8 +185,14 @@
186 section.criteria: ViewSection.FirstCharacter185 section.criteria: ViewSection.FirstCharacter
187 section.labelPositioning: ViewSection.InlineLabels186 section.labelPositioning: ViewSection.InlineLabels
188187
189 section.delegate: ListItem.Header {188 section.delegate: ListItem {
190 text: section189 height: headerText.implicitHeight + units.gu(1)
190 Label {
191 id: headerText
192 text: section
193 anchors { left: parent.left; right: parent.right; margins: units.gu(2) }
194 font.weight: Font.DemiBold
195 }
191 }196 }
192197
193 model: ListModel {198 model: ListModel {
@@ -199,8 +204,8 @@
199 onRowsAboutToBeInserted: loading = false204 onRowsAboutToBeInserted: loading = false
200 }205 }
201206
202 delegate: ListItem.Empty {207 delegate: ListItem {
203 showDivider: false208 divider.visible: false
204 Column {209 Column {
205 anchors {210 anchors {
206 left: parent.left211 left: parent.left
207212
=== modified file 'app/ui/LocationPane.qml'
--- app/ui/LocationPane.qml 2015-06-18 01:42:03 +0000
+++ app/ui/LocationPane.qml 2015-06-21 20:14:47 +0000
@@ -162,20 +162,16 @@
162 now: locationItem.currentTemp162 now: locationItem.currentTemp
163 }163 }
164164
165 ListItem.ThinDivider {}165 // TODO: Migrate this to using the new SDK list item when possible.
166 ListItem.ThinDivider { anchors { leftMargin: units.gu(-2); rightMargin: units.gu(-2) } }
166 }167 }
167 Column {168 Column {
168 id: weekdayColumn169 id: weekdayColumn
170
171 anchors.top: locationTop.bottom
172 height: childrenRect.height
169 width: parent.width173 width: parent.width
170 height: childrenRect.height
171174
172 anchors {
173 top: locationTop.bottom
174 left: parent.left
175 leftMargin: units.gu(2)
176 right: parent.right
177 rightMargin: units.gu(2)
178 }
179 Repeater {175 Repeater {
180 id: mainPageWeekdayListView176 id: mainPageWeekdayListView
181 model: ListModel{}177 model: ListModel{}
182178
=== modified file 'app/ui/SettingsPage.qml'
--- app/ui/SettingsPage.qml 2015-06-18 01:42:03 +0000
+++ app/ui/SettingsPage.qml 2015-06-21 20:14:47 +0000
@@ -18,42 +18,34 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.2
21import Ubuntu.Components.ListItems 0.1 as ListItem21import "../components"
2222
23Page {23Page {
24 title: i18n.tr("Settings")24 title: i18n.tr("Settings")
2525
26 Flickable {26 Flickable {
27 anchors {27 clip: true
28 fill: parent28 anchors.fill: parent
29 }29 contentHeight: settingsColumn.height
30 height: parent.height30 height: parent.height
31 contentHeight: settingsColumn.childrenRect.height
3231
33 Column {32 Column {
34 id: settingsColumn33 id: settingsColumn
35 anchors {34
36 fill: parent35 anchors.fill: parent
37 }36
3837 StandardListItem {
39 ListItem.SingleValue {38 title: i18n.tr("Units")
40 progression: true
41 text: i18n.tr("Units")
42
43 onClicked: mainPageStack.push(Qt.resolvedUrl("settings/UnitsPage.qml"))39 onClicked: mainPageStack.push(Qt.resolvedUrl("settings/UnitsPage.qml"))
44 }40 }
4541
46 ListItem.SingleValue {42 StandardListItem {
47 progression: true43 title: i18n.tr("Data Provider")
48 text: i18n.tr("Data Provider")
49
50 onClicked: mainPageStack.push(Qt.resolvedUrl("settings/DataProviderPage.qml"))44 onClicked: mainPageStack.push(Qt.resolvedUrl("settings/DataProviderPage.qml"))
51 }45 }
5246
53 ListItem.SingleValue {47 StandardListItem {
54 progression: true48 title: i18n.tr("Refresh Interval")
55 text: i18n.tr("Refresh Interval")
56
57 onClicked: mainPageStack.push(Qt.resolvedUrl("settings/RefreshIntervalPage.qml"))49 onClicked: mainPageStack.push(Qt.resolvedUrl("settings/RefreshIntervalPage.qml"))
58 }50 }
59 }51 }
6052
=== modified file 'app/ui/settings/DataProviderPage.qml'
--- app/ui/settings/DataProviderPage.qml 2015-06-18 01:42:03 +0000
+++ app/ui/settings/DataProviderPage.qml 2015-06-21 20:14:47 +0000
@@ -18,7 +18,6 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.2
21import Ubuntu.Components.ListItems 0.1 as ListItem
22import "../../components"21import "../../components"
2322
24Page {23Page {
@@ -33,13 +32,15 @@
33 ExpandableListItem {32 ExpandableListItem {
34 id: dataProviderSetting33 id: dataProviderSetting
3534
36 listViewHeight: dataProviderModel.count*units.gu(6) - units.gu(1)35 listViewHeight: dataProviderModel.count*units.gu(7) - units.gu(1)
37 model: dataProviderModel36 model: dataProviderModel
38 text: i18n.tr("Provider")37 text: i18n.tr("Provider")
39 subText: settings.service === "weatherchannel" ? "The Weather Channel" : "OpenWeatherMap"38 subText: settings.service === "weatherchannel" ? "The Weather Channel" : "OpenWeatherMap"
4039
41 delegate: ListItem.Standard {40 delegate: StandardListItem {
42 text: model.text41 title: model.text
42 icon: "ok"
43 showIcon: dataProviderSetting.subText === model.text
43 onClicked: {44 onClicked: {
44 if (model.text === "The Weather Channel") {45 if (model.text === "The Weather Channel") {
45 settings.service = "weatherchannel"46 settings.service = "weatherchannel"
@@ -48,16 +49,6 @@
48 }49 }
49 refreshData(false, true)50 refreshData(false, true)
50 }51 }
51
52 Icon {
53 width: units.gu(2)
54 height: width
55 name: "ok"
56 visible: dataProviderSetting.subText === model.text
57 anchors.right: parent.right
58 anchors.rightMargin: units.gu(2)
59 anchors.verticalCenter: parent.verticalCenter
60 }
61 }52 }
62 }53 }
63}54}
6455
=== modified file 'app/ui/settings/RefreshIntervalPage.qml'
--- app/ui/settings/RefreshIntervalPage.qml 2015-06-18 01:42:03 +0000
+++ app/ui/settings/RefreshIntervalPage.qml 2015-06-21 20:14:47 +0000
@@ -18,7 +18,6 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.2
21import Ubuntu.Components.ListItems 0.1 as ListItem
22import "../../components"21import "../../components"
2322
24Page {23Page {
@@ -38,27 +37,19 @@
38 ExpandableListItem {37 ExpandableListItem {
39 id: dataProviderSetting38 id: dataProviderSetting
4039
41 listViewHeight: refreshModel.count*units.gu(6)40 listViewHeight: refreshModel.count*units.gu(7) - units.gu(1)
42 model: refreshModel41 model: refreshModel
43 text: i18n.tr("Interval")42 text: i18n.tr("Interval")
44 subText: i18n.tr("%1 minute", "%1 minutes", Math.floor(settings.refreshInterval / 60).toString()).arg(Math.floor(settings.refreshInterval / 60).toString())43 subText: i18n.tr("%1 minute", "%1 minutes", Math.floor(settings.refreshInterval / 60).toString()).arg(Math.floor(settings.refreshInterval / 60).toString())
4544
46 delegate: ListItem.Standard {45 delegate: StandardListItem {
47 text: model.text46 title: model.text
47 icon: "ok"
48 showIcon: settings.refreshInterval === model.interval
48 onClicked: {49 onClicked: {
49 settings.refreshInterval = model.interval50 settings.refreshInterval = model.interval
50 refreshData(false, true)51 refreshData(false, true)
51 }52 }
52
53 Icon {
54 width: units.gu(2)
55 height: width
56 name: "ok"
57 visible: settings.refreshInterval === model.interval
58 anchors.right: parent.right
59 anchors.rightMargin: units.gu(2)
60 anchors.verticalCenter: parent.verticalCenter
61 }
62 }53 }
63 }54 }
64}55}
6556
=== modified file 'app/ui/settings/UnitsPage.qml'
--- app/ui/settings/UnitsPage.qml 2015-06-18 01:42:03 +0000
+++ app/ui/settings/UnitsPage.qml 2015-06-21 20:14:47 +0000
@@ -18,7 +18,6 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.220import Ubuntu.Components 1.2
21import Ubuntu.Components.ListItems 0.1 as ListItem
22import "../../components"21import "../../components"
2322
24Page {23Page {
@@ -27,6 +26,7 @@
27 flickable: null26 flickable: null
2827
29 Flickable {28 Flickable {
29 clip: true
30 anchors.fill: parent30 anchors.fill: parent
31 height: parent.height31 height: parent.height
32 contentHeight: unitsColumn.childrenRect.height32 contentHeight: unitsColumn.childrenRect.height
@@ -86,84 +86,60 @@
86 ExpandableListItem {86 ExpandableListItem {
87 id: temperatureSetting87 id: temperatureSetting
8888
89 listViewHeight: temperatureModel.count*units.gu(6) - units.gu(0.5)89 listViewHeight: temperatureModel.count*units.gu(7) - units.gu(1)
90 model: temperatureModel90 model: temperatureModel
91 text: i18n.tr("Temperature")91 text: i18n.tr("Temperature")
92 subText: settings.tempScale === "°C" ? i18n.tr("°C")92 subText: settings.tempScale === "°C" ? i18n.tr("°C")
93 : i18n.tr("°F")93 : i18n.tr("°F")
9494
95 delegate: ListItem.Standard {95 delegate: StandardListItem {
96 text: model.text96 title: model.text
97 icon: "ok"
98 showIcon: settings.tempScale === model.value
97 onClicked: {99 onClicked: {
98 settings.tempScale = model.value100 settings.tempScale = model.value
99 refreshData(true)101 refreshData(true)
100 }102 }
101
102 Icon {
103 width: units.gu(2)
104 height: width
105 name: "ok"
106 visible: settings.tempScale === model.value
107 anchors.right: parent.right
108 anchors.rightMargin: units.gu(2)
109 anchors.verticalCenter: parent.verticalCenter
110 }
111 }103 }
112 }104 }
113105
114 ExpandableListItem {106 ExpandableListItem {
115 id: precipationSetting107 id: precipationSetting
116108
117 listViewHeight: precipationModel.count*units.gu(6) - units.gu(0.5)109 listViewHeight: precipationModel.count*units.gu(7) - units.gu(1)
118 model: precipationModel110 model: precipationModel
119 text: i18n.tr("Precipitation")111 text: i18n.tr("Precipitation")
120 subText: settings.precipUnits === "mm" ? i18n.tr("mm")112 subText: settings.precipUnits === "mm" ? i18n.tr("mm")
121 : i18n.tr("in")113 : i18n.tr("in")
122114
123 delegate: ListItem.Standard {115 delegate: StandardListItem {
124 text: model.text116 title: model.text
117 icon: "ok"
118 showIcon: settings.precipUnits === model.value
125 onClicked: {119 onClicked: {
126 settings.precipUnits = model.value120 settings.precipUnits = model.value
127 refreshData(true)121 refreshData(true)
128 }122 }
129
130 Icon {
131 width: units.gu(2)
132 height: width
133 name: "ok"
134 visible: settings.precipUnits === model.value
135 anchors.right: parent.right
136 anchors.rightMargin: units.gu(2)
137 anchors.verticalCenter: parent.verticalCenter
138 }
139 }123 }
140 }124 }
141125
142 ExpandableListItem {126 ExpandableListItem {
143 id: windSetting127 id: windSetting
144128
145 listViewHeight: windSpeedModel.count*units.gu(6) - units.gu(0.5)129 listViewHeight: windSpeedModel.count*units.gu(7) - units.gu(1)
146 model: windSpeedModel130 model: windSpeedModel
147 text: i18n.tr("Wind Speed")131 text: i18n.tr("Wind Speed")
148 subText: settings.windUnits === "kph" ? i18n.tr("kph")132 subText: settings.windUnits === "kph" ? i18n.tr("kph")
149 : i18n.tr("mph")133 : i18n.tr("mph")
150134
151 delegate: ListItem.Standard {135 delegate: StandardListItem {
152 text: model.text136 title: model.text
137 icon: "ok"
138 showIcon: settings.windUnits === model.value
153 onClicked: {139 onClicked: {
154 settings.windUnits = model.value140 settings.windUnits = model.value
155 refreshData(true)141 refreshData(true)
156 }142 }
157
158 Icon {
159 width: units.gu(2)
160 height: width
161 name: "ok"
162 visible: settings.windUnits === model.value
163 anchors.right: parent.right
164 anchors.rightMargin: units.gu(2)
165 anchors.verticalCenter: parent.verticalCenter
166 }
167 }143 }
168 }144 }
169 }145 }
170146
=== modified file 'po/com.ubuntu.weather.pot'
--- po/com.ubuntu.weather.pot 2015-06-21 16:05:58 +0000
+++ po/com.ubuntu.weather.pot 2015-06-21 20:14:47 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: ubuntu-weather-app\n"9"Project-Id-Version: ubuntu-weather-app\n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2015-06-14 16:44-0500\n"11"POT-Creation-Date: 2015-06-21 20:10+0000\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -66,39 +66,43 @@
66msgid "Cancel selection"66msgid "Cancel selection"
67msgstr ""67msgstr ""
6868
69#: ../app/ubuntu-weather-app.qml:17769#: ../app/ubuntu-weather-app.qml:167
70msgid "Searching for current location..."70msgid "Searching for current location..."
71msgstr ""71msgstr ""
7272
73#: ../app/ui/AddLocationPage.qml:3073#: ../app/ubuntu-weather-app.qml:176
74msgid "Add a manual location"
75msgstr ""
76
77#: ../app/ui/AddLocationPage.qml:29
74msgid "Select a city"78msgid "Select a city"
75msgstr ""79msgstr ""
7680
77#: ../app/ui/AddLocationPage.qml:46 ../app/ui/AddLocationPage.qml:6881#: ../app/ui/AddLocationPage.qml:45 ../app/ui/AddLocationPage.qml:66
78msgid "Back"82msgid "Back"
79msgstr ""83msgstr ""
8084
81#: ../app/ui/AddLocationPage.qml:5385#: ../app/ui/AddLocationPage.qml:51
82msgid "City"86msgid "City"
83msgstr ""87msgstr ""
8488
85#: ../app/ui/AddLocationPage.qml:9589#: ../app/ui/AddLocationPage.qml:93
86msgid "Search city"90msgid "Search city"
87msgstr ""91msgstr ""
8892
89#: ../app/ui/AddLocationPage.qml:27493#: ../app/ui/AddLocationPage.qml:278
90msgid "No city found"94msgid "No city found"
91msgstr ""95msgstr ""
9296
93#: ../app/ui/AddLocationPage.qml:28797#: ../app/ui/AddLocationPage.qml:291
94msgid "Couldn't load weather data, please try later again!"98msgid "Couldn't load weather data, please try later again!"
95msgstr ""99msgstr ""
96100
97#: ../app/ui/AddLocationPage.qml:297101#: ../app/ui/AddLocationPage.qml:301
98msgid "Location already added."102msgid "Location already added."
99msgstr ""103msgstr ""
100104
101#: ../app/ui/AddLocationPage.qml:300105#: ../app/ui/AddLocationPage.qml:304
102msgid "OK"106msgid "OK"
103msgstr ""107msgstr ""
104108
@@ -106,7 +110,7 @@
106msgid "Locations"110msgid "Locations"
107msgstr ""111msgstr ""
108112
109#: ../app/ui/LocationsPage.qml:102113#: ../app/ui/LocationsPage.qml:104
110msgid "Current Location"114msgid "Current Location"
111msgstr ""115msgstr ""
112116
@@ -114,34 +118,34 @@
114msgid "Settings"118msgid "Settings"
115msgstr ""119msgstr ""
116120
117#: ../app/ui/SettingsPage.qml:41 ../app/ui/settings/UnitsPage.qml:25121#: ../app/ui/SettingsPage.qml:38 ../app/ui/settings/UnitsPage.qml:24
118msgid "Units"122msgid "Units"
119msgstr ""123msgstr ""
120124
121#: ../app/ui/SettingsPage.qml:48 ../app/ui/settings/DataProviderPage.qml:25125#: ../app/ui/SettingsPage.qml:43 ../app/ui/settings/DataProviderPage.qml:24
122msgid "Data Provider"126msgid "Data Provider"
123msgstr ""127msgstr ""
124128
125#: ../app/ui/SettingsPage.qml:55 ../app/ui/settings/RefreshIntervalPage.qml:25129#: ../app/ui/SettingsPage.qml:48 ../app/ui/settings/RefreshIntervalPage.qml:24
126msgid "Refresh Interval"130msgid "Refresh Interval"
127msgstr ""131msgstr ""
128132
129#: ../app/ui/settings/DataProviderPage.qml:38133#: ../app/ui/settings/DataProviderPage.qml:37
130msgid "Provider"134msgid "Provider"
131msgstr ""135msgstr ""
132136
137#: ../app/ui/settings/RefreshIntervalPage.qml:30
133#: ../app/ui/settings/RefreshIntervalPage.qml:31138#: ../app/ui/settings/RefreshIntervalPage.qml:31
134#: ../app/ui/settings/RefreshIntervalPage.qml:32139#: ../app/ui/settings/RefreshIntervalPage.qml:32
135#: ../app/ui/settings/RefreshIntervalPage.qml:33140#: ../app/ui/settings/RefreshIntervalPage.qml:33
136#: ../app/ui/settings/RefreshIntervalPage.qml:34141#: ../app/ui/settings/RefreshIntervalPage.qml:43
137#: ../app/ui/settings/RefreshIntervalPage.qml:44
138#, qt-format142#, qt-format
139msgid "%1 minute"143msgid "%1 minute"
140msgid_plural "%1 minutes"144msgid_plural "%1 minutes"
141msgstr[0] ""145msgstr[0] ""
142msgstr[1] ""146msgstr[1] ""
143147
144#: ../app/ui/settings/RefreshIntervalPage.qml:43148#: ../app/ui/settings/RefreshIntervalPage.qml:42
145msgid "Interval"149msgid "Interval"
146msgstr ""150msgstr ""
147151
@@ -162,28 +166,28 @@
162#. TRANSLATORS: The strings are standard measurement units166#. TRANSLATORS: The strings are standard measurement units
163#. of precipitation in millimeters and are shown in the settings page.167#. of precipitation in millimeters and are shown in the settings page.
164#. Only the abbreviated form of millimeters should be used.168#. Only the abbreviated form of millimeters should be used.
165#: ../app/ui/settings/UnitsPage.qml:57 ../app/ui/settings/UnitsPage.qml:120169#: ../app/ui/settings/UnitsPage.qml:57 ../app/ui/settings/UnitsPage.qml:112
166msgid "mm"170msgid "mm"
167msgstr ""171msgstr ""
168172
169#. TRANSLATORS: The strings are standard measurement units173#. TRANSLATORS: The strings are standard measurement units
170#. of precipitation in inches and are shown in the settings page.174#. of precipitation in inches and are shown in the settings page.
171#. Only the abbreviated form of inches should be used.175#. Only the abbreviated form of inches should be used.
172#: ../app/ui/settings/UnitsPage.qml:62 ../app/ui/settings/UnitsPage.qml:121176#: ../app/ui/settings/UnitsPage.qml:62 ../app/ui/settings/UnitsPage.qml:113
173msgid "in"177msgid "in"
174msgstr ""178msgstr ""
175179
176#. TRANSLATORS: The strings are standard measurement units180#. TRANSLATORS: The strings are standard measurement units
177#. of wind speed in kilometers per hour and are shown in the settings page.181#. of wind speed in kilometers per hour and are shown in the settings page.
178#. Only the abbreviated form of kilometers per hour should be used.182#. Only the abbreviated form of kilometers per hour should be used.
179#: ../app/ui/settings/UnitsPage.qml:73 ../app/ui/settings/UnitsPage.qml:148183#: ../app/ui/settings/UnitsPage.qml:73 ../app/ui/settings/UnitsPage.qml:132
180msgid "kph"184msgid "kph"
181msgstr ""185msgstr ""
182186
183#. TRANSLATORS: The strings are standard measurement units187#. TRANSLATORS: The strings are standard measurement units
184#. of wind speed in miles per hour and are shown in the settings page.188#. of wind speed in miles per hour and are shown in the settings page.
185#. Only the abbreviated form of miles per hour should be used.189#. Only the abbreviated form of miles per hour should be used.
186#: ../app/ui/settings/UnitsPage.qml:78 ../app/ui/settings/UnitsPage.qml:149190#: ../app/ui/settings/UnitsPage.qml:78 ../app/ui/settings/UnitsPage.qml:133
187msgid "mph"191msgid "mph"
188msgstr ""192msgstr ""
189193
@@ -191,11 +195,11 @@
191msgid "Temperature"195msgid "Temperature"
192msgstr ""196msgstr ""
193197
194#: ../app/ui/settings/UnitsPage.qml:119198#: ../app/ui/settings/UnitsPage.qml:111
195msgid "Precipitation"199msgid "Precipitation"
196msgstr ""200msgstr ""
197201
198#: ../app/ui/settings/UnitsPage.qml:147202#: ../app/ui/settings/UnitsPage.qml:131
199msgid "Wind Speed"203msgid "Wind Speed"
200msgstr ""204msgstr ""
201205

Subscribers

People subscribed via source and target branches