[gnome-maps] MainWindow: Allow switching back to auto location



commit 982a4714e6133c7cfd8fc3b844dd0c2d785ce5d3
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Aug 27 19:42:39 2013 +0300

    MainWindow: Allow switching back to auto location
    
    After user him/herself overrides location, allow him/her to switch back
    to automatic location detection through geoclue. We do this through the
    'Goto my location' button.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706726

 src/mainWindow.js |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 9d33ceb..42db88e 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -308,7 +308,15 @@ const MainWindow = new Lang.Class({
     },
 
     _onGotoUserLocationActivate: function() {
-        this.mapView.gotoUserLocation(true);
+        if (this.mapView.geoclue.userSetLocation) {
+            Utils.once(this.mapView.geoclue,
+                       'location-changed',
+                       (function() {
+                this.mapView.gotoUserLocation(true);
+            }).bind(this));
+            this.mapView.geoclue.findLocation();
+        } else
+            this.mapView.gotoUserLocation(true);
     },
 
     _onMapTypeMenuActivate: function(action) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]