@@ -26,6 +26,7 @@ import (
26
26
"strconv"
27
27
"strings"
28
28
29
+ "github.com/arduino/arduino-create-agent/systray"
29
30
"github.com/arduino/arduino-create-agent/tools"
30
31
"github.com/arduino/arduino-create-agent/upload"
31
32
log "github.com/sirupsen/logrus"
@@ -53,9 +54,11 @@ type hub struct {
53
54
serialPortList * serialPortList
54
55
55
56
tools * tools.Tools
57
+
58
+ systray * systray.Systray
56
59
}
57
60
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 {
59
62
hub := & hub {
60
63
broadcast : make (chan []byte , 1000 ),
61
64
broadcastSys : make (chan []byte , 1000 ),
@@ -65,6 +68,7 @@ func newHub(serialhub *serialhub, serialList *serialPortList, tools *tools.Tools
65
68
serialHub : serialhub ,
66
69
serialPortList : serialList ,
67
70
tools : tools ,
71
+ systray : systray ,
68
72
}
69
73
70
74
hub .serialHub .OnRegister = func (port * serport ) {
@@ -259,10 +263,9 @@ func (h *hub) checkCmd(m []byte) {
259
263
go h .logAction (sl )
260
264
} else if strings .HasPrefix (sl , "restart" ) {
261
265
log .Println ("Received restart from the daemon. Why? Boh" )
262
- // TODO enable them
263
- // Systray.Restart()
266
+ h .systray .Restart ()
264
267
} else if strings .HasPrefix (sl , "exit" ) {
265
- // Systray .Quit()
268
+ h . systray .Quit ()
266
269
} else if strings .HasPrefix (sl , "memstats" ) {
267
270
h .memoryStats ()
268
271
} else if strings .HasPrefix (sl , "gc" ) {
0 commit comments