aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/ui.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-20 14:18:01 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-20 14:18:01 +0200
commite493f911269a2dabab7b05ec28726cdaeffb660e (patch)
treedb88ec568dfc508da863e67164de909448c66742 /ui/ui.go
parentservice: move route monitor and account for changing index (diff)
downloadwireguard-windows-e493f911269a2dabab7b05ec28726cdaeffb660e.tar.xz
wireguard-windows-e493f911269a2dabab7b05ec28726cdaeffb660e.zip
service: split into tunnel and manager
Diffstat (limited to 'ui/ui.go')
-rw-r--r--ui/ui.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 6805754c..0f91b61e 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -13,7 +13,8 @@ import (
"github.com/lxn/walk"
"github.com/lxn/win"
- "golang.zx2c4.com/wireguard/windows/service"
+
+ "golang.zx2c4.com/wireguard/windows/manager"
"golang.zx2c4.com/wireguard/windows/version"
)
@@ -55,29 +56,29 @@ func RunUI() {
}
}
- service.IPCClientRegisterManagerStopping(func() {
+ manager.IPCClientRegisterManagerStopping(func() {
mtw.Synchronize(func() {
walk.App().Exit(0)
})
})
- onUpdateNotification := func(updateState service.UpdateState) {
- if updateState == service.UpdateStateUnknown {
+ onUpdateNotification := func(updateState manager.UpdateState) {
+ if updateState == manager.UpdateStateUnknown {
return
}
mtw.Synchronize(func() {
switch updateState {
- case service.UpdateStateFoundUpdate:
+ case manager.UpdateStateFoundUpdate:
mtw.UpdateFound()
tray.UpdateFound()
- case service.UpdateStateUpdatesDisabledUnofficialBuild:
+ case manager.UpdateStateUpdatesDisabledUnofficialBuild:
mtw.SetTitle(mtw.Title() + " (unsigned build, no updates)")
}
})
}
- service.IPCClientRegisterUpdateFound(onUpdateNotification)
+ manager.IPCClientRegisterUpdateFound(onUpdateNotification)
go func() {
- updateState, err := service.IPCClientUpdateState()
+ updateState, err := manager.IPCClientUpdateState()
if err == nil {
onUpdateNotification(updateState)
}
@@ -92,7 +93,7 @@ func RunUI() {
mtw.Dispose()
if shouldQuitManagerWhenExiting {
- _, err := service.IPCClientQuit(true)
+ _, err := manager.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)
}