73 lines
1.4 KiB
Go
73 lines
1.4 KiB
Go
// This is a simple example
|
|
package main
|
|
|
|
import (
|
|
"go.wit.com/gui"
|
|
"go.wit.com/lib/gui/logsettings"
|
|
// "go.wit.com/gui/gadgets"
|
|
)
|
|
|
|
func globalDisplayOptions(box *gui.Node) {
|
|
group1 := box.NewGroup("Global Display Options")
|
|
groupvbox := group1.NewBox("bw vbox", false)
|
|
|
|
groupvbox.NewButton("Show Repository Window", func() {
|
|
reposwin.Toggle()
|
|
})
|
|
/*
|
|
groupvbox.NewButton("hide all", func() {
|
|
for repo, _ := range me.allrepos {
|
|
repo.Hide()
|
|
}
|
|
})
|
|
groupvbox.NewButton("show all", func() {
|
|
for repo, _ := range me.allrepos {
|
|
repo.Show()
|
|
}
|
|
})
|
|
*/
|
|
|
|
me.autoHidePerfect = groupvbox.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()
|
|
}
|
|
}
|
|
}
|
|
|
|
groupvbox.NewButton("status.Update() all", func() {
|
|
for repo, _ := range me.allrepos {
|
|
repo.status.Update()
|
|
}
|
|
})
|
|
|
|
groupvbox.NewButton("rescan all", func() {
|
|
for repo, _ := range me.allrepos {
|
|
repo.newScan()
|
|
}
|
|
})
|
|
|
|
groupvbox.NewButton("logging enable/disable", func() {
|
|
logsettings.LogWindow()
|
|
})
|
|
}
|
|
|
|
func hidePerfect() {
|
|
for repo, _ := range me.allrepos {
|
|
if repo.dirtyLabel.String() == "PERFECT" {
|
|
if repo.hidden {
|
|
continue
|
|
}
|
|
repo.Hide()
|
|
// return
|
|
}
|
|
}
|
|
}
|