summaryrefslogtreecommitdiff
path: root/globalDisplayOptions.go
diff options
context:
space:
mode:
Diffstat (limited to 'globalDisplayOptions.go')
-rw-r--r--globalDisplayOptions.go45
1 files changed, 10 insertions, 35 deletions
diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go
index 3a14ec9..e5489f7 100644
--- a/globalDisplayOptions.go
+++ b/globalDisplayOptions.go
@@ -1,46 +1,14 @@
package main
import (
+ "os"
+
"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(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()
- return
- }
- }
- repo.Show()
-}
-
func globalDisplayOptions(box *gui.Node) {
vbox := box.NewVerticalBox("DISPLAYVBOX")
@@ -73,8 +41,15 @@ func globalDisplayOptions(box *gui.Node) {
me.scanEveryMinute = hidegrid.NewCheckbox("Scan every minute").SetChecked(false)
me.scanEveryMinute.Custom = func() {
- me.repos.View.SetAutoScan(me.scanEveryMinute.Checked())
+ if me.scanEveryMinute.Checked() {
+ os.Setenv("REPO_AUTO_SCAN", "true")
+ log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
+ } else {
+ os.Unsetenv("REPO_AUTO_SCAN")
+ log.Info("env REPO_AUTO_SCAN=", os.Getenv("REPO_AUTO_SCAN"))
+ }
}
+
hidegrid.NewButton("scan now", func() {
log.Info("re-scanning repos now")
i, s := me.repos.View.ScanRepositories()