[gnome-shell/T27795: 5/138] bluetooth: Be consistent when determining whether Bluetooth is off
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/T27795: 5/138] bluetooth: Be consistent when determining whether Bluetooth is off
- Date: Tue, 1 Oct 2019 23:29:45 +0000 (UTC)
commit 56f8ebd0edfe467f9af562f58acbc8cc9f9bcb70
Author: Mario Sanchez Prada <mario endlessm com>
Date: Tue Oct 17 18:57:12 2017 +0200
bluetooth: Be consistent when determining whether Bluetooth is off
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 if.
https://bugzilla.gnome.org/show_bug.cgi?id=789110
js/ui/status/bluetooth.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/bluetooth.js b/js/ui/status/bluetooth.js
index a69db2fc86..419811e543 100644
--- a/js/ui/status/bluetooth.js
+++ b/js/ui/status/bluetooth.js
@@ -123,14 +123,17 @@ var Indicator = class extends PanelMenu.SystemIndicator {
else
this._item.visible = this._proxy.BluetoothHasAirplaneMode && !this._proxy.BluetoothAirplaneMode;
+ // Bluetooth will be considered 'Off' if either the adapter
+ // is not available or it's set in irplane 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");
}
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]