aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/tray.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-05 13:51:26 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-05 13:54:37 +0200
commit29cff0115268ba5b21613a922f18555a7c34ec21 (patch)
tree5d154ce550da59daab00f68e0717b60def94644e /ui/tray.go
parentui: syntax: implement trafic blocking semantics (diff)
downloadwireguard-windows-29cff0115268ba5b21613a922f18555a7c34ec21.tar.xz
wireguard-windows-29cff0115268ba5b21613a922f18555a7c34ec21.zip
ui: improve update logging and tray logic
Diffstat (limited to 'ui/tray.go')
-rw-r--r--ui/tray.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/ui/tray.go b/ui/tray.go
index 0597f589..c5902359 100644
--- a/ui/tray.go
+++ b/ui/tray.go
@@ -73,9 +73,9 @@ func (tray *Tray) setup() error {
{separator: true},
{separator: true},
{label: "&Manage tunnels...", handler: tray.onManageTunnels, enabled: true, defawlt: true},
- {label: "&Import tunnel(s) from file...", handler: tray.mtw.tunnelsPage.onImport, enabled: true},
+ {label: "&Import tunnel(s) from file...", handler: tray.onImport, enabled: true},
{separator: true},
- {label: "&About WireGuard", handler: func() { onAbout(tray.mtw) }, enabled: true},
+ {label: "&About WireGuard", handler: tray.onAbout, enabled: true},
{label: "&Exit", handler: onQuit, enabled: true},
} {
var action *walk.Action
@@ -320,3 +320,16 @@ func (tray *Tray) onManageTunnels() {
}
tray.mtw.Show()
}
+
+func (tray *Tray) onAbout() {
+ if tray.mtw.Visible() {
+ onAbout(tray.mtw)
+ } else {
+ onAbout(nil)
+ }
+}
+
+func (tray *Tray) onImport() {
+ tray.mtw.Show()
+ tray.mtw.tunnelsPage.onImport()
+}