NetworkMenu: use Connected instead of profile name for wired and wwan

The profile name is most often not useful (because it's an
autogenerated string like "Wired Connection 1"), and even when it
is, it's already available in the submenu.

https://bugzilla.gnome.org/show_bug.cgi?id=725586
This commit is contained in:
Giovanni Campagna 2014-03-04 14:02:00 +01:00 committed by Giovanni Campagna
parent 8282aa6c24
commit 3432f71500

View File

@ -236,16 +236,6 @@ const NMConnectionSection = new Lang.Class({
return this.getIndicatorIcon(); return this.getIndicatorIcon();
}, },
_getStatus: function() {
let values = this._connectionItems.values();
for (let item of values) {
if (item.isActive())
return item.getName();
}
return _("Off");
},
getConnectLabel: function() { getConnectLabel: function() {
return _("Connect"); return _("Connect");
}, },
@ -424,7 +414,7 @@ const NMConnectionDevice = new Lang.Class({
case NetworkManager.DeviceState.DISCONNECTED: case NetworkManager.DeviceState.DISCONNECTED:
return _("Off"); return _("Off");
case NetworkManager.DeviceState.ACTIVATED: case NetworkManager.DeviceState.ACTIVATED:
return this.parent(); return _("Connected");
case NetworkManager.DeviceState.UNMANAGED: case NetworkManager.DeviceState.UNMANAGED:
/* Translators: this is for network devices that are physically present but are not /* Translators: this is for network devices that are physically present but are not
under NetworkManager's control (and thus cannot be used in the menu) */ under NetworkManager's control (and thus cannot be used in the menu) */
@ -1455,6 +1445,16 @@ const NMVPNSection = new Lang.Class({
return _("VPN"); return _("VPN");
}, },
_getStatus: function() {
let values = this._connectionItems.values();
for (let item of values) {
if (item.isActive())
return item.getName();
}
return _("Off");
},
_getMenuIcon: function() { _getMenuIcon: function() {
return this.getIndicatorIcon() || 'network-vpn-symbolic'; return this.getIndicatorIcon() || 'network-vpn-symbolic';
}, },