2024-01-16 11:14:30 -06:00
|
|
|
// This is a simple example
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2024-01-16 11:56:55 -06:00
|
|
|
"go.wit.com/log"
|
2024-01-16 11:14:30 -06:00
|
|
|
|
|
|
|
"go.wit.com/gui/gui"
|
|
|
|
// "go.wit.com/gui/gadgets"
|
|
|
|
)
|
|
|
|
|
|
|
|
func globalDisplayOptions(box *gui.Node) {
|
|
|
|
group1 := box.NewGroup("Global Display Options")
|
|
|
|
groupvbox := group1.NewBox("bw vbox", false)
|
|
|
|
// grouphbox := groupvbox.NewBox("bw hbox", true)
|
|
|
|
|
2024-01-17 01:55:22 -06:00
|
|
|
groupvbox.NewButton("Show Repository Window", func () {
|
|
|
|
reposwin.Draw()
|
|
|
|
})
|
2024-01-16 11:14:30 -06:00
|
|
|
me.autoHidePerfect = groupvbox.NewCheckbox("Hide repos")
|
2024-01-16 11:56:55 -06:00
|
|
|
me.autoHidePerfect.Custom = func() {
|
|
|
|
me.autoHidePerfect.SetText("Hide Perfectly clean repos")
|
2024-01-17 03:57:17 -06:00
|
|
|
if me.autoHidePerfect.Bool() {
|
2024-01-16 11:56:55 -06:00
|
|
|
log.Warn("Should hide here")
|
|
|
|
} else {
|
|
|
|
log.Warn("Should show here")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
me.autoHidePerfect.Set(true)
|
2024-01-16 11:14:30 -06:00
|
|
|
|
2024-01-16 11:56:55 -06:00
|
|
|
groupvbox.NewButton("hide perfect", func () {
|
|
|
|
me.autoHidePerfect.SetText("Hide Perfectly clean repos")
|
|
|
|
hidePerfect()
|
|
|
|
})
|
2024-01-16 11:14:30 -06:00
|
|
|
groupvbox.NewButton("show all", func () {
|
|
|
|
for _, repo := range 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 {
|
|
|
|
repo.show()
|
|
|
|
}
|
|
|
|
// return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2024-01-16 11:56:55 -06:00
|
|
|
|
|
|
|
groupvbox.NewButton("reposwin.Hide()", func () {
|
|
|
|
reposwin.Hide()
|
|
|
|
})
|
|
|
|
groupvbox.NewButton("reposwin.Show()", func () {
|
|
|
|
reposwin.Show()
|
2024-01-16 11:14:30 -06:00
|
|
|
})
|
|
|
|
|
|
|
|
groupvbox.NewButton("status.Update() all", func () {
|
|
|
|
for _, repo := range allrepos {
|
|
|
|
repo.status.Update()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
groupvbox.NewButton("rescan all", func () {
|
|
|
|
for _, repo := range allrepos {
|
|
|
|
repo.newScan()
|
|
|
|
}
|
|
|
|
})
|
2024-01-17 20:52:07 -06:00
|
|
|
groupvbox.NewButton("repoworld()", func () {
|
|
|
|
repoworld()
|
|
|
|
})
|
2024-01-16 11:14:30 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func hidePerfect() {
|
|
|
|
for _, repo := range 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
|
|
|
|
}
|
|
|
|
repo.hide()
|
|
|
|
// return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repo) hide() {
|
|
|
|
r.pLabel.Hide()
|
|
|
|
r.lastTag.Hide()
|
|
|
|
r.vLabel.Hide()
|
|
|
|
|
|
|
|
r.masterName.Hide()
|
|
|
|
r.masterVersion.Hide()
|
|
|
|
r.develName.Hide()
|
|
|
|
r.develVersion.Hide()
|
|
|
|
r.userName.Hide()
|
|
|
|
r.userVersion.Hide()
|
|
|
|
r.dirtyLabel.Hide()
|
|
|
|
r.showButton.Hide()
|
|
|
|
r.hidden = true
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *repo) show() {
|
|
|
|
r.pLabel.Show()
|
|
|
|
r.lastTag.Show()
|
|
|
|
r.vLabel.Show()
|
|
|
|
|
|
|
|
r.masterName.Show()
|
|
|
|
r.masterVersion.Show()
|
|
|
|
r.develName.Show()
|
|
|
|
r.develVersion.Show()
|
|
|
|
r.userName.Show()
|
|
|
|
r.userVersion.Show()
|
|
|
|
r.dirtyLabel.Show()
|
|
|
|
r.showButton.Show()
|
|
|
|
r.hidden = false
|
|
|
|
}
|