[gnome-maps/wip/geoclue-refactor: 11/14] MainWindow: Fix handling of geoclue property



commit fd13dbe756dba001adf81d785846dbd8eb9d028d
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Tue Nov 25 18:55:17 2014 +0100

    MainWindow: Fix handling of geoclue property
    
    We can't just bind the geoclue connected property we need
    to take care of the case of the application connected property
    setting the headerbar sensitivity.

 src/mainWindow.js |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 0e44904..d09ffe0 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -169,11 +169,6 @@ const MainWindow = new Lang.Class({
                 onActivate: this._placeEntry.grab_focus.bind(this._placeEntry)
             }
         });
-
-        let action = this.window.lookup_action('goto-user-location');
-        Application.geoclue.bind_property('connected',
-                                          action, 'enabled',
-                                          GObject.BindingFlags.SYNC_CREATE);
     },
 
     _initSignals: function() {
@@ -204,10 +199,15 @@ const MainWindow = new Lang.Class({
             this._favoritesButton.sensitive = favoritesPopover.rows > 0;
         }).bind(this));
 
+        Application.geoclue.connect('notify::connected', (function() {
+            this._gotoUserLocationButton.sensitive = Application.geoclue.connected;
+        }).bind(this));
+
         this.window.application.connect('notify::connected', (function() {
             let app = this.window.application;
 
-            this._gotoUserLocationButton.sensitive = app.connected;
+            this._gotoUserLocationButton.sensitive = (app.connected &&
+                                                      Application.geoclue.connected);
             this._layersButton.sensitive = app.connected;
             this._toggleSidebarButton.sensitive = app.connected;
             this._favoritesButton.sensitive = (app.connected &&


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