@@ -26,6 +26,7 @@ import (
2626 "strconv"
2727 "strings"
2828
29+ "github.com/arduino/arduino-create-agent/systray"
2930 "github.com/arduino/arduino-create-agent/tools"
3031 "github.com/arduino/arduino-create-agent/upload"
3132 log "github.com/sirupsen/logrus"
@@ -53,9 +54,11 @@ type hub struct {
5354 serialPortList * serialPortList
5455
5556 tools * tools.Tools
57+
58+ systray * systray.Systray
5659}
5760
58- func newHub (serialhub * serialhub , serialList * serialPortList , tools * tools.Tools ) * hub {
61+ func newHub (serialhub * serialhub , serialList * serialPortList , tools * tools.Tools , systray * systray. Systray ) * hub {
5962 hub := & hub {
6063 broadcast : make (chan []byte , 1000 ),
6164 broadcastSys : make (chan []byte , 1000 ),
@@ -65,6 +68,7 @@ func newHub(serialhub *serialhub, serialList *serialPortList, tools *tools.Tools
6568 serialHub : serialhub ,
6669 serialPortList : serialList ,
6770 tools : tools ,
71+ systray : systray ,
6872 }
6973
7074 hub .serialHub .OnRegister = func (port * serport ) {
@@ -259,10 +263,9 @@ func (h *hub) checkCmd(m []byte) {
259263 go h .logAction (sl )
260264 } else if strings .HasPrefix (sl , "restart" ) {
261265 log .Println ("Received restart from the daemon. Why? Boh" )
262- // TODO enable them
263- // Systray.Restart()
266+ h .systray .Restart ()
264267 } else if strings .HasPrefix (sl , "exit" ) {
265- // Systray .Quit()
268+ h . systray .Quit ()
266269 } else if strings .HasPrefix (sl , "memstats" ) {
267270 h .memoryStats ()
268271 } else if strings .HasPrefix (sl , "gc" ) {
0 commit comments