aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/tray.go
diff options
context:
space:
mode:
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()
+}