[gnome-shell] status/network: Remove status from VPN item



commit 9bca544dd6a0b2fdbb7fb8911f7fabf982dee4d6
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Aug 2 11:33:37 2022 +0200

    status/network: Remove status from VPN item
    
    It's odd to swap out a switch with a status label, and the
    information isn't that helpful to begin with: It's either
    transient (connecting, deactivating, ...), or too little to
    be meaningful (unknown, failed, ...).
    
    We're also perfectly happy to not show it in "label mode"
    (i.e. when there's just one VPN).
    
    Just get rid of it.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2406>

 js/ui/status/network.js | 44 --------------------------------------------
 1 file changed, 44 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index ff9c29650f..547dadc361 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1406,30 +1406,9 @@ var NMWireguardItem = class extends NMConnectionItem {
         let isActive = this.isActive();
         this.labelItem.label.text = isActive ? _('Turn Off') : this._section.getConnectLabel();
         this.radioItem.setToggleState(isActive);
-        this.radioItem.setStatus(this._getStatus());
         this.emit('icon-changed');
     }
 
-    _getStatus() {
-        if (this._activeConnection === null)
-            return null;
-
-        switch (this._activeConnection.state) {
-        case NM.ActiveConnectionState.UNKNOWN:
-            return _('unknown');
-        case NM.ActiveConnectionState.ACTIVATING:
-            return _('activating…');
-        case NM.ActiveConnectionState.ACTIVATED:
-            return null;
-        case NM.ActiveConnectionState.DEACTIVATING:
-            return _('deactivating…');
-        case NM.ActiveConnectionState.DEACTIVATED:
-            return _('deactivated');
-        default:
-            return 'invalid';
-        }
-    }
-
     _connectionStateChanged() {
         const state = this._activeConnection?.get_state();
         const reason = this._activeConnection?.get_state_reason();
@@ -1477,32 +1456,9 @@ var NMVpnConnectionItem = class extends NMConnectionItem {
         let isActive = this.isActive();
         this.labelItem.label.text = isActive ? _("Turn Off") : this._section.getConnectLabel();
         this.radioItem.setToggleState(isActive);
-        this.radioItem.setStatus(this._getStatus());
         this.emit('icon-changed');
     }
 
-    _getStatus() {
-        if (this._activeConnection == null)
-            return null;
-
-        switch (this._activeConnection.vpn_state) {
-        case NM.VpnConnectionState.DISCONNECTED:
-        case NM.VpnConnectionState.ACTIVATED:
-            return null;
-        case NM.VpnConnectionState.PREPARE:
-        case NM.VpnConnectionState.CONNECT:
-        case NM.VpnConnectionState.IP_CONFIG_GET:
-            return _("connecting…");
-        case NM.VpnConnectionState.NEED_AUTH:
-            /* Translators: this is for network connections that require some kind of key or password */
-            return _("authentication required");
-        case NM.VpnConnectionState.FAILED:
-            return _("connection failed");
-        default:
-            return 'invalid';
-        }
-    }
-
     _connectionStateChanged(ac, newstate, reason) {
         if (newstate === NM.VpnConnectionState.FAILED &&
             reason !== NM.VpnConnectionStateReason.NO_SECRETS)


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