Skip to content

Commit dbb533d

Browse files
committed
rename quitSysTray and fix indentation
1 parent 8c60f35 commit dbb533d

File tree

4 files changed

+14
-16
lines changed

4 files changed

+14
-16
lines changed

hub.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,8 @@ func checkCmd(m []byte) {
211211
go spBaudRates()
212212
} else if strings.HasPrefix(sl, "restart") {
213213
log.Println("Received restart from the daemon. Why? Boh")
214-
quitSystray()
215214
restart("")
216215
} else if strings.HasPrefix(sl, "exit") {
217-
quitSystray()
218216
exit()
219217
} else if strings.HasPrefix(sl, "memstats") {
220218
memoryStats()
@@ -272,6 +270,7 @@ func garbageCollection() {
272270
}
273271

274272
func exit() {
273+
quitSysTray()
275274
log.Println("Starting new spjs process")
276275
h.broadcastSys <- []byte("{\"Exiting\" : true}")
277276
log.Fatal("Exited current spjs cuz asked to")
@@ -280,6 +279,7 @@ func exit() {
280279

281280
func restart(path string) {
282281
log.Println("called restart", path)
282+
quitSysTray()
283283
// relaunch ourself and exit
284284
// the relaunch works because we pass a cmdline in
285285
// that has serial-port-json-server only initialize 5 seconds later

main.go

+10-12
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,16 @@ import (
2424
)
2525

2626
var (
27-
version = "x.x.x-dev" //don't modify it, Jenkins will take care
28-
git_revision = "xxxxxxxx" //don't modify it, Jenkins will take care
29-
embedded_autoextract = false
30-
hibernate = flag.Bool("hibernate", false, "start hibernated")
31-
verbose = flag.Bool("v", true, "show debug logging")
32-
//verbose = flag.Bool("v", false, "show debug logging")
33-
isLaunchSelf = flag.Bool("ls", false, "launch self 5 seconds later")
34-
configIni = flag.String("configFile", "config.ini", "config file path")
35-
regExpFilter = flag.String("regex", "usb|acm|com", "Regular expression to filter serial port list")
36-
gcType = flag.String("gc", "std", "Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)")
37-
logDump = flag.String("log", "off", "off = (default)")
38-
// hostname. allow user to override, otherwise we look it up
27+
version = "x.x.x-dev" //don't modify it, Jenkins will take care
28+
git_revision = "xxxxxxxx" //don't modify it, Jenkins will take care
29+
embedded_autoextract = false
30+
hibernate = flag.Bool("hibernate", false, "start hibernated")
31+
verbose = flag.Bool("v", true, "show debug logging")
32+
isLaunchSelf = flag.Bool("ls", false, "launch self 5 seconds later")
33+
configIni = flag.String("configFile", "config.ini", "config file path")
34+
regExpFilter = flag.String("regex", "usb|acm|com", "Regular expression to filter serial port list")
35+
gcType = flag.String("gc", "std", "Type of garbage collection. std = Normal garbage collection allowing system to decide (this has been known to cause a stop the world in the middle of a CNC job which can cause lost responses from the CNC controller and thus stalled jobs. use max instead to solve.), off = let memory grow unbounded (you have to send in the gc command manually to garbage collect or you will run out of RAM eventually), max = Force garbage collection on each recv or send on a serial port (this minimizes stop the world events and thus lost serial responses, but increases CPU usage)")
36+
logDump = flag.String("log", "off", "off = (default)")
3937
hostname = flag.String("hostname", "unknown-hostname", "Override the hostname we get from the OS")
4038
updateUrl = flag.String("updateUrl", "", "")
4139
appName = flag.String("appName", "", "")

trayicon.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,6 @@ func setupSysTrayHibernate() {
128128
}()
129129
}
130130

131-
func quitSystray() {
131+
func quitSysTray() {
132132
systray.Quit()
133133
}

trayicon_linux_arm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ func addRebootTrayElement() {
3737
select {}
3838
}
3939

40-
func quitSystray() {
40+
func quitSysTray() {
4141
}

0 commit comments

Comments
 (0)