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 @@ -255,6 +255,7 @@ func loop() {
255
255
if err != nil {
256
256
log .Panicf ("cannot parse arguments: %s" , err )
257
257
}
258
+ Systray .SetCurrentConfigFile (configPath )
258
259
259
260
// Parse additional ini config if defined
260
261
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
@@ -38,6 +39,8 @@ type Systray struct {
38
39
ConfigDir * paths.Path
39
40
// The path of the exe (only used in update)
40
41
path string
42
+ // The path of the configuration file
43
+ currentConfigFilePath * paths.Path
41
44
}
42
45
43
46
// Restart restarts the program
@@ -94,3 +97,9 @@ func (s *Systray) Update(path string) {
94
97
s .path = path
95
98
s .Restart ()
96
99
}
100
+
101
+ // SetCurrentConfigFile allows to specify the path of the configuration file the agent
102
+ // is using. The tray menu with this info can display an "open config file" option.
103
+ func (s * Systray ) SetCurrentConfigFile (configPath * paths.Path ) {
104
+ s .currentConfigFilePath = configPath
105
+ }
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 .currentConfigFilePath .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