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
|
||||
|
||||
gocui: install
|
||||
forge --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1
|
||||
# forge --gui gocui --gui-verbose --debugger
|
||||
forge --gui gocui
|
||||
|
||||
gocui-verbose: install
|
||||
forge --gui gocui --gui-verbose >/tmp/forge.log 2>&1
|
||||
|
||||
goimports:
|
||||
reset
|
||||
|
|
|
@ -21,6 +21,7 @@ func doConfig() {
|
|||
log.Info("todo")
|
||||
okExit("")
|
||||
}
|
||||
|
||||
if argv.Config.Register != "" {
|
||||
if err := doRegister(argv.Config.Register); err == nil {
|
||||
okExit("attempting to register " + argv.Config.Register)
|
||||
|
@ -51,6 +52,9 @@ func doConfig() {
|
|||
os.Exit(0)
|
||||
}
|
||||
|
||||
log.Info("config.PathLock =", me.forge.Config.PathLock)
|
||||
log.Info("config.GoSrc =", me.forge.Config.GoSrc)
|
||||
|
||||
me.forge.ConfigPrintTable()
|
||||
okExit("")
|
||||
}
|
||||
|
|
28
doGui.go
28
doGui.go
|
@ -92,23 +92,39 @@ func doGui() {
|
|||
log.Printf("rill repos.Reload() took (%s)\n", shell.FormatDuration(time.Since(now)))
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
drawWindow(mainWindow)
|
||||
|
||||
// sits here forever
|
||||
debug()
|
||||
|
||||
}
|
||||
|
||||
func drawWindow(win *gadgets.GenericWindow) {
|
||||
grid := win.Group.RawGrid()
|
||||
me.goSrcPwd = gadgets.NewOneLiner(grid, "Working Directory")
|
||||
grid.NewLabel("")
|
||||
if me.forge.Config.GetPathLock() {
|
||||
me.goSrcPwd = gadgets.NewOneLiner(grid, "Working Directory")
|
||||
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()
|
||||
|
||||
me.goSrcPwd.SetText(me.forge.GetGoSrc())
|
||||
|
||||
// use ENV GIT_AUTHOR
|
||||
me.gitAuthor = gadgets.NewOneLiner(grid, "Git Author")
|
||||
grid.NextRow()
|
||||
|
|
9
exit.go
9
exit.go
|
@ -6,18 +6,19 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"go.wit.com/gui"
|
||||
"go.wit.com/lib/protobuf/gitpb"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
func okExit(thing string) {
|
||||
if thing != "" {
|
||||
log.Info("forge exit:", thing, "ok")
|
||||
}
|
||||
gui.UnloadToolkits()
|
||||
if 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()
|
||||
}
|
||||
|
||||
|
|
|
@ -31,10 +31,11 @@ type mainType struct {
|
|||
urlbase string // base URL
|
||||
|
||||
mainWindow *gadgets.BasicWindow
|
||||
mainbox *gui.Node // the main box. enable/disable this
|
||||
autoDryRun *gui.Node // checkbox for --dry-run
|
||||
goSrcPwd *gadgets.OneLiner // what is being used as primary directory for your work
|
||||
gitAuthor *gadgets.OneLiner // ENV GIT_AUTHOR NAME and EMAIL
|
||||
mainbox *gui.Node // the main box. enable/disable this
|
||||
autoDryRun *gui.Node // checkbox for --dry-run
|
||||
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
|
||||
|
||||
// these hold the branches that the user can switch all the repositories to them
|
||||
reposWinB *gui.Node // button that opens the repos window
|
||||
|
|
Loading…
Reference in New Issue