diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-05-17 18:14:28 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-08-04 20:22:14 +0200 |
commit | 82129ba288f7561c89bb80e04841ffb46bc29889 (patch) | |
tree | 6736983a40870c76876a4633fb5ca3b730fbf9da | |
parent | winipcfg: do not set MTU in registry after setting it in iphlpapi (diff) | |
download | wireguard-windows-82129ba288f7561c89bb80e04841ffb46bc29889.tar.xz wireguard-windows-82129ba288f7561c89bb80e04841ffb46bc29889.zip |
ui: show update tab but not alert for limited user
Suggested-by: Diab Neiroukh <lazerl0rd@thezest.dev>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | manager/ipc_server.go | 5 | ||||
-rw-r--r-- | ui/ui.go | 2 | ||||
-rw-r--r-- | ui/updatepage.go | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/manager/ipc_server.go b/manager/ipc_server.go index b9b1eb8c..fe195094 100644 --- a/manager/ipc_server.go +++ b/manager/ipc_server.go @@ -290,9 +290,6 @@ func (s *ManagerService) Quit(stopTunnelsOnQuit bool) (alreadyQuit bool, err err } func (s *ManagerService) UpdateState() UpdateState { - if s.elevatedToken == 0 { - return UpdateStateUnknown - } return updateState } @@ -551,7 +548,7 @@ func IPCServerNotifyTunnelsChange() { } func IPCServerNotifyUpdateFound(state UpdateState) { - notifyAll(UpdateFoundNotificationType, true, state) + notifyAll(UpdateFoundNotificationType, false, state) } func IPCServerNotifyUpdateProgress(dp updater.DownloadProgress) { @@ -73,7 +73,7 @@ func RunUI() { switch updateState { case manager.UpdateStateFoundUpdate: mtw.UpdateFound() - if tray != nil { + if tray != nil && IsAdmin { tray.UpdateFound() } case manager.UpdateStateUpdatesDisabledUnofficialBuild: diff --git a/ui/updatepage.go b/ui/updatepage.go index cb76da6f..96fc87f3 100644 --- a/ui/updatepage.go +++ b/ui/updatepage.go @@ -64,6 +64,12 @@ func NewUpdatePage() (*UpdatePage, error) { button.SetImage(updateIcon) button.SetText(l18n.Sprintf("Update Now")) + if !IsAdmin { + button.SetText(l18n.Sprintf("Please ask the system administrator to update.")) + button.SetEnabled(false) + status.SetText(l18n.Sprintf("Status: Waiting for administrator")) + } + walk.NewVSpacer(up) switchToUpdatingState := func() { |