diff options
author | Ruben Pollan <meskio@sindominio.net> | 2019-01-31 17:51:57 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-01-31 17:51:57 +0100 |
commit | 6264cdf8a95c8d924db39168093af78e6b273b80 (patch) | |
tree | 78a4f1712dbb09f9f65729984199c0c4acf8f823 /pkg/systray | |
parent | 0d4ef9c4cb4fd10734d87dd523b790b1fe4bb5c4 (diff) |
[bug] don't initialize the gateway selection before bitmask is ready
- Resolves: #110
Diffstat (limited to 'pkg/systray')
-rw-r--r-- | pkg/systray/systray.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/systray/systray.go b/pkg/systray/systray.go index 20cee44..a575568 100644 --- a/pkg/systray/systray.go +++ b/pkg/systray/systray.go @@ -67,6 +67,11 @@ func (bt *bmTray) onReady() { bt.mStatus = systray.AddMenuItem(printer.Sprintf("Checking status..."), "") bt.mStatus.Disable() + bt.waitCh <- true +} + +func (bt *bmTray) setUpSystray() { + printer := bt.conf.Printer bt.mTurnOn = systray.AddMenuItem(printer.Sprintf("Turn on"), "") bt.mTurnOn.Hide() bt.mTurnOff = systray.AddMenuItem(printer.Sprintf("Turn off"), "") @@ -83,7 +88,6 @@ func (bt *bmTray) onReady() { systray.AddSeparator() bt.mQuit = systray.AddMenuItem(printer.Sprintf("Quit"), "") - bt.waitCh <- true } func (bt *bmTray) loop(bm bitmask.Bitmask, notify *notificator, as bitmask.Autostart) { @@ -93,6 +97,7 @@ func (bt *bmTray) loop(bm bitmask.Bitmask, notify *notificator, as bitmask.Autos bt.bm = bm bt.notify = notify bt.autostart = as + bt.setUpSystray() signalCh := make(chan os.Signal, 1) signal.Notify(signalCh, os.Interrupt) |