aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/ui.go
diff options
context:
space:
mode:
authorAnthony Dong <aanthony.dong@gmail.com>2019-03-25 18:09:50 +0100
committerAlexander Neumann <alexander.neumann@picos-software.com>2019-04-23 11:04:59 +0200
commit3019716120e97bfa1b2333af61451cdc3aeb99bd (patch)
tree7ed3a496068079b8b4dd3b5e3d157f2b250ba4e0 /ui/ui.go
parentui: add tunnels tableview (diff)
downloadwireguard-windows-3019716120e97bfa1b2333af61451cdc3aeb99bd.tar.xz
wireguard-windows-3019716120e97bfa1b2333af61451cdc3aeb99bd.zip
ui: add tunnels management view
Signed-off-by: Anthony Dong <aanthony.dong@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'ui/ui.go')
-rw-r--r--ui/ui.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/ui/ui.go b/ui/ui.go
index d3bd7b54..633fc19b 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -7,15 +7,16 @@ package ui
import (
"fmt"
+ "os"
+ "runtime"
+ "time"
+
"github.com/lxn/walk"
"github.com/lxn/win"
"golang.zx2c4.com/wireguard/windows/conf"
"golang.zx2c4.com/wireguard/windows/ringlogger"
"golang.zx2c4.com/wireguard/windows/service"
"golang.zx2c4.com/wireguard/windows/ui/syntax"
- "os"
- "runtime"
- "time"
)
const testInterfaceName = "test"
@@ -195,11 +196,7 @@ func RunUI() {
quitAction.SetText("Exit")
quit = func() {
tray.Dispose()
- _, err := service.IPCClientQuit(true)
- if err != nil {
- walk.MsgBox(nil, "Error Exiting WireGuard", fmt.Sprintf("Unable to exit service due to: %s. You may want to stop WireGuard from the service manager.", err), walk.MsgBoxIconError)
- os.Exit(1)
- }
+ onQuit()
}
quitAction.Triggered().Attach(quit)
tray.ContextMenu().Actions().Add(quitAction)
@@ -293,3 +290,11 @@ func RunUI() {
mw.Run()
}
+
+func onQuit() {
+ _, err := service.IPCClientQuit(true)
+ if err != nil {
+ walk.MsgBox(nil, "Error Exiting WireGuard", fmt.Sprintf("Unable to exit service due to: %s. You may want to stop WireGuard from the service manager.", err), walk.MsgBoxIconError)
+ os.Exit(1)
+ }
+}