Merge lp:~vthompson/ubuntu-weather-app/reboot-empty-state into lp:ubuntu-weather-app

Proposed by Victor Thompson on 2015-06-14
Status: Merged
Approved by: Nekhelesh Ramananthan on 2015-06-21
Approved revision: 57
Merged at revision: 55
Proposed branch: lp:~vthompson/ubuntu-weather-app/reboot-empty-state
Merge into: lp:ubuntu-weather-app
Diff against target: 118 lines (+39/-12)
5 files modified
app/ubuntu-weather-app.qml (+24/-8)
app/ui/AddLocationPage.qml (+0/-1)
po/com.ubuntu.weather.pot (+5/-1)
tests/autopilot/ubuntu_weather_app/__init__.py (+5/-0)
tests/autopilot/ubuntu_weather_app/tests/test_weather.py (+5/-2)
To merge this branch: bzr merge lp:~vthompson/ubuntu-weather-app/reboot-empty-state
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-06-21
Nekhelesh Ramananthan (community) 2015-06-14 Approve on 2015-06-21
Review via email: mp+261916@code.launchpad.net

Commit message

Initial empty state

Description of the change

This mp introduces a simple 5 second timer and label that is displayed to the user while the Location is being determined.

To post a comment you must log in.
Nekhelesh Ramananthan (nik90) wrote :

Simple and very effective! Very nice! Just a minor thing, since this code is essential run once in the lifetime of the app, it would have been nice to have it in a Loader. But I guess this can be done in a future MP.

Approving!

review: Approve
Nekhelesh Ramananthan (nik90) wrote :

Seems to be a conflict in po/com.ubuntu.weather.pot. Pls merge trunk and push again.

57. By Victor Thompson on 2015-06-21

Merge trunk and resolve conflict.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ubuntu-weather-app.qml'
2--- app/ubuntu-weather-app.qml 2015-06-21 13:28:09 +0000
3+++ app/ubuntu-weather-app.qml 2015-06-21 16:06:11 +0000
4@@ -64,14 +64,6 @@
5 Component.onCompleted: {
6 storage.getLocations(fillPages);
7 refreshData();
8-
9- /*
10- TODO: Also add a check to determine if current location can be
11- resolved.
12- */
13- if (locationsList.length == 0) {
14- mainPageStack.push(Qt.resolvedUrl("ui/AddLocationPage.qml"));
15- }
16 }
17
18 /*
19@@ -163,6 +155,30 @@
20 }
21 }
22
23+ Column {
24+ anchors.centerIn: parent
25+ spacing: units.gu(4)
26+ visible: (locationsList == null || locationsList.length == 0) && mainPageStack.depth == 1
27+ z: 1000
28+
29+ Label {
30+ id: emptyStateLabel
31+ anchors.horizontalCenter: parent.horizontalCenter
32+ text: i18n.tr("Searching for current location...")
33+ }
34+
35+ Button {
36+ id: emptyStateButton
37+ objectName: "emptyStateButton"
38+
39+ anchors.horizontalCenter: parent.horizontalCenter
40+
41+ text: i18n.tr("Add a manual location")
42+
43+ onTriggered: mainPageStack.push(Qt.resolvedUrl("ui/AddLocationPage.qml"));
44+ }
45+ }
46+
47 Data.Storage {
48 id: storage
49
50
51=== modified file 'app/ui/AddLocationPage.qml'
52--- app/ui/AddLocationPage.qml 2015-06-18 01:42:03 +0000
53+++ app/ui/AddLocationPage.qml 2015-06-21 16:06:11 +0000
54@@ -44,7 +44,6 @@
55 backAction: Action {
56 iconName: "back"
57 text: i18n.tr("Back")
58- visible: locationsList.length > 0
59 onTriggered: mainPageStack.pop()
60 }
61 actions: [
62
63=== modified file 'po/com.ubuntu.weather.pot'
64--- po/com.ubuntu.weather.pot 2015-06-18 01:42:03 +0000
65+++ po/com.ubuntu.weather.pot 2015-06-21 16:06:11 +0000
66@@ -8,7 +8,7 @@
67 msgstr ""
68 "Project-Id-Version: ubuntu-weather-app\n"
69 "Report-Msgid-Bugs-To: \n"
70-"POT-Creation-Date: 2015-06-09 19:05-0500\n"
71+"POT-Creation-Date: 2015-06-14 16:44-0500\n"
72 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
73 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
74 "Language-Team: LANGUAGE <LL@li.org>\n"
75@@ -66,6 +66,10 @@
76 msgid "Cancel selection"
77 msgstr ""
78
79+#: ../app/ubuntu-weather-app.qml:177
80+msgid "Searching for current location..."
81+msgstr ""
82+
83 #: ../app/ui/AddLocationPage.qml:30
84 msgid "Select a city"
85 msgstr ""
86
87=== modified file 'tests/autopilot/ubuntu_weather_app/__init__.py'
88--- tests/autopilot/ubuntu_weather_app/__init__.py 2015-06-03 17:49:50 +0000
89+++ tests/autopilot/ubuntu_weather_app/__init__.py 2015-06-21 16:06:11 +0000
90@@ -32,6 +32,11 @@
91 return self.main_view.wait_select_single(
92 AddLocationPage, objectName="addLocationPage")
93
94+ def click_add_location_button(self):
95+ add_location_button = self.main_view.wait_select_single(
96+ "Button", objectName="emptyStateButton")
97+ self.app.pointing_device.click_object(add_location_button)
98+
99
100 class Page(UbuntuUIToolkitCustomProxyObjectBase):
101 """Autopilot helper for Pages."""
102
103=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_weather.py'
104--- tests/autopilot/ubuntu_weather_app/tests/test_weather.py 2015-05-29 02:38:23 +0000
105+++ tests/autopilot/ubuntu_weather_app/tests/test_weather.py 2015-06-21 16:06:11 +0000
106@@ -24,8 +24,11 @@
107 def setUp(self):
108 super(TestMainWindow, self).setUp()
109
110- def test_add_location_page_start(self):
111- """ tests that the add location page is shown on startup"""
112+ def test_add_location_button(self):
113+ """ tests that the add location page is shown after the Add Location
114+ button is clicked """
115+
116+ self.app.click_add_location_button()
117
118 add_location_page = self.app.get_add_location_page()
119

Subscribers

People subscribed via source and target branches

to all changes: