summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Sanchez Prada <mario@endlessm.com>2017-10-17 18:57:12 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-05-29 20:18:28 -0300
commitefd8df2fc937a47a4dab48e38c3bca193bea760d (patch)
tree027b69649c7a257622a605ba4061f6a09be16f69
parent44894262f49b9f8b2809321ebcf1cd9426303fd6 (diff)
downloadgnome-shell-efd8df2fc937a47a4dab48e38c3bca193bea760d.tar.gz
bluetooth: Be consistent when determining whether Bluetooth is offgbsneto/789110
It would be nice if we could use the same exact condition to decide whether to show "Off"/"Turn On" vs "On"/"Turn Off" in the menu, since otherwise we risk showing inconsistent states in each place. https://bugzilla.gnome.org/show_bug.cgi?id=789110
-rw-r--r--js/ui/status/bluetooth.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js
index 7ffc8f767..1e514117e 100644
--- a/js/ui/status/bluetooth.js
+++ b/js/ui/status/bluetooth.js
@@ -132,14 +132,17 @@ var Indicator = new Lang.Class({
else
this._item.actor.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
+ // Bluetooth will be considered 'Off' if either the adapter
+ // is not available or it's set in airplane mode.
+ let isBluetoothOff = nConnectedDevices == -1 || this._proxy.BluetoothAirplaneMode;
if (nConnectedDevices > 0)
/* Translators: this is the number of connected bluetooth devices */
this._item.label.text = ngettext("%d Connected", "%d Connected", nConnectedDevices).format(nConnectedDevices);
- else if (nConnectedDevices == -1)
+ else if (isBluetoothOff)
this._item.label.text = _("Off");
else
this._item.label.text = _("On");
- this._toggleItem.label.text = this._proxy.BluetoothAirplaneMode ? _("Turn On") : _("Turn Off");
+ this._toggleItem.label.text = isBluetoothOff ? _("Turn On") : _("Turn Off");
},
});