mirror of
https://github.com/amnezia-vpn/amneziawg-windows-client.git
synced 2026-06-02 06:23:38 +02:00
remove application update feature #2
This commit is contained in:
-33
@@ -8,7 +8,6 @@ package ui
|
|||||||
import (
|
import (
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/amnezia-vpn/amneziawg-windows-client/l18n"
|
"github.com/amnezia-vpn/amneziawg-windows-client/l18n"
|
||||||
"github.com/amnezia-vpn/amneziawg-windows-client/manager"
|
"github.com/amnezia-vpn/amneziawg-windows-client/manager"
|
||||||
@@ -340,38 +339,6 @@ func (tray *Tray) setTunnelState(tunnel *manager.Tunnel, state manager.TunnelSta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (tray *Tray) UpdateFound() {
|
|
||||||
action := walk.NewAction()
|
|
||||||
action.SetText(l18n.Sprintf("An Update is Available!"))
|
|
||||||
menuIcon, _ := loadShieldIcon(16)
|
|
||||||
action.SetImage(menuIcon)
|
|
||||||
action.SetDefault(true)
|
|
||||||
showUpdateTab := func() {
|
|
||||||
if !tray.mtw.Visible() {
|
|
||||||
tray.mtw.tunnelsPage.listView.SelectFirstActiveTunnel()
|
|
||||||
}
|
|
||||||
tray.mtw.tabs.SetCurrentIndex(2)
|
|
||||||
raise(tray.mtw.Handle())
|
|
||||||
}
|
|
||||||
action.Triggered().Attach(showUpdateTab)
|
|
||||||
tray.clicked = showUpdateTab
|
|
||||||
tray.ContextMenu().Actions().Insert(tray.ContextMenu().Actions().Len()-2, action)
|
|
||||||
|
|
||||||
showUpdateBalloon := func() {
|
|
||||||
icon, _ := loadShieldIcon(128)
|
|
||||||
tray.ShowCustom(l18n.Sprintf("WireGuard Update Available"), l18n.Sprintf("An update to WireGuard is now available. You are advised to update as soon as possible."), icon)
|
|
||||||
}
|
|
||||||
|
|
||||||
timeSinceStart := time.Now().Sub(startTime)
|
|
||||||
if timeSinceStart < time.Second*3 {
|
|
||||||
time.AfterFunc(time.Second*3-timeSinceStart, func() {
|
|
||||||
tray.mtw.Synchronize(showUpdateBalloon)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
showUpdateBalloon()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (tray *Tray) onManageTunnels() {
|
func (tray *Tray) onManageTunnels() {
|
||||||
tray.mtw.tunnelsPage.listView.SelectFirstActiveTunnel()
|
tray.mtw.tunnelsPage.listView.SelectFirstActiveTunnel()
|
||||||
tray.mtw.tabs.SetCurrentIndex(0)
|
tray.mtw.tabs.SetCurrentIndex(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user