[gnome-shell/gnome-3-26] network: Fix visibility of VPN section



commit cb2e26ff10ce842531b207d632afcfed61b3bb50
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Dec 21 16:51:28 2017 +0100

    network: Fix visibility of VPN section
    
    Commit f2a9467f91b was too eager to simplify the code, and removed
    the bits that hid the section in case no VPNs are set up - add them
    back to fix the visibility.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787845

 js/ui/status/network.js | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 9575af7de..ad373f6e6 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1492,6 +1492,15 @@ var NMVPNSection = new Lang.Class({
         this.parent(client);
 
         this.item.menu.addSettingsAction(_("VPN Settings"), 'gnome-network-panel.desktop');
+
+        this._sync();
+    },
+
+    _sync: function() {
+        let nItems = this._connectionItems.size;
+        this.item.actor.visible = (nItems > 0);
+
+        this.parent();
     },
 
     _getDescription: function() {


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