Merge lp:~martin-borho/ubuntu-weather-app/settings-in-a-sheet into lp:ubuntu-weather-app/obsolete.trunk
- settings-in-a-sheet
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | David Planella | ||||
Approved revision: | 61 | ||||
Merged at revision: | 63 | ||||
Proposed branch: | lp:~martin-borho/ubuntu-weather-app/settings-in-a-sheet | ||||
Merge into: | lp:ubuntu-weather-app/obsolete.trunk | ||||
Diff against target: |
378 lines (+182/-115) 5 files modified
components/LocationTab.qml (+20/-2) components/SettingsPage.qml (+0/-80) components/SettingsSheet.qml (+63/-0) tests/autopilot/ubuntu_weather_app/tests/test_settings.py (+77/-28) ubuntu-weather-app.qml (+22/-5) |
||||
To merge this branch: | bzr merge lp:~martin-borho/ubuntu-weather-app/settings-in-a-sheet | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Planella | Approve | ||
Günter Schwann (community) | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Raúl Yeguas | Pending | ||
Review via email: mp+173312@code.launchpad.net |
Commit message
Moved settings dialog into a ComposerSheet.
Description of the change
First steps for solving Bug #1197364
* Settings dialog now moved in a ComposerSheet
* ValueSelector used for switching the temperature units
* updated tests accordingly
* removed SettingsPage, added SettingsSheet component
For resolving Bug #1197364 updated and/or new components are needed from the SDK, see bug report.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
- 60. By Martin Borho
-
added settings icon
- 61. By Martin Borho
-
smaller modification in SettingsSheet
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:61
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Günter Schwann (schwann) wrote : | # |
Looks good, and works fine
David Planella (dpm) wrote : | # |
Thanks Martin, nice work!
Just 3 small things: do you think you could address these?
- Make the text in the buttons
- Use Cancel and Done, as in the original wireframe [1]
- Make Cancel grey and Done Ubuntu orange
Once fixed, feel free to top-approve
[1] https:/
Martin Borho (martin-borho) wrote : | # |
Hi David,
I'm still waiting for an updated Sheet component from the SDK, which should be the same as mentioned here:
https:/
Don't know how far that progressed ..
Cheers
Martin
David Planella (dpm) wrote : | # |
Al 15/07/13 17:51, En/na David Planella ha escrit:
> Review: Needs Fixing
>
> Thanks Martin, nice work!
>
> Just 3 small things: do you think you could address these?
>
> - Make the text in the buttons
Sorry, that was supposed to mean "Make the text in the buttons start
with a capital letter"
Cheers,
David.
> - Use Cancel and Done, as in the original wireframe [1]
> - Make Cancel grey and Done Ubuntu orange
>
> Once fixed, feel free to top-approve
>
> [1] https:/
>
Martin Borho (martin-borho) wrote : | # |
>
> Sorry, that was supposed to mean "Make the text in the buttons start
> with a capital letter"
>
I can't, the buttons are predefined fro the SDK
David Planella (dpm) wrote : | # |
In that case, it looks good to me. The 3 issues mentioned should come from an update of the sheet component on the SDK, then.
David Planella (dpm) wrote : | # |
And really nice work on updating the tests as well!
Preview Diff
1 | === modified file 'components/LocationTab.qml' | |||
2 | --- components/LocationTab.qml 2013-07-10 13:46:10 +0000 | |||
3 | +++ components/LocationTab.qml 2013-07-11 18:53:25 +0000 | |||
4 | @@ -1,3 +1,21 @@ | |||
5 | 1 | /* | ||
6 | 2 | * Copyright (C) 2013 Canonical Ltd | ||
7 | 3 | * | ||
8 | 4 | * This program is free software: you can redistribute it and/or modify | ||
9 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
10 | 6 | * published by the Free Software Foundation. | ||
11 | 7 | * | ||
12 | 8 | * This program is distributed in the hope that it will be useful, | ||
13 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | 11 | * GNU General Public License for more details. | ||
16 | 12 | * | ||
17 | 13 | * You should have received a copy of the GNU General Public License | ||
18 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | 15 | * | ||
20 | 16 | * Authored by: Raúl Yeguas <neokore@gmail.com> | ||
21 | 17 | * Martin Borho <martin@borho.net> | ||
22 | 18 | */ | ||
23 | 1 | import QtQuick 2.0 | 19 | import QtQuick 2.0 |
24 | 2 | import Ubuntu.Components.Popups 0.1 | 20 | import Ubuntu.Components.Popups 0.1 |
25 | 3 | import Ubuntu.Components 0.1 | 21 | import Ubuntu.Components 0.1 |
26 | @@ -87,11 +105,11 @@ | |||
27 | 87 | objectName: "SettingsButton" | 105 | objectName: "SettingsButton" |
28 | 88 | action:Action { | 106 | action:Action { |
29 | 89 | id: configAction | 107 | id: configAction |
31 | 90 | iconSource: Qt.resolvedUrl("../resources/images/refresh_icon.png") | 108 | iconSource: Qt.resolvedUrl("../resources/images/settings.png") |
32 | 91 | text: i18n.tr("Settings") | 109 | text: i18n.tr("Settings") |
33 | 92 | 110 | ||
34 | 93 | onTriggered: { | 111 | onTriggered: { |
36 | 94 | mainView.showSettingsPage(); | 112 | mainView.showSettings(); |
37 | 95 | } | 113 | } |
38 | 96 | } | 114 | } |
39 | 97 | } | 115 | } |
40 | 98 | 116 | ||
41 | === removed file 'components/SettingsPage.qml' | |||
42 | --- components/SettingsPage.qml 2013-07-03 19:39:29 +0000 | |||
43 | +++ components/SettingsPage.qml 1970-01-01 00:00:00 +0000 | |||
44 | @@ -1,80 +0,0 @@ | |||
45 | 1 | import QtQuick 2.0 | ||
46 | 2 | import Ubuntu.Components 0.1 | ||
47 | 3 | import Ubuntu.Components.Popups 0.1 | ||
48 | 4 | |||
49 | 5 | // Page for settings (units by now) | ||
50 | 6 | Page { | ||
51 | 7 | id: settingsPage | ||
52 | 8 | objectName: "SettingsPage" | ||
53 | 9 | title: i18n.tr("Settings") | ||
54 | 10 | visible:false | ||
55 | 11 | |||
56 | 12 | property bool settingsChanged: false | ||
57 | 13 | |||
58 | 14 | tools: ToolbarItems { | ||
59 | 15 | locked: true | ||
60 | 16 | opened: true | ||
61 | 17 | back: ToolbarButton { | ||
62 | 18 | objectName: "BackButton" | ||
63 | 19 | text: i18n.tr("Back") | ||
64 | 20 | iconSource: Qt.resolvedUrl("../resources/images/back@18.png") | ||
65 | 21 | onTriggered: { | ||
66 | 22 | if(settingsChanged) { | ||
67 | 23 | if(imperialSwitch.checked){ | ||
68 | 24 | storage.saveSetting("units","imperial"); | ||
69 | 25 | }else{ | ||
70 | 26 | storage.saveSetting("units","metric"); | ||
71 | 27 | } | ||
72 | 28 | storage.getSettings(function(storedSettings) { | ||
73 | 29 | for(var settingName in storedSettings) { | ||
74 | 30 | settings[settingName] = storedSettings[settingName]; | ||
75 | 31 | } | ||
76 | 32 | refreshData(true); | ||
77 | 33 | }); | ||
78 | 34 | settingsChanged = false; | ||
79 | 35 | } | ||
80 | 36 | if(pageStack.depth === 2) pageStack.pop() | ||
81 | 37 | } | ||
82 | 38 | } | ||
83 | 39 | } | ||
84 | 40 | |||
85 | 41 | Rectangle { | ||
86 | 42 | anchors { | ||
87 | 43 | right: parent.right | ||
88 | 44 | rightMargin: units.gu(1) | ||
89 | 45 | left: parent.left | ||
90 | 46 | leftMargin: units.gu(1) | ||
91 | 47 | top: parent.top | ||
92 | 48 | topMargin: units.gu(3) | ||
93 | 49 | } | ||
94 | 50 | Label { | ||
95 | 51 | id: imperialString | ||
96 | 52 | width: units.gu(21) | ||
97 | 53 | anchors { | ||
98 | 54 | verticalCenter: parent.verticalCenter | ||
99 | 55 | left: parent.left | ||
100 | 56 | } | ||
101 | 57 | |||
102 | 58 | text: i18n.tr("Use imperial units") | ||
103 | 59 | } | ||
104 | 60 | Switch { | ||
105 | 61 | id: imperialSwitch | ||
106 | 62 | objectName: "ImperialSwitch" | ||
107 | 63 | anchors { | ||
108 | 64 | verticalCenter: parent.verticalCenter | ||
109 | 65 | right: parent.right | ||
110 | 66 | } | ||
111 | 67 | Component.onCompleted: { | ||
112 | 68 | storage.getSettings(function(storedSettings) { | ||
113 | 69 | if (storedSettings['units'] === 'imperial') | ||
114 | 70 | imperialSwitch.checked = true; | ||
115 | 71 | else | ||
116 | 72 | imperialSwitch.checked = false; | ||
117 | 73 | }); | ||
118 | 74 | } | ||
119 | 75 | onCheckedChanged: { | ||
120 | 76 | settingsChanged = true; | ||
121 | 77 | } | ||
122 | 78 | } | ||
123 | 79 | } | ||
124 | 80 | } | ||
125 | 81 | 0 | ||
126 | === added file 'components/SettingsSheet.qml' | |||
127 | --- components/SettingsSheet.qml 1970-01-01 00:00:00 +0000 | |||
128 | +++ components/SettingsSheet.qml 2013-07-11 18:53:25 +0000 | |||
129 | @@ -0,0 +1,63 @@ | |||
130 | 1 | /* | ||
131 | 2 | * Copyright (C) 2013 Canonical Ltd | ||
132 | 3 | * | ||
133 | 4 | * This program is free software: you can redistribute it and/or modify | ||
134 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
135 | 6 | * published by the Free Software Foundation. | ||
136 | 7 | * | ||
137 | 8 | * This program is distributed in the hope that it will be useful, | ||
138 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
139 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
140 | 11 | * GNU General Public License for more details. | ||
141 | 12 | * | ||
142 | 13 | * You should have received a copy of the GNU General Public License | ||
143 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
144 | 15 | * | ||
145 | 16 | * Authored by: Raúl Yeguas <neokore@gmail.com> | ||
146 | 17 | * Martin Borho <martin@borho.net> | ||
147 | 18 | */ | ||
148 | 19 | import QtQuick 2.0 | ||
149 | 20 | import Ubuntu.Components 0.1 | ||
150 | 21 | import Ubuntu.Components.Popups 0.1 | ||
151 | 22 | import Ubuntu.Components.ListItems 0.1 as ListItem | ||
152 | 23 | |||
153 | 24 | Component { | ||
154 | 25 | |||
155 | 26 | ComposerSheet { | ||
156 | 27 | id: sheet | ||
157 | 28 | objectName: "SettingsSheet" | ||
158 | 29 | title: i18n.tr("Settings") | ||
159 | 30 | contentsHeight: parent.height | ||
160 | 31 | |||
161 | 32 | container: ListItem.ValueSelector { | ||
162 | 33 | id: unitsSelector | ||
163 | 34 | objectName: "UnitsSelector" | ||
164 | 35 | text: i18n.tr("Temperature unit") | ||
165 | 36 | values: [i18n.tr("°C"), i18n.tr("°F")] | ||
166 | 37 | selectedIndex: (settings["units"] === "imperial") ? 1 : 0; | ||
167 | 38 | } | ||
168 | 39 | |||
169 | 40 | onConfirmClicked: { | ||
170 | 41 | var refresh = false, | ||
171 | 42 | selectedUnit = (unitsSelector.selectedIndex === 0) ? "metric" : "imperial"; | ||
172 | 43 | // check if temperaure scale was changed | ||
173 | 44 | if(settings["units"] !== selectedUnit) { | ||
174 | 45 | storage.saveSetting("units", selectedUnit); | ||
175 | 46 | refresh = true; | ||
176 | 47 | } | ||
177 | 48 | // handling of other settings here | ||
178 | 49 | // .... | ||
179 | 50 | |||
180 | 51 | // a setting was changed, reload settings and refresh the location tabs | ||
181 | 52 | if(refresh === true) { | ||
182 | 53 | storage.getSettings(function(storedSettings) { | ||
183 | 54 | for(var settingName in storedSettings) { | ||
184 | 55 | settings[settingName] = storedSettings[settingName]; | ||
185 | 56 | } | ||
186 | 57 | refreshData(true); | ||
187 | 58 | }); | ||
188 | 59 | } | ||
189 | 60 | PopupUtils.close(sheet) | ||
190 | 61 | } | ||
191 | 62 | } | ||
192 | 63 | } | ||
193 | 0 | 64 | ||
194 | === added file 'resources/images/settings.png' | |||
195 | 1 | Binary files resources/images/settings.png 1970-01-01 00:00:00 +0000 and resources/images/settings.png 2013-07-11 18:53:25 +0000 differ | 65 | Binary files resources/images/settings.png 1970-01-01 00:00:00 +0000 and resources/images/settings.png 2013-07-11 18:53:25 +0000 differ |
196 | === modified file 'tests/autopilot/ubuntu_weather_app/tests/test_settings.py' | |||
197 | --- tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-07-03 19:41:03 +0000 | |||
198 | +++ tests/autopilot/ubuntu_weather_app/tests/test_settings.py 2013-07-11 18:53:25 +0000 | |||
199 | @@ -24,47 +24,96 @@ | |||
200 | 24 | self.assertThat( | 24 | self.assertThat( |
201 | 25 | self.main_window.get_qml_view().visible, Eventually(Equals(True))) | 25 | self.main_window.get_qml_view().visible, Eventually(Equals(True))) |
202 | 26 | 26 | ||
205 | 27 | def _open_settings_page(self): | 27 | def _open_settings_sheet(self): |
206 | 28 | """Opens the settings page""" | 28 | """Opens the settings sheet""" |
207 | 29 | self.main_window.open_toolbar() | 29 | self.main_window.open_toolbar() |
208 | 30 | self.assertThat(self.main_window.get_toolbar().opened, Eventually(Equals(True))) | 30 | self.assertThat(self.main_window.get_toolbar().opened, Eventually(Equals(True))) |
209 | 31 | self.main_window.click_toolbar_button("SettingsButton") | 31 | self.main_window.click_toolbar_button("SettingsButton") |
210 | 32 | 32 | ||
211 | 33 | def _move_pointer_around(self): | ||
212 | 34 | """Helper method to move the pointer around, to assure selector is opened""" | ||
213 | 35 | sheet = self.main_window.get_object('ComposerSheet', 'SettingsSheet') | ||
214 | 36 | self.pointing_device.move_to_object(sheet) | ||
215 | 37 | |||
216 | 38 | def _click_confirm(self): | ||
217 | 39 | """Clicks the confirm button""" | ||
218 | 40 | self.pointing_device.click_object(self.main_window.app.select_many('Button')[2]) | ||
219 | 41 | |||
220 | 42 | def _click_cancel(self): | ||
221 | 43 | """Clicks the cancel button""" | ||
222 | 44 | self.pointing_device.click_object(self.main_window.app.select_many('Button')[1]) | ||
223 | 45 | |||
224 | 46 | def _check_units(self, units): | ||
225 | 47 | """Checks selected units by values from the first location tab""" | ||
226 | 48 | current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText') | ||
227 | 49 | if units == "imperial": | ||
228 | 50 | self.assertThat(current_temps[0].text, Eventually(Equals(u'69°F'))) | ||
229 | 51 | self.assertThat(current_temps[1].text, Eventually(Equals(u'78°F'))) | ||
230 | 52 | else: | ||
231 | 53 | self.assertThat(current_temps[0].text, Eventually(Equals(u'21°C'))) | ||
232 | 54 | self.assertThat(current_temps[1].text, Eventually(Equals(u'26°C'))) | ||
233 | 55 | |||
234 | 33 | def test_switch_scale(self): | 56 | def test_switch_scale(self): |
235 | 34 | """Tests switching the scale in the settings""" | 57 | """Tests switching the scale in the settings""" |
249 | 35 | # first check metric values | 58 | # first check metric values and open the settings sheet |
250 | 36 | current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText') | 59 | self._check_units('metric') |
251 | 37 | self.assertThat(current_temps[0].text, Eventually(Equals(u'21°C'))) | 60 | self._open_settings_sheet() |
252 | 38 | self.assertThat(current_temps[1].text, Eventually(Equals(u'26°C'))) | 61 | |
253 | 39 | 62 | # open the value selector | |
254 | 40 | # open the settings and switch to imperial | 63 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") |
255 | 41 | self._open_settings_page() | 64 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) |
256 | 42 | switch = self.main_window.get_object('CheckBox', 'ImperialSwitch') | 65 | self.pointing_device.click_object(units_selector) |
257 | 43 | self.assertThat(switch.visible, Eventually(Equals(True))) | 66 | |
258 | 44 | self.assertThat(switch.checked, Eventually(Equals(False))) | 67 | # choose second option, fahrenheit |
259 | 45 | self.pointing_device.click_object(switch) | 68 | self._move_pointer_around() |
260 | 46 | self.assertThat(switch.checked, Eventually(Equals(True))) | 69 | imperial_option = units_selector.get_children()[3] |
261 | 47 | self.main_window.click_toolbar_button("BackButton") | 70 | self.pointing_device.click_object(imperial_option) |
262 | 71 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) | ||
263 | 72 | self._click_confirm() | ||
264 | 48 | 73 | ||
265 | 49 | # wait for reload and check the imperial values | 74 | # wait for reload and check the imperial values |
266 | 50 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') | 75 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') |
267 | 51 | self.assertThat(load_indicator.running, Eventually(Equals(False))) | 76 | self.assertThat(load_indicator.running, Eventually(Equals(False))) |
271 | 52 | current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText') | 77 | self._check_units('imperial') |
269 | 53 | self.assertThat(current_temps[0].text, Eventually(Equals(u'69°F'))) | ||
270 | 54 | self.assertThat(current_temps[1].text, Eventually(Equals(u'78°F'))) | ||
272 | 55 | 78 | ||
273 | 56 | # switch back to metric values again | 79 | # switch back to metric values again |
281 | 57 | self._open_settings_page() | 80 | self._open_settings_sheet() |
282 | 58 | switch = self.main_window.get_object('CheckBox', 'ImperialSwitch') | 81 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") |
283 | 59 | self.assertThat(switch.visible, Eventually(Equals(True))) | 82 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) |
284 | 60 | self.assertThat(switch.checked, Eventually(Equals(True))) | 83 | self.pointing_device.click_object(units_selector) |
285 | 61 | self.pointing_device.click_object(switch) | 84 | self.assertThat(units_selector.expanded, Eventually(Equals(True))) |
286 | 62 | self.assertThat(switch.checked, Eventually(Equals(False))) | 85 | |
287 | 63 | self.main_window.click_toolbar_button("BackButton") | 86 | # click celsius option |
288 | 87 | self._move_pointer_around() | ||
289 | 88 | metric_option = units_selector.get_children()[4] | ||
290 | 89 | self.pointing_device.click_object(metric_option) | ||
291 | 90 | |||
292 | 91 | # confirm | ||
293 | 92 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) | ||
294 | 93 | self._click_confirm() | ||
295 | 64 | 94 | ||
296 | 65 | # wait for reload and check the metric values again | 95 | # wait for reload and check the metric values again |
297 | 66 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') | 96 | load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner') |
298 | 67 | self.assertThat(load_indicator.running, Eventually(Equals(False))) | 97 | self.assertThat(load_indicator.running, Eventually(Equals(False))) |
299 | 68 | current_temps = self.main_window.get_objects('QQuickText', 'CurrentTempText') | ||
300 | 69 | self.assertThat(current_temps[0].text, Eventually(Equals(u'21°C'))) | ||
301 | 70 | self.assertThat(current_temps[1].text, Eventually(Equals(u'26°C'))) | ||
302 | 71 | \ No newline at end of file | 98 | \ No newline at end of file |
303 | 99 | self._check_units('metric') | ||
304 | 100 | |||
305 | 101 | def test_switch_scale_cancel(self): | ||
306 | 102 | """Test canceling switching scale""" | ||
307 | 103 | # first check metric values and open the settings sheet | ||
308 | 104 | self._check_units('metric') | ||
309 | 105 | self._open_settings_sheet() | ||
310 | 106 | |||
311 | 107 | units_selector = self.main_window.get_object('ValueSelector', "UnitsSelector") | ||
312 | 108 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(0))) | ||
313 | 109 | self.pointing_device.click_object(units_selector) | ||
314 | 110 | |||
315 | 111 | # choose second option, fahrenheit | ||
316 | 112 | self._move_pointer_around() | ||
317 | 113 | imperial_option = units_selector.get_children()[3] | ||
318 | 114 | self.pointing_device.click_object(imperial_option) | ||
319 | 115 | self.assertThat(units_selector.selectedIndex, Eventually(Equals(1))) | ||
320 | 116 | |||
321 | 117 | # cancel and check | ||
322 | 118 | self._click_cancel() | ||
323 | 119 | self._check_units('metric') | ||
324 | 120 | |||
325 | 72 | 121 | ||
326 | === modified file 'ubuntu-weather-app.qml' | |||
327 | --- ubuntu-weather-app.qml 2013-06-26 10:43:49 +0000 | |||
328 | +++ ubuntu-weather-app.qml 2013-07-11 18:53:25 +0000 | |||
329 | @@ -1,3 +1,21 @@ | |||
330 | 1 | /* | ||
331 | 2 | * Copyright (C) 2013 Canonical Ltd | ||
332 | 3 | * | ||
333 | 4 | * This program is free software: you can redistribute it and/or modify | ||
334 | 5 | * it under the terms of the GNU General Public License version 3 as | ||
335 | 6 | * published by the Free Software Foundation. | ||
336 | 7 | * | ||
337 | 8 | * This program is distributed in the hope that it will be useful, | ||
338 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
339 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
340 | 11 | * GNU General Public License for more details. | ||
341 | 12 | * | ||
342 | 13 | * You should have received a copy of the GNU General Public License | ||
343 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
344 | 15 | * | ||
345 | 16 | * Authored by: Raúl Yeguas <neokore@gmail.com> | ||
346 | 17 | * Martin Borho <martin@borho.net> | ||
347 | 18 | */ | ||
348 | 1 | import QtQuick 2.0 | 19 | import QtQuick 2.0 |
349 | 2 | import Ubuntu.Components 0.1 | 20 | import Ubuntu.Components 0.1 |
350 | 3 | import "components" as Components | 21 | import "components" as Components |
351 | @@ -93,14 +111,13 @@ | |||
352 | 93 | locationManager.loadData() | 111 | locationManager.loadData() |
353 | 94 | } | 112 | } |
354 | 95 | 113 | ||
357 | 96 | function showSettingsPage() { | 114 | function showSettings() { |
358 | 97 | pageStack.push(settingsPage) | 115 | PopupUtils.open(settingsSheet) |
359 | 98 | } | 116 | } |
360 | 99 | 117 | ||
361 | 100 | Component.onCompleted: { | 118 | Component.onCompleted: { |
362 | 101 | //storage.clearDB(); | 119 | //storage.clearDB(); |
363 | 102 | //storage.clearSetting('units'); | 120 | //storage.clearSetting('units'); |
364 | 103 | //storage.saveSetting("units", "imperial") | ||
365 | 104 | storage.getSettings(function(storedSettings) { | 121 | storage.getSettings(function(storedSettings) { |
366 | 105 | for(var settingName in storedSettings) { | 122 | for(var settingName in storedSettings) { |
367 | 106 | settings[settingName] = storedSettings[settingName]; | 123 | settings[settingName] = storedSettings[settingName]; |
368 | @@ -109,8 +126,8 @@ | |||
369 | 109 | }) | 126 | }) |
370 | 110 | } | 127 | } |
371 | 111 | 128 | ||
374 | 112 | Components.SettingsPage { | 129 | Components.SettingsSheet { |
375 | 113 | id: settingsPage | 130 | id: settingsSheet |
376 | 114 | } | 131 | } |
377 | 115 | 132 | ||
378 | 116 | Components.Storage{ | 133 | Components.Storage{ |
PASSED: Continuous integration, rev:59 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 6/ 91.189. 93.70:8080/ job/ubuntu- weather- app-quantal- amd64-ci/ 6 91.189. 93.70:8080/ job/ubuntu- weather- app-raring- amd64-ci/ 6
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- weather- app-ci/ 6/rebuild
http://