bluetooth: Make insensitive when locked

Most system menu entries are disabled on the lock/login screen;
there is no good reason why users should be allowed to turn bluetooth
on/off (but not e.g. Wifi), so disable the entry as well.

https://bugzilla.gnome.org/show_bug.cgi?id=726319
This commit is contained in:
Florian Müllner 2014-03-15 08:53:54 +01:00
parent d6197b0904
commit 4589ce4d78

View File

@ -58,6 +58,7 @@ const Indicator = new Lang.Class({
this._model.connect('row-changed', Lang.bind(this, this._sync)); this._model.connect('row-changed', Lang.bind(this, this._sync));
this._model.connect('row-deleted', Lang.bind(this, this._sync)); this._model.connect('row-deleted', Lang.bind(this, this._sync));
this._model.connect('row-inserted', Lang.bind(this, this._sync)); this._model.connect('row-inserted', Lang.bind(this, this._sync));
Main.sessionMode.connect('updated', Lang.bind(this, this._sync));
this._sync(); this._sync();
}, },
@ -92,7 +93,9 @@ const Indicator = new Lang.Class({
_sync: function() { _sync: function() {
let nDevices = this._getNConnectedDevices(); let nDevices = this._getNConnectedDevices();
let sensitive = !Main.sessionMode.isLocked && !Main.sessionMode.isGreeter;
this.menu.setSensitive(sensitive);
this._indicator.visible = nDevices > 0; this._indicator.visible = nDevices > 0;
this._item.actor.visible = !this._proxy.BluetoothAirplaneMode; this._item.actor.visible = !this._proxy.BluetoothAirplaneMode;