From 714c0eaea568835c02bf324d4f389d962c909747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 2 Aug 2022 11:50:05 +0200 Subject: [PATCH] status/network: Remove WireguardItem Wireguard connections are now covered by the VPN item. Part-of: --- js/ui/status/network.js | 46 ----------------------------------------- 1 file changed, 46 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 64f44a93e..5e0c05634 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1393,49 +1393,6 @@ var NMWirelessDeviceItem = class extends Signals.EventEmitter { } }; -var NMWireguardItem = class extends NMConnectionItem { - _buildUI() { - this.labelItem = new PopupMenu.PopupMenuItem(''); - this.labelItem.connect('activate', this._activate.bind(this)); - - this.radioItem = new PopupMenu.PopupSwitchMenuItem(this._connection.get_id(), false); - this.radioItem.connect('toggled', this._toggle.bind(this)); - } - - _sync() { - let isActive = this.isActive(); - this.labelItem.label.text = isActive ? _('Turn Off') : this._section.getConnectLabel(); - this.radioItem.setToggleState(isActive); - this.emit('icon-changed'); - } - - _connectionStateChanged() { - const state = this._activeConnection?.get_state(); - const reason = this._activeConnection?.get_state_reason(); - - if (state === NM.ActiveConnectionState.DEACTIVATED && - reason !== NM.ActiveConnectionStateReason.NO_SECRETS && - reason !== NM.ActiveConnectionStateReason.USER_DISCONNECTED) - this.emit('activation-failed'); - - this.emit('icon-changed'); - super._connectionStateChanged(); - } - - getIndicatorIcon() { - if (this._activeConnection) { - if (this._activeConnection.state === NM.ActiveConnectionState.UNKNOWN) - return ''; - else if (this._activeConnection.state < NM.ActiveConnectionState.ACTIVATED) - return 'network-vpn-acquiring-symbolic'; - else - return 'network-vpn-symbolic'; - } else { - return ''; - } - } -}; - var NMVpnConnectionItem = class extends NMConnectionItem { _buildUI() { this.labelItem = new PopupMenu.PopupMenuItem(''); @@ -1537,9 +1494,6 @@ var NMVpnSection = class extends NMConnectionSection { } _makeConnectionItem(connection) { - if (connection.get_connection_type() === 'wireguard') - return new NMWireguardItem(this, connection); - return new NMVpnConnectionItem(this, connection); }