network: Always show the VPN indicator when connected to VPN

The new designs ask for this.

https://bugzilla.gnome.org/show_bug.cgi?id=701954
This commit is contained in:
Jasper St. Pierre 2013-05-31 19:03:09 -04:00
parent a0991c8261
commit 35a7a3c1ac

View File

@ -1395,8 +1395,8 @@ const NMApplet = new Lang.Class({
_init: function() { _init: function() {
this.parent('network-offline-symbolic', _('Network')); this.parent('network-offline-symbolic', _('Network'));
this.secondaryIcon = this.addIcon(new Gio.ThemedIcon({ name: 'network-vpn-symbolic' })); this._vpnIcon = this.addIcon(null);
this.secondaryIcon.hide(); this._vpnIcon.hide();
// Device types // Device types
this._dtypes = { }; this._dtypes = { };
@ -2075,21 +2075,14 @@ const NMApplet = new Lang.Class({
// update VPN indicator // update VPN indicator
if (this._vpnConnection) { if (this._vpnConnection) {
let vpnIconName = 'network-vpn-symbolic';
if (this._vpnConnection.state == NetworkManager.ActiveConnectionState.ACTIVATING) if (this._vpnConnection.state == NetworkManager.ActiveConnectionState.ACTIVATING)
vpnIconName = 'network-vpn-acquiring-symbolic'; this._vpnIcon.icon_name = 'network-vpn-acquiring-symbolic';
else
this._vpnIcon.icon_name = 'network-vpn-symbolic';
// only show a separate icon when we're using a wireless/3g connection this._vpnIcon.show();
if (mc._section == NMConnectionCategory.WIRELESS ||
mc._section == NMConnectionCategory.WWAN) {
this.secondaryIcon.icon_name = vpnIconName;
this.secondaryIcon.show();
} else { } else {
this.setIcon(vpnIconName); this._vpnIcon.hide();
this.secondaryIcon.hide();
}
} else {
this.secondaryIcon.hide();
} }
// cleanup stale signal connections // cleanup stale signal connections