fixing gocui plugin exit()
This commit is contained in:
parent
f6803f07f1
commit
e896cae995
6
Makefile
6
Makefile
|
@ -38,8 +38,10 @@ andlabs: clean install
|
||||||
forge --gui andlabs --gui-verbose
|
forge --gui andlabs --gui-verbose
|
||||||
|
|
||||||
gocui: install
|
gocui: install
|
||||||
forge --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1
|
forge --gui gocui
|
||||||
# forge --gui gocui --gui-verbose --debugger
|
|
||||||
|
gocui-verbose: install
|
||||||
|
forge --gui gocui --gui-verbose >/tmp/forge.log 2>&1
|
||||||
|
|
||||||
goimports:
|
goimports:
|
||||||
reset
|
reset
|
||||||
|
|
|
@ -21,6 +21,7 @@ func doConfig() {
|
||||||
log.Info("todo")
|
log.Info("todo")
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
||||||
if argv.Config.Register != "" {
|
if argv.Config.Register != "" {
|
||||||
if err := doRegister(argv.Config.Register); err == nil {
|
if err := doRegister(argv.Config.Register); err == nil {
|
||||||
okExit("attempting to register " + argv.Config.Register)
|
okExit("attempting to register " + argv.Config.Register)
|
||||||
|
@ -51,6 +52,9 @@ func doConfig() {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Info("config.PathLock =", me.forge.Config.PathLock)
|
||||||
|
log.Info("config.GoSrc =", me.forge.Config.GoSrc)
|
||||||
|
|
||||||
me.forge.ConfigPrintTable()
|
me.forge.ConfigPrintTable()
|
||||||
okExit("")
|
okExit("")
|
||||||
}
|
}
|
||||||
|
|
26
doGui.go
26
doGui.go
|
@ -92,23 +92,39 @@ func doGui() {
|
||||||
log.Printf("rill repos.Reload() took (%s)\n", shell.FormatDuration(time.Since(now)))
|
log.Printf("rill repos.Reload() took (%s)\n", shell.FormatDuration(time.Since(now)))
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
drawWindow(mainWindow)
|
drawWindow(mainWindow)
|
||||||
|
|
||||||
// sits here forever
|
// sits here forever
|
||||||
debug()
|
debug()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func drawWindow(win *gadgets.GenericWindow) {
|
func drawWindow(win *gadgets.GenericWindow) {
|
||||||
grid := win.Group.RawGrid()
|
grid := win.Group.RawGrid()
|
||||||
|
if me.forge.Config.GetPathLock() {
|
||||||
me.goSrcPwd = gadgets.NewOneLiner(grid, "Working Directory")
|
me.goSrcPwd = gadgets.NewOneLiner(grid, "Working Directory")
|
||||||
grid.NewLabel("")
|
me.goSrcPwd.SetText(me.forge.GetGoSrc())
|
||||||
|
} else {
|
||||||
|
me.goSrcEdit = gadgets.NewBasicEntry(grid, "Working Directory")
|
||||||
|
me.goSrcEdit.SetText(me.forge.GetGoSrc())
|
||||||
|
me.goSrcEdit.Custom = func() {
|
||||||
|
log.Info("updating text to", me.goSrcEdit.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lockpath := grid.NewCheckbox("Lock").SetChecked(me.forge.Config.PathLock)
|
||||||
|
lockpath.Custom = func() {
|
||||||
|
if lockpath.IsChecked() {
|
||||||
|
log.Info("lock working directory")
|
||||||
|
me.forge.Config.PathLock = true
|
||||||
|
} else {
|
||||||
|
log.Info("unlock working directory")
|
||||||
|
me.forge.Config.PathLock = false
|
||||||
|
}
|
||||||
|
me.forge.Config.ConfigSave()
|
||||||
|
okExit("you must restart forge after changing the Path Lock")
|
||||||
|
}
|
||||||
|
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
me.goSrcPwd.SetText(me.forge.GetGoSrc())
|
|
||||||
|
|
||||||
// use ENV GIT_AUTHOR
|
// use ENV GIT_AUTHOR
|
||||||
me.gitAuthor = gadgets.NewOneLiner(grid, "Git Author")
|
me.gitAuthor = gadgets.NewOneLiner(grid, "Git Author")
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
9
exit.go
9
exit.go
|
@ -6,18 +6,19 @@ package main
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
"go.wit.com/lib/protobuf/gitpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func okExit(thing string) {
|
func okExit(thing string) {
|
||||||
if thing != "" {
|
gui.UnloadToolkits()
|
||||||
log.Info("forge exit:", thing, "ok")
|
|
||||||
}
|
|
||||||
if configSave {
|
if configSave {
|
||||||
me.forge.SetConfigSave(configSave)
|
me.forge.SetConfigSave(configSave)
|
||||||
}
|
}
|
||||||
// log.Info("Finished go-clean on", check.GetGoPath(), "ok")
|
if thing != "" {
|
||||||
|
log.Info("forge exit:", thing, "ok")
|
||||||
|
}
|
||||||
me.forge.Exit()
|
me.forge.Exit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ type mainType struct {
|
||||||
mainbox *gui.Node // the main box. enable/disable this
|
mainbox *gui.Node // the main box. enable/disable this
|
||||||
autoDryRun *gui.Node // checkbox for --dry-run
|
autoDryRun *gui.Node // checkbox for --dry-run
|
||||||
goSrcPwd *gadgets.OneLiner // what is being used as primary directory for your work
|
goSrcPwd *gadgets.OneLiner // what is being used as primary directory for your work
|
||||||
|
goSrcEdit *gadgets.BasicEntry // what is being used as primary directory for your work
|
||||||
gitAuthor *gadgets.OneLiner // ENV GIT_AUTHOR NAME and EMAIL
|
gitAuthor *gadgets.OneLiner // ENV GIT_AUTHOR NAME and EMAIL
|
||||||
|
|
||||||
// these hold the branches that the user can switch all the repositories to them
|
// these hold the branches that the user can switch all the repositories to them
|
||||||
|
|
Loading…
Reference in New Issue