autotypist/globalDisplayOptions.go

80 lines
1.5 KiB
Go

// This is a simple example
package main
import (
"go.wit.com/gui"
"go.wit.com/lib/debugger"
"go.wit.com/lib/gui/logsettings"
// "go.wit.com/gui/gadgets"
)
func globalDisplayOptions(box *gui.Node) {
vbox := box.NewVerticalBox("DISPLAYVBOX")
group1 := vbox.NewGroup("Global Display Options")
group1.NewButton("Show Repository Window", func() {
reposwin.Toggle()
})
/*
group1.NewButton("hide all", func() {
for repo, _ := range me.allrepos {
repo.Hide()
}
})
group1.NewButton("show all", func() {
for repo, _ := range me.allrepos {
repo.Show()
}
})
*/
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(true)
me.autoHidePerfect.Custom = func() {
if me.autoHidePerfect.Checked() {
for repo, _ := range me.allrepos {
if repo.dirtyLabel.String() == "PERFECT" {
repo.Hide()
}
}
} else {
for repo, _ := range me.allrepos {
repo.Show()
}
}
}
group1.NewButton("status.Update() all", func() {
for repo, _ := range me.allrepos {
repo.status.Update()
}
})
group1.NewButton("rescan all", func() {
for repo, _ := range me.allrepos {
repo.newScan()
}
})
group2 := vbox.NewGroup("Debugger")
group2.NewButton("logging Window", func() {
logsettings.LogWindow()
})
group2.NewButton("Debugger Window", func() {
debugger.DebugWindow()
})
}
func hidePerfect() {
for repo, _ := range me.allrepos {
if repo.dirtyLabel.String() == "PERFECT" {
if repo.hidden {
continue
}
repo.Hide()
// return
}
}
}