summaryrefslogtreecommitdiff
path: root/systray.go
diff options
context:
space:
mode:
Diffstat (limited to 'systray.go')
-rw-r--r--systray.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/systray.go b/systray.go
index 28aeb29..1507ff6 100644
--- a/systray.go
+++ b/systray.go
@@ -39,6 +39,7 @@ type bmTray struct {
mDonate *systray.MenuItem
mCancel *systray.MenuItem
activeGateway *gatewayTray
+ autostart autostart
}
type gatewayTray struct {
@@ -46,8 +47,8 @@ type gatewayTray struct {
name string
}
-func run(bm bitmask.Bitmask, conf *systrayConfig, notify *notificator) {
- bt := bmTray{bm: bm, conf: conf, notify: notify}
+func run(bm bitmask.Bitmask, conf *systrayConfig, notify *notificator, as autostart) {
+ bt := bmTray{bm: bm, conf: conf, notify: notify, autostart: as}
systray.Run(bt.onReady, bt.onExit)
}
@@ -131,6 +132,10 @@ func (bt *bmTray) onReady() {
bt.notify.about(versionStr)
case <-mQuit.ClickedCh:
+ err := bt.autostart.Disable()
+ if err != nil {
+ log.Printf("Error disabling autostart: %v", err)
+ }
systray.Quit()
case <-signalCh:
systray.Quit()