[gnome-shell/gnome-3-12] rfkill: make the Airplane mode menu insensitive in the lock screen



commit 07198c5890473b15144745dc0835099ab2087aae
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Apr 29 23:24:27 2014 +0200

    rfkill: make the Airplane mode menu insensitive in the lock screen
    
    Like we do for the bluetooth and wifi menus
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729224

 js/ui/status/rfkill.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/status/rfkill.js b/js/ui/status/rfkill.js
index b9d3eaf..b2359d8 100644
--- a/js/ui/status/rfkill.js
+++ b/js/ui/status/rfkill.js
@@ -4,6 +4,7 @@ const Gio = imports.gi.Gio;
 const Lang = imports.lang;
 const Signals = imports.signals;
 
+const Main = imports.ui.main;
 const PanelMenu = imports.ui.panelMenu;
 const PopupMenu = imports.ui.popupMenu;
 
@@ -87,6 +88,14 @@ const Indicator = new Lang.Class({
         }));
         this._item.menu.addSettingsAction(_("Network Settings"), 'gnome-network-panel.desktop');
         this.menu.addMenuItem(this._item);
+
+        Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
+        this._sessionUpdated();
+    },
+
+    _sessionUpdated: function() {
+        let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
+        this.menu.setSensitive(sensitive);
     },
 
     _sync: function() {


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