summaryrefslogtreecommitdiff
path: root/globalDisplayOptions.go
diff options
context:
space:
mode:
Diffstat (limited to 'globalDisplayOptions.go')
-rw-r--r--globalDisplayOptions.go91
1 files changed, 54 insertions, 37 deletions
diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go
index dfe4623..196118e 100644
--- a/globalDisplayOptions.go
+++ b/globalDisplayOptions.go
@@ -7,44 +7,43 @@ import (
"go.wit.com/gui"
"go.wit.com/lib/debugger"
"go.wit.com/lib/gui/logsettings"
+ "go.wit.com/lib/gui/repolist"
"go.wit.com/log"
)
-func showHideRepos() {
- for _, repo := range me.repos.View.AllRepos() {
- // always show dirty repos
- if repo.IsDirty() {
- repo.Show()
- continue
- }
- // always show repos that have not been merged to main
- if repo.GoState() == "merge to devel" {
- repo.Show()
- continue
- }
+func showHideRepos(repo *repolist.Repo) {
+ // always show dirty repos
+ if repo.IsDirty() {
+ repo.Show()
+ return
+ }
+ // always show repos that have not been merged to main
+ 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()
- continue
- }
+ // 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.autoHidePerfect.Checked() {
- if repo.State() == "PERFECT" {
- repo.Hide()
- continue
- }
+ }
+ if me.autoHidePerfect.Checked() {
+ if repo.State() == "PERFECT" {
+ repo.Hide()
+ return
}
- if me.autoReleased.Checked() {
- if repo.GoState() == "RELEASED" {
- repo.Hide()
- continue
- }
+ }
+ if me.autoReleased.Checked() {
+ if repo.GoState() == "RELEASED" {
+ repo.Hide()
+ return
}
- repo.Show()
}
+ repo.Show()
}
func globalDisplayShow() {
@@ -77,7 +76,8 @@ func globalDisplayOptions(box *gui.Node) {
me.repos.Hide()
}
log.Info("showing reposwin")
- showHideRepos()
+ // showHideRepos()
+
// have to run this twice for now
// scanForReady()
// scanForReady()
@@ -90,7 +90,7 @@ func globalDisplayOptions(box *gui.Node) {
me.autoHideReadOnly = hidegrid.NewCheckbox("Hide read-only repos").SetChecked(true)
me.autoHideReadOnly.Custom = func() {
if me.autoHideReadOnly.Checked() {
- showHideRepos()
+ // showHideRepos()
} else {
globalDisplayShow()
}
@@ -99,11 +99,15 @@ func globalDisplayOptions(box *gui.Node) {
me.autoHidePerfect = hidegrid.NewCheckbox("Hide Perfectly clean repos").SetChecked(true)
me.autoHidePerfect.Custom = func() {
- if me.autoHidePerfect.Checked() {
- showHideRepos()
- } else {
- globalDisplayShow()
- }
+ log.Info("registered hide function to showHideRepos()")
+ me.repos.View.RegisterHideFunction(showHideRepos)
+ /*
+ if me.autoHidePerfect.Checked() {
+ showHideRepos()
+ } else {
+ globalDisplayShow()
+ }
+ */
}
hidegrid.NextRow()
@@ -142,6 +146,19 @@ func globalDisplayOptions(box *gui.Node) {
setBranchToMaster()
})
+ grid.NewButton("find first repo", func() {
+ // set the target versions
+ setTargetVersion()
+
+ // have to run this twice for now. not sure why
+ scanForReady()
+ scanForReady()
+
+ findNextDirty("")
+ // double check the found next repo
+ fullDoubleCheckFix()
+ })
+
me.setBranchesToMasterB = grid.NewButton("set all branches to master", func() {
me.Disable()
for _, repo := range me.repos.View.AllRepos() {