aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/Tunnel
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-16 01:00:42 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-16 01:26:10 +0530
commite29cf19fddc6878f7e24c442f83d6ff0d23fa6b8 (patch)
tree6b7a098cd40dda417d1827af5245669bc883fa88 /WireGuard/WireGuard/Tunnel
parentmacOS: Add About dialog (diff)
downloadwireguard-apple-e29cf19fddc6878f7e24c442f83d6ff0d23fa6b8.tar.xz
wireguard-apple-e29cf19fddc6878f7e24c442f83d6ff0d23fa6b8.zip
macOS: Different status bar icon looks for different states
- Looks dimmed when no tunnel is active - Looks normal when a tunnel is active - Animates when a tunnel is activating Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/Tunnel')
-rw-r--r--WireGuard/WireGuard/Tunnel/TunnelsManager.swift4
1 files changed, 4 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
index 4476c4a..1b3cc50 100644
--- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
+++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
@@ -222,6 +222,10 @@ class TunnelsManager {
return tunnels.first { $0.name == tunnelName }
}
+ func waitingTunnel() -> TunnelContainer? {
+ return tunnels.first { $0.status == .waiting }
+ }
+
func startActivation(of tunnel: TunnelContainer) {
guard tunnels.contains(tunnel) else { return } // Ensure it's not deleted
guard tunnel.status == .inactive else {