repolist count widet works

This commit is contained in:
Jeff Carr 2024-02-19 19:41:48 -06:00
parent 87b3e5fafc
commit bc644664bc
2 changed files with 46 additions and 43 deletions

View File

@ -9,49 +9,45 @@ import (
"go.wit.com/log"
)
func globalDisplaySetRepoState() {
for _, repo := range repolist.AllRepos() {
if repo.Status.IsDirty() {
repo.Show()
continue
}
if me.autoHideReadOnly.Checked() {
if repo.Status.ReadOnly() {
repo.Hide()
continue
}
}
if me.autoHidePerfect.Checked() {
if repo.IsPerfect() {
repo.Hide()
continue
}
}
repo.Show()
func hideFunction(r *repolist.Repo) {
if r.Status.IsDirty() {
r.Show()
return
}
if me.autoHideReadOnly.Checked() {
if r.Status.ReadOnly() {
r.Hide()
return
}
}
if me.autoHidePerfect.Checked() {
if r.IsPerfect() {
r.Hide()
return
}
}
r.Show()
}
func globalDisplayShow() {
for _, repo := range repolist.AllRepos() {
if me.autoHideReadOnly.Checked() {
if repo.Status.ReadOnly() {
continue
}
func hideFunction2(repo *repolist.Repo) {
if me.autoHideReadOnly.Checked() {
if repo.Status.ReadOnly() {
return
}
if me.autoHidePerfect.Checked() {
if repo.IsPerfect() {
continue
}
}
repo.Show()
}
if me.autoHidePerfect.Checked() {
if repo.IsPerfect() {
return
}
}
repo.Show()
}
func globalDisplayOptions(vbox *gui.Node) {
group1 := vbox.NewGroup("Global Display Options")
group1.NewButton("Show Repository Window", func() {
globalDisplaySetRepoState()
// globalDisplaySetRepoState()
if me.repos.Hidden() {
me.repos.Show()
} else {
@ -61,19 +57,18 @@ func globalDisplayOptions(vbox *gui.Node) {
me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true)
me.autoHideReadOnly.Custom = func() {
if me.autoHideReadOnly.Checked() {
globalDisplaySetRepoState()
} else {
globalDisplayShow()
}
me.repos.View.RegisterHideFunction(hideFunction)
me.repos.View.ScanRepositories()
}
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(true)
me.autoHidePerfect.Custom = func() {
if me.autoHidePerfect.Checked() {
globalDisplaySetRepoState()
me.repos.View.RegisterHideFunction(hideFunction)
me.repos.View.ScanRepositories()
} else {
globalDisplayShow()
me.repos.View.RegisterHideFunction(hideFunction2)
me.repos.View.ScanRepositories()
}
}
scanbox := group1.Box().Horizontal()

View File

@ -9,8 +9,12 @@ import (
)
type repoWindow struct {
win *gadgets.BasicWindow
box *gui.Node
win *gadgets.BasicWindow
box *gui.Node
// the top box of the repolist window
topbox *gui.Node
View *repolist.RepoList
}
@ -50,10 +54,13 @@ func makeRepoView() *repoWindow {
log.Warn("Should I do something special here?")
}
r.repoAllButtons()
r.topbox = r.repoAllButtons()
r.View = repolist.AutotypistView(r.box)
showncount := r.View.MirrorShownCount()
r.topbox.Append(showncount)
r.View.RegisterHideFunction(hideFunction)
return r
}
@ -74,7 +81,7 @@ func (r *repoWindow) showApps() {
}
}
func (r *repoWindow) repoAllButtons() {
func (r *repoWindow) repoAllButtons() *gui.Node {
// reposbox.SetExpand(false)
group1 := r.box.NewGroup("Run on all repos:")
@ -132,6 +139,7 @@ func (r *repoWindow) repoAllButtons() {
log.Info("every build worked !!!")
log.Info("")
})
return box2
}
func (r *repoWindow) mergeAllDevelToMain() bool {