summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-08-23 18:56:53 +0200
committerRuben Pollan <meskio@sindominio.net>2018-08-23 18:56:53 +0200
commit60310f3bf825989636904da411340bec8e711e2a (patch)
treef4f8c1e5b5b8cd3aee199dea4ab3cf114eb1e43e
parent7d6853c5d585bd9630792be1446dfc3c824a3b0d (diff)
[feat] fake state on click
Let's change the systray state as soon as the user clicks on it, instead of waiting for openvpn to notify the status change.
-rw-r--r--systray.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/systray.go b/systray.go
index 1507ff6..1281a77 100644
--- a/systray.go
+++ b/systray.go
@@ -105,14 +105,17 @@ func (bt *bmTray) onReady() {
case <-bt.mTurnOn.ClickedCh:
log.Println("on")
+ bt.changeStatus("starting")
bt.bm.StartVPN(provider)
bt.conf.setUserStoppedVPN(false)
case <-bt.mTurnOff.ClickedCh:
log.Println("off")
+ bt.changeStatus("stopping")
bt.bm.StopVPN()
bt.conf.setUserStoppedVPN(true)
case <-bt.mCancel.ClickedCh:
log.Println("cancel")
+ bt.changeStatus("stopping")
bt.bm.StopVPN()
bt.conf.setUserStoppedVPN(true)