BluetoothMenu: fix visibility

In addition to BluetoothAirplaneMode, we need to check also
BluetoothHasAirplaneMode, which is indicative of bluetooth rfkill
devices (and by extension bluetooth adapters).
This prevents showing the menu if there is no adapter present.

https://bugzilla.gnome.org/show_bug.cgi?id=725057
This commit is contained in:
Giovanni Campagna 2014-03-17 16:15:21 +01:00
parent 48c3e3f534
commit c22264a0ca

View File

@ -17,6 +17,7 @@ const OBJECT_PATH = '/org/gnome/SettingsDaemon/Rfkill';
const RfkillManagerInterface = '<node> \
<interface name="org.gnome.SettingsDaemon.Rfkill"> \
<property name="BluetoothAirplaneMode" type="b" access="readwrite" /> \
<property name="BluetoothHasAirplaneMode" type="b" access="read" /> \
</interface> \
</node>';
@ -97,7 +98,7 @@ const Indicator = new Lang.Class({
this.menu.setSensitive(sensitive);
this._indicator.visible = nDevices > 0;
this._item.actor.visible = !this._proxy.BluetoothAirplaneMode;
this._item.actor.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
if (nDevices > 0)
this._item.status.text = ngettext("%d Connected Device", "%d Connected Devices", nDevices).format(nDevices);