Merge lp:~nik90/ubuntu-clock-app/fix-location-error-msg into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan on 2015-04-14
Status: Merged
Approved by: Nekhelesh Ramananthan on 2015-04-19
Approved revision: 254
Merged at revision: 256
Proposed branch: lp:~nik90/ubuntu-clock-app/fix-location-error-msg
Merge into: lp:ubuntu-clock-app
Diff against target: 92 lines (+20/-12)
3 files modified
app/clock/ClockPage.qml (+16/-6)
debian/changelog (+2/-0)
po/com.ubuntu.clock.pot (+2/-6)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/fix-location-error-msg
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ 2015-04-14 Approve on 2015-04-15
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-04-15
Review via email: mp+256230@code.launchpad.net

Commit Message

Removed the "Location service error" message which is shown when the user denies clock app location access and also when the location service does not work when opening the clock app for the *first* time.

Description of the Change

This MP removes the "Location service error" message which is shown when the user denies clock app location access and also when the location service does not work when opening the clock app for the *first* time.

Steps to test
-------------

1. Start with a clean slate by removing .local/share/com.ubuntu.clock/user-preferences

2. Disable clock app location access in system-settings-app->Security&Privacy->Location acess->Clock

3. Open the clock app

4. The location label shouldn't be shown. The date label should now be shown more prominently.

5. Close the clock app

6. Enable clock app location access similar to step 2.

7. Reopen the clock app

8. The location label shows "Retrieving location" and then shortly after shows your location

9. Close and reopen clock app. It should still show your location.

10. At this point even if you disable clock app location access and reopen the clock app, it should still show the cached location.

To post a comment you must log in.
254. By Nekhelesh Ramananthan on 2015-04-15

merged lp:ubuntu-clock-app

Tested as per instructions on krillin. This is a very nice change, thanks Nekhelesh!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/clock/ClockPage.qml'
2--- app/clock/ClockPage.qml 2015-01-22 00:11:57 +0000
3+++ app/clock/ClockPage.qml 2015-04-15 00:14:17 +0000
4@@ -71,6 +71,16 @@
5 if (sourceError !== PositionSource.NoError) {
6 console.log("[Source Error]: Location Service Error")
7 geoposition.stop()
8+
9+ // If this is the first time, then set location as Denied
10+ // to indicate user denying clock app location access.
11+ if (userLocationDocument.contents.location === "Null") {
12+ var locationData = JSON.parse
13+ (JSON.stringify(userLocationDocument.contents))
14+
15+ locationData.location = "Denied"
16+ userLocationDocument.contents = locationData
17+ }
18 }
19 }
20
21@@ -234,7 +244,8 @@
22
23 text: clock.analogTime.toLocaleDateString()
24 opacity: settingsIcon.opacity
25- fontSize: "xx-small"
26+ color: locationRow.visible ? Theme.palette.baseText : UbuntuColors.midAubergine
27+ fontSize: locationRow.visible ? "xx-small" : "medium"
28 }
29
30 Row {
31@@ -243,6 +254,7 @@
32
33 opacity: settingsIcon.opacity
34 spacing: units.gu(1)
35+ visible: location.text !== "Null" && location.text !== "Denied"
36
37 anchors {
38 top: date.bottom
39@@ -266,12 +278,10 @@
40 color: UbuntuColors.midAubergine
41
42 text: {
43- if (userLocationDocument.contents.location === "Null") {
44- if(geoposition.sourceError !== PositionSource.NoError) {
45- return i18n.tr("Location Service Error!")
46- } else {
47+ if (userLocationDocument.contents.location === "Null"
48+ || userLocationDocument.contents.location === "Denied"
49+ && geoposition.sourceError === PositionSource.NoError) {
50 return i18n.tr("Retrieving location...")
51- }
52 }
53
54 else {
55
56=== modified file 'debian/changelog'
57--- debian/changelog 2015-04-14 23:56:12 +0000
58+++ debian/changelog 2015-04-15 00:14:17 +0000
59@@ -18,6 +18,8 @@
60 in autopilot. (LP: #1426108)
61 * Fixed timezone difference label overflowing into the clock (LP: #1440732)
62 * Improved bottom edge header by correcting the direction of the chevron (LP: #1432696)
63+ * Fixed "Location service error" label being shown when user denies clock app
64+ location access (LP: #1393827)
65
66 [Brendan Donegan]
67 * Fixed AP failure by waiting for the bottom edge tip visible property to be true
68
69=== modified file 'po/com.ubuntu.clock.pot'
70--- po/com.ubuntu.clock.pot 2015-04-14 23:56:12 +0000
71+++ po/com.ubuntu.clock.pot 2015-04-15 00:14:17 +0000
72@@ -8,7 +8,7 @@
73 msgstr ""
74 "Project-Id-Version: \n"
75 "Report-Msgid-Bugs-To: \n"
76-"POT-Creation-Date: 2015-04-15 01:55+0200\n"
77+"POT-Creation-Date: 2015-04-15 02:13+0200\n"
78 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
79 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
80 "Language-Team: LANGUAGE <LL@li.org>\n"
81@@ -158,11 +158,7 @@
82 msgid "Delete alarm"
83 msgstr ""
84
85-#: ../app/clock/ClockPage.qml:271
86-msgid "Location Service Error!"
87-msgstr ""
88-
89-#: ../app/clock/ClockPage.qml:273
90+#: ../app/clock/ClockPage.qml:284
91 msgid "Retrieving location..."
92 msgstr ""
93

Subscribers

People subscribed via source and target branches