From 11637bae4390985ee2859774188949b03d7b7533 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 29 Nov 2011 17:41:55 +0100 Subject: [PATCH] Network Menu: prefer VPN connections when showing the icon When VPN is active, and it's not the default routing, we should show the vpn icon, rather than the physical connection. https://bugzilla.gnome.org/show_bug.cgi?id=665115 --- js/ui/status/network.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index fcf0835c1..a3ce9bcfa 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1803,6 +1803,7 @@ const NMApplet = new Lang.Class({ let activating = null; let default_ip4 = null; let default_ip6 = null; + let active_vpn = null; for (let i = 0; i < this._activeConnections.length; i++) { let a = this._activeConnections[i]; @@ -1832,6 +1833,8 @@ const NMApplet = new Lang.Class({ default_ip4 = a; if (a.default6) default_ip6 = a; + if (a._type == 'vpn') + active_vpn = a; if (a.state == NetworkManager.ActiveConnectionState.ACTIVATING) activating = a; @@ -1862,7 +1865,7 @@ const NMApplet = new Lang.Class({ } } - this._mainConnection = activating || default_ip4 || default_ip6 || this._activeConnections[0] || null; + this._mainConnection = activating || active_vpn || default_ip4 || default_ip6 || this._activeConnections[0] || null; }, _notifyActivated: function(activeConnection) {