global window opens and closes repo window

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-16 11:56:55 -06:00
parent 0dd8cd9dea
commit 6a34c69970
4 changed files with 58 additions and 9 deletions

View File

@ -2,7 +2,7 @@
package main package main
import ( import (
// "go.wit.com/log" "go.wit.com/log"
"go.wit.com/gui/gui" "go.wit.com/gui/gui"
// "go.wit.com/gui/gadgets" // "go.wit.com/gui/gadgets"
@ -13,9 +13,21 @@ func globalDisplayOptions(box *gui.Node) {
groupvbox := group1.NewBox("bw vbox", false) groupvbox := group1.NewBox("bw vbox", false)
// grouphbox := groupvbox.NewBox("bw hbox", true) // grouphbox := groupvbox.NewBox("bw hbox", true)
groupvbox.NewLabel("Display Perfectly clean repos")
me.autoHidePerfect = groupvbox.NewCheckbox("Hide 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 () { groupvbox.NewButton("show all", func () {
for _, repo := range allrepos { for _, repo := range allrepos {
if repo.dirtyLabel.GetText() == "PERFECT" { 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 () { groupvbox.NewButton("status.Update() all", func () {

View File

@ -7,7 +7,7 @@ import (
func globalResetOptions(box *gui.Node) { func globalResetOptions(box *gui.Node) {
group2 := box.NewGroup("Global Reset Options") group2 := box.NewGroup("Global Destructive Options")
buildOptions := group2.NewGrid("buildOptions",2, 1) buildOptions := group2.NewGrid("buildOptions",2, 1)
buildOptions.NewLabel("global path reset") buildOptions.NewLabel("global path reset")
@ -47,7 +47,7 @@ func globalResetOptions(box *gui.Node) {
}) })
buildOptions.NewLabel("start over") buildOptions.NewLabel("start over")
buildOptions.NewButton("rm src & pkgs", func () { buildOptions.NewButton("rm ~/go/src & ~/go/pkg", func () {
var newCmds [][]string var newCmds [][]string
var dirty bool = false var dirty bool = false
for _, repo := range allrepos { for _, repo := range allrepos {

20
main.go
View File

@ -20,6 +20,7 @@ func main() {
myGui.InitEmbed(resToolkit) myGui.InitEmbed(resToolkit)
myGui.Default() myGui.Default()
autotypistWindow()
repoworld() repoworld()
log.Sleep(.3) log.Sleep(.3)
hidePerfect() hidePerfect()
@ -72,11 +73,24 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
allrepos = append(allrepos, newRepo) 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 // This creates a window
func repoworld() { func repoworld() {
reposwin = gadgets.NewBasicWindow(myGui, "autotypist for GO & git. it types faster than you can.") reposwin = gadgets.NewBasicWindow(myGui, "autotypist for GO & git. it types faster than you can.")
reposwin.Make() reposwin.Make()
reposwin.StandardExit() // reposwin.StandardExit()
reposbox = reposwin.Box().NewBox("bw vbox", false) reposbox = reposwin.Box().NewBox("bw vbox", false)
reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)") reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)")
@ -105,11 +119,13 @@ func repoworld() {
addRepo(reposgrid, path, mbranch, dbranch, ubranch) addRepo(reposgrid, path, mbranch, dbranch, ubranch)
} }
/*
box2 := reposwin.Box().NewBox("bw vbox", false) box2 := reposwin.Box().NewBox("bw vbox", false)
globalDisplayOptions(box2) globalDisplayOptions(box2)
globalBuildOptions(box2) globalBuildOptions(box2)
globalResetOptions(box2) globalResetOptions(box2)
*/
reposwin.Draw() // reposwin.Draw()
} }

View File

@ -18,12 +18,26 @@ var me repoType
type repoType struct { type repoType struct {
script [][]string script [][]string
toMoveToBranch string // what the current working branch name is
// #### autotypist window
autotypistWindow *gadgets.BasicWindow
// #### autotypist Global Display Options
autoHidePerfect *gui.Node 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 mainBranch *gadgets.BasicCombobox
develBranch *gadgets.BasicCombobox develBranch *gadgets.BasicCombobox
userBranch *gadgets.BasicCombobox userBranch *gadgets.BasicCombobox
// #### autotypist Global Distructive & Reset Options
// #### autotypist window end
} }
var cmds *gui.Node var cmds *gui.Node