aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/tray.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-14 14:02:33 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-14 14:02:33 +0200
commitccfee260c14fa53ac6f16a1ce249dec89af5dc64 (patch)
tree2a4966a13f87385863097b3f1ba2d6cd939f3ece /ui/tray.go
parentui: update progress indicator when created (diff)
downloadwireguard-windows-ccfee260c14fa53ac6f16a1ce249dec89af5dc64.tar.xz
wireguard-windows-ccfee260c14fa53ac6f16a1ce249dec89af5dc64.zip
ui: centralize state labels
Diffstat (limited to 'ui/tray.go')
-rw-r--r--ui/tray.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/ui/tray.go b/ui/tray.go
index 749748ea..7b5e55ca 100644
--- a/ui/tray.go
+++ b/ui/tray.go
@@ -234,28 +234,23 @@ func (tray *Tray) updateGlobalState(globalState service.TunnelState) {
}
}
+ tray.SetToolTip(fmt.Sprintf("WireGuard: %s", textForState(globalState, true)))
+ statusAction.SetText(fmt.Sprintf("Status: %s", textForState(globalState, false)))
+
switch globalState {
case service.TunnelStarting:
- statusAction.SetText("Status: Activating")
setTunnelActionsEnabled(false)
- tray.SetToolTip("WireGuard: Activating...")
case service.TunnelStarted:
activeCIDRsAction.SetVisible(true)
- statusAction.SetText("Status: Active")
setTunnelActionsEnabled(true)
- tray.SetToolTip("WireGuard: Activated")
case service.TunnelStopping:
- statusAction.SetText("Status: Deactivating")
setTunnelActionsEnabled(false)
- tray.SetToolTip("WireGuard: Deactivating...")
case service.TunnelStopped:
activeCIDRsAction.SetVisible(false)
- statusAction.SetText("Status: Inactive")
setTunnelActionsEnabled(true)
- tray.SetToolTip("WireGuard: Deactivated")
}
}