diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go index 6674c83..f2ba4a1 100644 --- a/globalDisplayOptions.go +++ b/globalDisplayOptions.go @@ -2,7 +2,7 @@ package main import ( - // "go.wit.com/log" + "go.wit.com/log" "go.wit.com/gui/gui" // "go.wit.com/gui/gadgets" @@ -13,9 +13,21 @@ func globalDisplayOptions(box *gui.Node) { groupvbox := group1.NewBox("bw vbox", false) // grouphbox := groupvbox.NewBox("bw hbox", true) - groupvbox.NewLabel("Display Perfectly clean repos") me.autoHidePerfect = groupvbox.NewCheckbox("Hide repos") + me.autoHidePerfect.Custom = func() { + me.autoHidePerfect.SetText("Hide Perfectly clean repos") + if me.autoHidePerfect.GetBool() { + log.Warn("Should hide here") + } else { + log.Warn("Should show here") + } + } + me.autoHidePerfect.Set(true) + groupvbox.NewButton("hide perfect", func () { + me.autoHidePerfect.SetText("Hide Perfectly clean repos") + hidePerfect() + }) groupvbox.NewButton("show all", func () { for _, repo := range allrepos { if repo.dirtyLabel.GetText() == "PERFECT" { @@ -26,8 +38,15 @@ func globalDisplayOptions(box *gui.Node) { } } }) - groupvbox.NewButton("hide perfect", func () { - hidePerfect() + + groupvbox.NewButton("reposwin.Draw", func () { + reposwin.Draw() + }) + groupvbox.NewButton("reposwin.Hide()", func () { + reposwin.Hide() + }) + groupvbox.NewButton("reposwin.Show()", func () { + reposwin.Show() }) groupvbox.NewButton("status.Update() all", func () { diff --git a/globalResetOptions.go b/globalResetOptions.go index b62cd84..2e753ba 100644 --- a/globalResetOptions.go +++ b/globalResetOptions.go @@ -7,7 +7,7 @@ import ( func globalResetOptions(box *gui.Node) { - group2 := box.NewGroup("Global Reset Options") + group2 := box.NewGroup("Global Destructive Options") buildOptions := group2.NewGrid("buildOptions",2, 1) buildOptions.NewLabel("global path reset") @@ -47,7 +47,7 @@ func globalResetOptions(box *gui.Node) { }) buildOptions.NewLabel("start over") - buildOptions.NewButton("rm src & pkgs", func () { + buildOptions.NewButton("rm ~/go/src & ~/go/pkg", func () { var newCmds [][]string var dirty bool = false for _, repo := range allrepos { diff --git a/main.go b/main.go index 429230b..4115f17 100644 --- a/main.go +++ b/main.go @@ -20,6 +20,7 @@ func main() { myGui.InitEmbed(resToolkit) myGui.Default() + autotypistWindow() repoworld() log.Sleep(.3) hidePerfect() @@ -72,11 +73,24 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri allrepos = append(allrepos, newRepo) } +func autotypistWindow() { + me.autotypistWindow = gadgets.NewBasicWindow(myGui, "autotypist for GO & git. it types faster than you can.") + me.autotypistWindow.Make() + me.autotypistWindow.StandardExit() + + box := me.autotypistWindow.Box() + globalDisplayOptions(box) + globalBuildOptions(box) + globalResetOptions(box) + me.autotypistWindow.Draw() + +} + // This creates a window func repoworld() { reposwin = gadgets.NewBasicWindow(myGui, "autotypist for GO & git. it types faster than you can.") reposwin.Make() - reposwin.StandardExit() + // reposwin.StandardExit() reposbox = reposwin.Box().NewBox("bw vbox", false) reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)") @@ -105,11 +119,13 @@ func repoworld() { addRepo(reposgrid, path, mbranch, dbranch, ubranch) } + /* box2 := reposwin.Box().NewBox("bw vbox", false) globalDisplayOptions(box2) globalBuildOptions(box2) globalResetOptions(box2) + */ - reposwin.Draw() + // reposwin.Draw() } diff --git a/structs.go b/structs.go index afa16af..7e163f3 100644 --- a/structs.go +++ b/structs.go @@ -18,12 +18,26 @@ var me repoType type repoType struct { script [][]string - toMoveToBranch string // what the current working branch name is + + // #### autotypist window + autotypistWindow *gadgets.BasicWindow + // #### autotypist Global Display Options autoHidePerfect *gui.Node + // #### autotypist Global Build Options + // what to change all the branches to + // so, as a developer, you can move all the repos + // to the 'devel' branch and then test a devel branch build + // then switch back to your 'username' branch and do a build there + toMoveToBranch string + + // displays the preferred names used for the repo tree state mainBranch *gadgets.BasicCombobox develBranch *gadgets.BasicCombobox userBranch *gadgets.BasicCombobox + + // #### autotypist Global Distructive & Reset Options + // #### autotypist window end } var cmds *gui.Node