windows are combined

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-30 14:05:22 -06:00
parent 37d8e7573e
commit 3094c6283c
4 changed files with 58 additions and 52 deletions

View File

@ -5,7 +5,6 @@ import (
"go.wit.com/gui" "go.wit.com/gui"
"go.wit.com/lib/debugger" "go.wit.com/lib/debugger"
"go.wit.com/lib/gui/logsettings" "go.wit.com/lib/gui/logsettings"
"go.wit.com/log"
// "go.wit.com/gui/gadgets" // "go.wit.com/gui/gadgets"
) )
@ -52,42 +51,44 @@ func globalDisplayOptions(box *gui.Node) {
globalDisplaySetRepoState() globalDisplaySetRepoState()
reposwin.Toggle() reposwin.Toggle()
}) })
group1.NewButton("Create Release Window", func() { /*
if release.win == nil { group1.NewButton("Create Release Window", func() {
log.Info("Creating the Release Window") if release.win == nil {
createReleaseWindow() log.Info("Creating the Release Window")
createReleaseWindow()
log.Info("Toggling the Release Window")
release.win.Toggle()
}
log.Info("Toggling the Release Window") log.Info("Toggling the Release Window")
release.win.Toggle() release.openrepo.Disable()
}
log.Info("Toggling the Release Window")
release.openrepo.Disable()
for _, repo := range me.allrepos {
repo.newScan()
}
reposwin.Toggle()
release.win.Toggle()
})
group1.NewButton("Create Release Window (fullscan)", func() {
if release.win == nil {
log.Info("Creating the Release Window")
createReleaseWindow()
for _, repo := range me.allrepos { for _, repo := range me.allrepos {
repo.status.Update()
repo.newScan() repo.newScan()
} }
globalDisplaySetRepoState()
// open the repo window
reposwin.Toggle() reposwin.Toggle()
release.win.Toggle()
})
group1.NewButton("Create Release Window (fullscan)", func() {
if release.win == nil {
log.Info("Creating the Release Window")
createReleaseWindow()
for _, repo := range me.allrepos {
repo.status.Update()
repo.newScan()
}
globalDisplaySetRepoState()
// open the repo window
reposwin.Toggle()
log.Info("Toggling the Release Window")
release.win.Toggle()
}
log.Info("Toggling the Release Window") log.Info("Toggling the Release Window")
release.win.Toggle() release.win.Toggle()
} release.openrepo.Disable()
log.Info("Toggling the Release Window") for _, repo := range me.allrepos {
release.win.Toggle() repo.newScan()
release.openrepo.Disable() }
for _, repo := range me.allrepos { })
repo.newScan() */
}
})
me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true) me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true)
me.autoHideReadOnly.Custom = func() { me.autoHideReadOnly.Custom = func() {

17
main.go
View File

@ -23,7 +23,13 @@ func main() {
// me.myGui.LoadToolkit("nocui") // me.myGui.LoadToolkit("nocui")
me.myGui.Default() me.myGui.Default()
autotypistWindow() // autotypistWindow()
me.mainWindow = me.myGui.NewWindow("GUI release manager")
me.mainBox = me.mainWindow.NewBox("bw hbox", true)
globalDisplayOptions(me.mainBox)
repoworld() repoworld()
for _, repo := range me.allrepos { for _, repo := range me.allrepos {
@ -32,7 +38,7 @@ func main() {
} }
if release.win == nil { if release.win == nil {
log.Info("Creating the Release Window") log.Info("Creating the Release Window")
createReleaseWindow() createReleaseWindow(me.mainBox)
globalDisplaySetRepoState() globalDisplaySetRepoState()
// open the repo window // open the repo window
reposwin.Toggle() reposwin.Toggle()
@ -72,10 +78,3 @@ func main() {
me.autoWorkingPwd.SetText(s) me.autoWorkingPwd.SetText(s)
}) })
} }
func autotypistWindow() {
win := me.myGui.NewWindow("autotypist for GO & git. it types faster than you can.")
box := win.NewBox("bw hbox", true)
globalDisplayOptions(box)
}

View File

@ -39,25 +39,29 @@ type releaseStruct struct {
checkSafeB *gui.Node checkSafeB *gui.Node
} }
func createReleaseWindow() { func createReleaseWindow(box *gui.Node) {
if release.win != nil { /*
release.win.Toggle() if release.win != nil {
return release.win.Toggle()
} return
}
*/
versionS := "0.17.0" versionS := "0.17.0"
reasonS := "gocui" reasonS := "gocui"
partS := strings.Split(versionS, ".") partS := strings.Split(versionS, ".")
release.win = gadgets.NewBasicWindow(me.myGui, "Make a new release") /*
release.win.Custom = func() { release.win = gadgets.NewBasicWindow(me.myGui, "Make a new release")
log.Info("Release Window close") release.win.Custom = func() {
} log.Info("Release Window close")
}
release.win.Make() release.win.Make()
release.win.StandardClose() release.win.StandardClose()
release.win.Draw() release.win.Draw()
release.box = release.win.Box() */
release.box = box
release.group = release.box.NewGroup("things") release.group = release.box.NewGroup("things")
release.grid = release.group.NewGrid("buildOptions", 2, 1) release.grid = release.group.NewGrid("buildOptions", 2, 1)

View File

@ -20,6 +20,8 @@ type autoType struct {
myGui *gui.Node myGui *gui.Node
autotypistWindow *gadgets.BasicWindow autotypistWindow *gadgets.BasicWindow
mainWindow *gui.Node
mainBox *gui.Node
// #### autotypist Global Display Options // #### autotypist Global Display Options
autoHidePerfect *gui.Node autoHidePerfect *gui.Node