← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

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

 

Nekhelesh Ramananthan has proposed merging lp:~nik90/ubuntu-clock-app/fix-location-error-msg into lp:ubuntu-clock-app.

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.

Requested reviews:
  Ubuntu Clock Developers (ubuntu-clock-dev)
Related bugs:
  Bug #1393827 in Ubuntu Clock App: "[Clock app] "Location Service Error!" displayed when location request denied"
  https://bugs.launchpad.net/ubuntu-clock-app/+bug/1393827

For more details, see:
https://code.launchpad.net/~nik90/ubuntu-clock-app/fix-location-error-msg/+merge/256230

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
-- 
Your team Ubuntu Clock Developers is requested to review the proposed merge of lp:~nik90/ubuntu-clock-app/fix-location-error-msg into lp:ubuntu-clock-app.
=== modified file 'app/clock/ClockPage.qml'
--- app/clock/ClockPage.qml	2015-01-22 00:11:57 +0000
+++ app/clock/ClockPage.qml	2015-04-14 21:25:33 +0000
@@ -71,6 +71,16 @@
             if (sourceError !== PositionSource.NoError) {
                 console.log("[Source Error]: Location Service Error")
                 geoposition.stop()
+
+                // If this is the first time, then set location as Denied
+                // to indicate user denying clock app location access.
+                if (userLocationDocument.contents.location === "Null") {
+                    var locationData = JSON.parse
+                            (JSON.stringify(userLocationDocument.contents))
+
+                    locationData.location = "Denied"
+                    userLocationDocument.contents = locationData
+                }
             }
         }
 
@@ -234,7 +244,8 @@
 
             text: clock.analogTime.toLocaleDateString()
             opacity: settingsIcon.opacity
-            fontSize: "xx-small"
+            color: locationRow.visible ? Theme.palette.baseText : UbuntuColors.midAubergine
+            fontSize: locationRow.visible ? "xx-small" : "medium"
         }
 
         Row {
@@ -243,6 +254,7 @@
 
             opacity: settingsIcon.opacity
             spacing: units.gu(1)
+            visible: geoposition.sourceError === PositionSource.NoError
 
             anchors {
                 top: date.bottom
@@ -266,12 +278,10 @@
                 color: UbuntuColors.midAubergine
 
                 text: {
-                    if (userLocationDocument.contents.location === "Null") {
-                        if(geoposition.sourceError !== PositionSource.NoError) {
-                            return i18n.tr("Location Service Error!")
-                        } else {
+                    if (userLocationDocument.contents.location === "Null"
+                            || userLocationDocument.contents.location === "Denied"
+                            && geoposition.sourceError === PositionSource.NoError) {
                             return i18n.tr("Retrieving location...")
-                        }
                     }
 
                     else {

=== modified file 'debian/changelog'
--- debian/changelog	2015-04-14 11:08:01 +0000
+++ debian/changelog	2015-04-14 21:25:33 +0000
@@ -17,6 +17,8 @@
   * Renabled create alarm tests on device which were disabled due to upstream bug
     in autopilot. (LP: #1426108)
   * Fixed timezone difference label overflowing into the clock (LP: #1440732)
+  * Fixed "Location service error" label being shown when user denies clock app
+    location access (LP: #1393827)
 
   [Brendan Donegan]
   * Fixed AP failure by waiting for the bottom edge tip visible property to be true

=== modified file 'po/com.ubuntu.clock.pot'
--- po/com.ubuntu.clock.pot	2015-04-14 11:08:01 +0000
+++ po/com.ubuntu.clock.pot	2015-04-14 21:25:33 +0000
@@ -8,7 +8,11 @@
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
+<<<<<<< TREE
 "POT-Creation-Date: 2015-04-14 13:07+0200\n"
+=======
+"POT-Creation-Date: 2015-04-14 23:15+0200\n"
+>>>>>>> MERGE-SOURCE
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -157,11 +161,7 @@
 msgid "Delete alarm"
 msgstr ""
 
-#: ../app/clock/ClockPage.qml:271
-msgid "Location Service Error!"
-msgstr ""
-
-#: ../app/clock/ClockPage.qml:273
+#: ../app/clock/ClockPage.qml:284
 msgid "Retrieving location..."
 msgstr ""
 


Follow ups