button for repo window

This commit is contained in:
Jeff Carr 2024-12-23 03:27:29 -06:00
parent cc55a5ad7a
commit e68cb3e80f
3 changed files with 54 additions and 106 deletions

View File

@ -1,62 +0,0 @@
package main
import (
"go.wit.com/gui"
"go.wit.com/lib/gui/repolist"
"go.wit.com/log"
)
func hideFunction(r *repolist.RepoRow) {
/*
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 globalDisplayOptions(vbox *gui.Node) {
group1 := vbox.NewGroup("Global Display Options")
group1.NewButton("Show Repository Window", func() {
// globalDisplaySetRepoState()
if me.repos.Hidden() {
me.repos.Show()
} else {
me.repos.Hide()
}
})
me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true)
me.autoHideReadOnly.Custom = func() {
me.repos.View.RegisterHideFunction(hideFunction)
me.repos.View.ScanRepositories()
}
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(true)
me.autoHidePerfect.Custom = func() {
me.repos.View.RegisterHideFunction(hideFunction)
me.repos.View.ScanRepositories()
}
scanbox := group1.Box().Horizontal()
me.autoScanReposCB = scanbox.NewCheckbox("auto scan").SetChecked(true)
scanbox.NewButton("scan now", func() {
log.Info("re-scanning repos now")
i, s := me.repos.View.ScanRepositories()
log.Info("re-scanning repos done", i, s)
})
}

View File

@ -55,8 +55,8 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
group1 := box.NewGroup("Patch Summary")
s.grid = group1.RawGrid()
s.grid.NewButton("Update Patch Counts", func() {
/*
s.grid.NewButton("Update Patch Counts", func() {
var repocount, patchcount int
// broken after move to forge protobuf
all := me.forge.Repos.SortByFullPath()
@ -91,9 +91,8 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
}
s.totalUserPatches.SetText(strconv.Itoa(patchcount) + " patches")
s.totalUserRepos.SetText(strconv.Itoa(repocount) + " go repos")
*/
s.Update()
})
*/
/* this used to be the way and should probably be revisited
s.grid.NewButton("Make Patches", func() {
@ -138,6 +137,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.totalMasterPatches = s.grid.NewLabel("x patches")
s.grid.NextRow()
/*
s.grid.NewLabel("")
s.grid.NewLabel("")
s.grid.NewButton("merge from user", func() {
@ -146,6 +146,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.grid.NewButton("merge from devel", func() {
log.Info("this probably should not exist")
})
*/
s.grid.NextRow()
group1 = box.NewGroup("Submit Patch Set")
@ -172,6 +173,15 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
}
me.repos.View.MakePatchset(patchdir)
})
s.grid.NewButton("Show Repos", func() {
s.Update()
if me.repos.Hidden() {
me.repos.Show()
} else {
me.repos.Hide()
}
})
/*
s.submitB = s.grid.NewButton("Submit quilt", func() {
log.Info("do a submit here")