From bde5cfc8bb236208e8ab8853e03872fb1b906268 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 3 Oct 2013 14:49:21 +0200 Subject: [PATCH] NetworkMenu/NMDeviceModem: use the operator name when we have it Instead of the connection name, as the operator name is usually shorter and more useful. https://bugzilla.gnome.org/show_bug.cgi?id=709043 --- js/ui/status/network.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 1dffb3a87..10b3d342f 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -426,16 +426,7 @@ const NMDeviceModem = new Lang.Class({ this._mobileDevice = new ModemManager.ModemGsm(device.udi); if (this._mobileDevice) { - this._operatorNameId = this._mobileDevice.connect('notify::operator-name', Lang.bind(this, function() { - if (this._operatorItem) { - let name = this._mobileDevice.operator_name; - if (name) { - this._operatorItem.label.text = name; - this._operatorItem.actor.show(); - } else - this._operatorItem.actor.hide(); - } - })); + this._operatorNameId = this._mobileDevice.connect('notify::operator-name', Lang.bind(this, this._sync)); this._signalQualityId = this._mobileDevice.connect('notify::signal-quality', Lang.bind(this, function() { this.emit('icon-changed'); })); @@ -467,6 +458,9 @@ const NMDeviceModem = new Lang.Class({ /* Translators: this is for a network device that cannot be activated because it's disabled by rfkill (airplane mode) */ return _("Disabled"); + else if (this._device.state == NetworkManager.DeviceState.ACTIVATED && + this._mobileDevice && this._mobileDevice.operator_name) + return this._mobileDevice.operator_name; else return this.parent(); },