[gnome-maps] mainWindow: Disable location button if no geoclue



commit d5cb892ab3b70801ecb8fd967c77315dbeb9b66a
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Wed May 7 08:11:00 2014 +0200

    mainWindow: Disable location button if no geoclue
    
    https://bugzilla.gnome.org/show_bug.cgi?id=727706

 src/mainWindow.js |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 01d37b5..e3b9350 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -25,6 +25,7 @@ const Gdk = imports.gi.Gdk;
 const GLib = imports.gi.GLib;
 const Gtk = imports.gi.Gtk;
 const Champlain = imports.gi.Champlain;
+const GObject = imports.gi.GObject;
 
 const Lang = imports.lang;
 const Mainloop = imports.mainloop;
@@ -131,6 +132,11 @@ const MainWindow = new Lang.Class({
                 signalHandlers: { activate: this._onGotoUserLocationActivate }
             }
         ], this);
+
+        let action = this.window.lookup_action('goto-user-location');
+        this.mapView.geoclue.bind_property('connected',
+                                           action, 'enabled',
+                                           GObject.BindingFlags.SYNC_CREATE);
     },
 
     _initSignals: function() {


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