summaryrefslogtreecommitdiff
path: root/debug.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-05-24 11:32:47 -0700
committerJeff Carr <[email protected]>2019-05-24 11:32:47 -0700
commit8730dbc4dd5e36d5fbbc8ce784e1ad70242cbb69 (patch)
tree113f20223fdf1c24c0ff2fc434cdb2c2939d0427 /debug.go
parent171390c10095dd855cddcfbec82527c83ffedfe8 (diff)
move all structs into a common file
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'debug.go')
-rw-r--r--debug.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/debug.go b/debug.go
index 7f7571b..82e64af 100644
--- a/debug.go
+++ b/debug.go
@@ -5,6 +5,7 @@ import "time"
import "fmt"
import "strings"
import "os/exec"
+import "runtime"
import "github.com/gookit/config"
@@ -17,7 +18,7 @@ import _ "github.com/andlabs/ui/winmanifest"
// can not pass any args to this (?)
func setupCloudUI() {
- Data.cloudWindow = ui.NewWindow("Cloud Control Panel", config.Int("width"), config.Int("height"), false)
+ Data.cloudWindow = ui.NewWindow("Cloud Control Panel", Data.Width, config.Int("height"), false)
Data.cloudWindow.OnClosing(func(*ui.Window) bool {
ui.Quit()
return true
@@ -112,11 +113,18 @@ func addDebuggingButtons(vbox *ui.Box, custom func(*ButtonMap, string)) {
vbox.Append(CreateButton("DEBUG goroutines", "DEBUG", custom), false)
vbox.Append(CreateButton("xterm", "XTERM", runTestExecClick), false)
+ vbox.Append(CreateButton("Load test.json config file", "CONFIG", custom), false)
}
func runTestExecClick(b *ButtonMap, msg string) {
log.Println("runTestExecClick START")
- go runCommand("xterm -report-fonts")
+ if runtime.GOOS == "linux" {
+ go runCommand("xterm -report-fonts")
+ } else if runtime.GOOS == "windows" {
+ go runCommand("cmd.exe")
+ } else {
+ go runCommand("xterm")
+ }
log.Println("runTestExecClick END")
}