[gnome-shell/wip/aggregate-menu: 45/99] network: Always show the VPN indicator when connected to VPN



commit bc206b8fba36e6f989420fa57a0c2429aa7c6113
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri May 31 19:03:09 2013 -0400

    network: Always show the VPN indicator when connected to VPN
    
    The new designs ask for an indicator per connected device. For now,
    limit ourselves to two icons, but we'll soon change this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701954

 js/ui/status/network.js |   23 ++++++++---------------
 1 files changed, 8 insertions(+), 15 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 4088659..101ed86 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1468,8 +1468,8 @@ const NMApplet = new Lang.Class({
     _init: function() {
         this.parent('network-offline-symbolic', _('Network'));
 
-        this.secondaryIcon = this.addIcon(new Gio.ThemedIcon({ name: 'network-vpn-symbolic' }));
-        this.secondaryIcon.hide();
+        this._vpnIcon = this.addIcon(null);
+        this._vpnIcon.hide();
 
         // Device types
         this._dtypes = { };
@@ -2080,21 +2080,14 @@ const NMApplet = new Lang.Class({
 
         // update VPN indicator
         if (this._vpnConnection) {
-            let vpnIconName = 'network-vpn-symbolic';
             if (this._vpnConnection.state == NetworkManager.ActiveConnectionState.ACTIVATING)
-                vpnIconName = 'network-vpn-acquiring-symbolic';
-
-            // only show a separate icon when we're using a wireless/3g connection
-            if (mc._section == NMConnectionCategory.WIRELESS || 
-                mc._section == NMConnectionCategory.WWAN) {
-                this.secondaryIcon.icon_name = vpnIconName;
-                this.secondaryIcon.show();
-            } else {
-                this.setIcon(vpnIconName);
-                this.secondaryIcon.hide();
-            }
+                this._vpnIcon.icon_name = 'network-vpn-acquiring-symbolic';
+            else
+                this._vpnIcon.icon_name = 'network-vpn-symbolic';
+
+            this._vpnIcon.show();
         } else {
-            this.secondaryIcon.hide();
+            this._vpnIcon.hide();
         }
     }
 });


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