diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-20 14:18:01 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-05-20 14:18:01 +0200 |
commit | e493f911269a2dabab7b05ec28726cdaeffb660e (patch) | |
tree | db88ec568dfc508da863e67164de909448c66742 /ui/ui.go | |
parent | service: move route monitor and account for changing index (diff) | |
download | wireguard-windows-e493f911269a2dabab7b05ec28726cdaeffb660e.tar.xz wireguard-windows-e493f911269a2dabab7b05ec28726cdaeffb660e.zip |
service: split into tunnel and manager
Diffstat (limited to '')
-rw-r--r-- | ui/ui.go | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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) } |