[gnome-shell] NetworkMenu/NMDeviceModem: use the operator name when we have it



commit bde5cfc8bb236208e8ab8853e03872fb1b906268
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Oct 3 14:49:21 2013 +0200

    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 files changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 1dffb3a..10b3d34 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();
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]