2024-01-16 11:14:30 -06:00
|
|
|
// This is a simple example
|
|
|
|
package main
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
import (
|
2024-01-18 05:03:04 -06:00
|
|
|
"go.wit.com/gui"
|
2024-01-20 17:17:48 -06:00
|
|
|
"go.wit.com/lib/debugger"
|
2024-01-20 16:09:15 -06:00
|
|
|
"go.wit.com/lib/gui/logsettings"
|
2024-01-23 22:48:07 -06:00
|
|
|
"go.wit.com/log"
|
2024-01-16 11:14:30 -06:00
|
|
|
// "go.wit.com/gui/gadgets"
|
|
|
|
)
|
|
|
|
|
|
|
|
func globalDisplayOptions(box *gui.Node) {
|
2024-01-20 17:17:48 -06:00
|
|
|
vbox := box.NewVerticalBox("DISPLAYVBOX")
|
2024-01-16 11:14:30 -06:00
|
|
|
|
2024-01-20 17:17:48 -06:00
|
|
|
group1 := vbox.NewGroup("Global Display Options")
|
|
|
|
|
|
|
|
group1.NewButton("Show Repository Window", func() {
|
2024-01-19 18:37:27 -06:00
|
|
|
reposwin.Toggle()
|
2024-01-17 01:55:22 -06:00
|
|
|
})
|
2024-01-23 22:48:07 -06:00
|
|
|
group1.NewButton("Create Release Window", func() {
|
|
|
|
if release.win == nil {
|
|
|
|
log.Info("Creating the Release Window")
|
|
|
|
createReleaseWindow()
|
|
|
|
log.Info("Toggling the Release Window")
|
|
|
|
release.win.Toggle()
|
|
|
|
}
|
|
|
|
log.Info("Toggling the Release Window")
|
|
|
|
release.win.Toggle()
|
|
|
|
release.openrepo.Disable()
|
|
|
|
})
|
2024-01-20 16:09:15 -06:00
|
|
|
/*
|
2024-01-20 17:17:48 -06:00
|
|
|
group1.NewButton("hide all", func() {
|
|
|
|
for repo, _ := range me.allrepos {
|
|
|
|
repo.Hide()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
group1.NewButton("show all", func() {
|
|
|
|
for repo, _ := range me.allrepos {
|
|
|
|
repo.Show()
|
|
|
|
}
|
|
|
|
})
|
2024-01-20 16:09:15 -06:00
|
|
|
*/
|
|
|
|
|
2024-01-24 02:41:34 -06:00
|
|
|
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(false)
|
2024-01-20 16:09:15 -06:00
|
|
|
me.autoHidePerfect.Custom = func() {
|
|
|
|
if me.autoHidePerfect.Checked() {
|
|
|
|
for repo, _ := range me.allrepos {
|
|
|
|
if repo.dirtyLabel.String() == "PERFECT" {
|
|
|
|
repo.Hide()
|
2024-01-16 11:14:30 -06:00
|
|
|
}
|
2024-01-20 16:09:15 -06:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for repo, _ := range me.allrepos {
|
|
|
|
repo.Show()
|
2024-01-16 11:14:30 -06:00
|
|
|
}
|
|
|
|
}
|
2024-01-20 16:09:15 -06:00
|
|
|
}
|
2024-01-16 11:56:55 -06:00
|
|
|
|
2024-01-20 17:17:48 -06:00
|
|
|
group1.NewButton("status.Update() all", func() {
|
2024-01-18 05:03:04 -06:00
|
|
|
for repo, _ := range me.allrepos {
|
2024-01-16 11:14:30 -06:00
|
|
|
repo.status.Update()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2024-01-20 17:17:48 -06:00
|
|
|
group1.NewButton("rescan all", func() {
|
2024-01-18 05:03:04 -06:00
|
|
|
for repo, _ := range me.allrepos {
|
2024-01-16 11:14:30 -06:00
|
|
|
repo.newScan()
|
|
|
|
}
|
|
|
|
})
|
2024-01-20 16:09:15 -06:00
|
|
|
|
2024-01-20 17:17:48 -06:00
|
|
|
group2 := vbox.NewGroup("Debugger")
|
|
|
|
group2.NewButton("logging Window", func() {
|
2024-01-20 16:09:15 -06:00
|
|
|
logsettings.LogWindow()
|
|
|
|
})
|
2024-01-20 17:17:48 -06:00
|
|
|
|
|
|
|
group2.NewButton("Debugger Window", func() {
|
|
|
|
debugger.DebugWindow()
|
|
|
|
})
|
2024-01-16 11:14:30 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func hidePerfect() {
|
2024-01-18 05:03:04 -06:00
|
|
|
for repo, _ := range me.allrepos {
|
2024-01-17 03:57:17 -06:00
|
|
|
if repo.dirtyLabel.String() == "PERFECT" {
|
2024-01-16 11:14:30 -06:00
|
|
|
if repo.hidden {
|
|
|
|
continue
|
|
|
|
}
|
2024-01-19 18:37:27 -06:00
|
|
|
repo.Hide()
|
2024-01-16 11:14:30 -06:00
|
|
|
// return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|