NetworkMenu/NMDeviceModem: fix status texts for airplane mode

Show "Hardware Disabled" when disabled by HW switch, and
generically "Disabled" when airplane mode is active, as
indicated by v4 mockups.
Note that bluetooth is not affected by NM handling of airplane
mode (and generally the firmware makes the USB bluetooth
adapter disappear when rfkilled), so this is in NMDeviceModem
instead of NMConnectionDevice.

https://bugzilla.gnome.org/show_bug.cgi?id=709043
This commit is contained in:
Giovanni Campagna 2013-10-03 14:31:58 +02:00
parent c79bdd9029
commit 777c7a952b

View File

@ -460,6 +460,17 @@ const NMDeviceModem = new Lang.Class({
this.parent(); this.parent();
}, },
_getStatus: function() {
if (!this._client.wwan_hardware_enabled)
return _("Hardware Disabled");
else if (!this._client.wwan_enabled)
/* Translators: this is for a network device that cannot be activated
because it's disabled by rfkill (airplane mode) */
return _("Disabled");
else
return this.parent();
},
_getMenuIcon: function() { _getMenuIcon: function() {
if (this._device.active_connection) if (this._device.active_connection)
return this.getIndicatorIcon(); return this.getIndicatorIcon();