From 2a46bd2c9e34cf929f28837f36e66954c434aa15 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 11 Feb 2024 18:58:52 -0600 Subject: [PATCH] fix hidden tracking Signed-off-by: Jeff Carr --- globalDisplayOptions.go | 18 +++++++++++++----- releaseWindow.go | 32 +++++++++++++++++++++++++------- repolist.go | 6 +----- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go index 9ca43e5..aa24dde 100644 --- a/globalDisplayOptions.go +++ b/globalDisplayOptions.go @@ -50,11 +50,19 @@ func globalDisplayOptions(box *gui.Node) { group1 := vbox.NewGroup("Global Display Options") group1.NewButton("Show Repository Window", func() { - showHideRepos() - scanForReady() - scanForReady() - reposwin.Toggle() - findNextDirty("") + if reposwin.Hidden() { + log.Info("showing reposwin") + showHideRepos() + scanForReady() + scanForReady() + reposwin.Show() + findNextDirty("") + // double check the found next repo + fullDoubleCheckFix() + } else { + log.Info("hiding reposwin") + reposwin.Hide() + } }) me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true) diff --git a/releaseWindow.go b/releaseWindow.go index 41f75af..9a93c3e 100644 --- a/releaseWindow.go +++ b/releaseWindow.go @@ -184,14 +184,13 @@ func createReleaseBox(box *gui.Node) { release.whitelist[release.current.String()] = release.current }) - release.checkSafeB = release.grid.NewButton("CheckSafeGoSumRemake()", func() { + release.checkSafeB = release.grid.NewButton("fullDoubleCheckFix()", func() { buttonDisable() - release.current.status.CheckSafeGoSumRemake() - release.current.status.MakeRedomod() - if ok, _ := release.current.status.CheckGoSum(); ok { - log.Info("repo has go.sum requirements that are clean") + if fullDoubleCheckFix() { + log.Info("go.sum is clean") } else { log.Info("repo go.sum FAILED") + return } buttonEnable() }) @@ -236,9 +235,9 @@ func createReleaseBox(box *gui.Node) { buttonEnable() }) - release.grid.NewButton("release(5)", func() { + release.grid.NewButton("release(15)", func() { buttonDisable() - for n := 0; n <= 5; n++ { + for n := 0; n <= 15; n++ { if doRelease() { log.Info("doRelease() worked") } else { @@ -255,6 +254,25 @@ func createReleaseBox(box *gui.Node) { }) } +func fullDoubleCheckFix() bool { + release.current.status.CheckSafeGoSumRemake() + release.current.status.MakeRedomod() + if ok, _ := release.current.status.CheckGoSum(); ok { + log.Info("go.sum is clean") + } else { + log.Info("repo go.sum FAILED") + return false + } + if ok, _ := release.current.status.CheckGoSum(); ok { + log.Info("repo has go.sum requirements that are clean") + // release.current.setGoSumStatus("CLEAN") + release.status.SetValue("GOOD") + release.notes.SetValue("CheckGoSum() does not seem to lie") + return true + } + return false +} + func goodCheckGoSum() bool { tmp := release.current.String() log.Info("goodCheckGoSum() START on repo:", tmp, "STATUS =", release.current.getGoSumStatus()) diff --git a/repolist.go b/repolist.go index cb48e7a..2f2e354 100644 --- a/repolist.go +++ b/repolist.go @@ -75,13 +75,11 @@ func (r *repo) Show() { func repoworld() { reposwin = gadgets.NewBasicWindow(me.myGui, "All git repositories in ~/go/src/") reposwin.Make() - - reposbox = reposwin.Box().NewBox("bw vbox", false) - reposwin.Draw() reposwin.Custom = func() { log.Warn("GOT HERE: main() gadgets.NewBasicWindow() close") log.Warn("Should I do something special here?") } + reposbox = reposwin.Box().NewBox("bw vbox", false) reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)") reposgrid = reposgroup.NewGrid("test", 7, 1) @@ -120,8 +118,6 @@ func repoworld() { log.Info("addRepo()", i, tmp) addRepo(reposgrid, tmp, "master", "master", "master") } - - reposwin.Toggle() } func addRepo(grid *gui.Node, path string, master string, devel string, user string) {