From 5aa110ae8b5e643cdb40d8e8e415bf77d08ffd53 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 29 Feb 2024 19:51:28 -0600 Subject: [PATCH] guireleaser works again --- globalDisplayOptions.go | 12 ++++++++---- hideFunction.go | 31 ++++++++++--------------------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go index e5489f7..055f0ab 100644 --- a/globalDisplayOptions.go +++ b/globalDisplayOptions.go @@ -27,10 +27,14 @@ func globalDisplayOptions(box *gui.Node) { hidegrid.NextRow() me.autoHideReadOnly = hidegrid.NewCheckbox("Hide read-only repos").SetChecked(true) - // me.autoHideReadOnly.Custom = func() { - // log.Info("registered hide function to globalDisplayShow()") - // me.repos.View.RegisterHideFunction(globalDisplayShow) - // } + me.autoHideReadOnly.Custom = func() { + if me.autoHideReadOnly.Checked() { + os.Setenv("AUTOTYPIST_READONLY", "hide") + } else { + os.Unsetenv("AUTOTYPIST_READONLY") + } + } + os.Setenv("AUTOTYPIST_READONLY", "hide") hidegrid.NextRow() me.autoHideReleased = hidegrid.NewCheckbox("Hide Released repos").SetChecked(true) diff --git a/hideFunction.go b/hideFunction.go index 30bf485..a9f835b 100644 --- a/hideFunction.go +++ b/hideFunction.go @@ -20,6 +20,12 @@ func hideFunction(r *repolist.RepoRow) { return } + // always show repos that have not been merged ? + if r.GoState() == "merge to devel" { + r.Show() + return + } + // hide read-only repos if os.Getenv("AUTOTYPIST_READONLY") == "hide" { if r.Status.ReadOnly() { @@ -41,9 +47,8 @@ func hideFunction(r *repolist.RepoRow) { } } - // hide perfectly clean repos - if os.Getenv("AUTOTYPIST_CLEAN") == "hide" { - if r.IsPerfect() { + if me.autoHideReleased.Checked() { + if r.Status.IsReleased() { r.Hide() return } @@ -55,30 +60,13 @@ func hideFunction(r *repolist.RepoRow) { r.Show() } +/* func showHideRepos(repo *repolist.RepoRow) { if repo.GoPath() == "go.wit.com/dev/alexflint/arg" { log.Info("found autoHideReleased() =", me.autoHideReleased.Checked()) log.Info("found alexflint/arg IsReleased() =", repo.Status.IsReleased()) } - // always show dirty repos - if repo.IsDirty() { - repo.Show() - return - } - // always show repos that have not been merged ? - if repo.GoState() == "merge to devel" { - repo.Show() - return - } - // hide read-only repos. These are repos that do not - // match things in the users config file (.config/autotypist) - if me.autoHideReadOnly.Checked() { - if repo.Status.ReadOnly() { - repo.Hide() - return - } - } if me.autoHideReleased.Checked() { if repo.Status.IsReleased() { repo.Hide() @@ -87,3 +75,4 @@ func showHideRepos(repo *repolist.RepoRow) { } repo.Show() } +*/