File tree 3 files changed +13
-0
lines changed
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,7 @@ func loop() {
257
257
if err != nil {
258
258
log .Panicf ("cannot parse arguments: %s" , err )
259
259
}
260
+ Systray .SetConfig (configPath )
260
261
261
262
// Parse additional ini config if defined
262
263
if len (* additionalConfig ) > 0 {
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
21
21
"os/exec"
22
22
"strings"
23
23
24
+ "github.com/arduino/go-paths-helper"
24
25
log "github.com/sirupsen/logrus"
25
26
)
26
27
@@ -36,6 +37,8 @@ type Systray struct {
36
37
AdditionalConfig string
37
38
// The path of the exe (only used in update)
38
39
path string
40
+ // The path of the configuration file
41
+ configPath * paths.Path
39
42
}
40
43
41
44
// Restart restarts the program
@@ -92,3 +95,9 @@ func (s *Systray) Update(path string) {
92
95
s .path = path
93
96
s .Restart ()
94
97
}
98
+
99
+ // SetConfig allows to specify the path of the configuration the agent is using.
100
+ // The tray menu with this info can display an "open config file" option
101
+ func (s * Systray ) SetConfig (configPath * paths.Path ) {
102
+ s .configPath = configPath
103
+ }
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ func (s *Systray) start() {
57
57
// Add links
58
58
mURL := systray .AddMenuItem ("Go to Arduino Create" , "Arduino Create" )
59
59
mDebug := systray .AddMenuItem ("Open Debug Console" , "Debug console" )
60
+ mConfig := systray .AddMenuItem ("Open Configuration" , "Config File" )
60
61
61
62
// Remove crash-reports
62
63
mRmCrashes := systray .AddMenuItem ("Remove crash reports" , "" )
@@ -78,6 +79,8 @@ func (s *Systray) start() {
78
79
_ = open .Start ("https://create.arduino.cc" )
79
80
case <- mDebug .ClickedCh :
80
81
_ = open .Start (s .DebugURL ())
82
+ case <- mConfig .ClickedCh :
83
+ _ = open .Start (s .configPath .String ())
81
84
case <- mRmCrashes .ClickedCh :
82
85
s .RemoveCrashes ()
83
86
s .updateMenuItem (mRmCrashes , s .CrashesIsEmpty ())
You can’t perform that action at this time.
0 commit comments