autotypist/main.go

69 lines
1.5 KiB
Go
Raw Normal View History

package main
import (
"embed"
"go.wit.com/lib/debugger"
"go.wit.com/log"
"go.wit.com/gui"
)
//go:embed resources/*
var resToolkit embed.FS
func main() {
me = new(autoType)
me.myGui = gui.New()
me.myGui.InitEmbed(resToolkit)
me.myGui.Default()
me.autotypistWindow = me.myGui.NewWindow("autotypist: it types faster than you can.")
2024-02-13 16:18:37 -06:00
me.mainbox = me.autotypistWindow.NewBox("bw hbox", true)
2024-02-13 16:18:37 -06:00
vbox1 := me.mainbox.NewVerticalBox("BOX1")
globalDisplayOptions(vbox1)
docsBox(vbox1)
if debugger.ArgDebug() {
debuggerBox(vbox1)
}
2024-02-13 16:18:37 -06:00
// disable the interface while everything is scanned
me.Disable()
2024-02-13 16:18:37 -06:00
vbox2 := me.mainbox.NewVerticalBox("BOX2")
globalBuildOptions(vbox2)
2024-02-21 11:18:16 -06:00
// me.summary = submitPatchesBox(vbox2)
2024-02-13 16:18:37 -06:00
globalResetOptions(me.mainbox)
2024-02-17 14:20:37 -06:00
me.repos = makeRepoView()
2024-02-17 08:38:44 -06:00
2024-02-18 07:24:56 -06:00
// parse config file and scan for .git repos
me.repos.initRepoList()
// reads in the State of all the repos
// TODO: should not really be necessary directly after init()
me.repos.View.ScanRepositories()
// process everything on the command line
2024-02-18 07:24:56 -06:00
// may exit here
handleCmdLine()
2024-02-22 07:55:01 -06:00
// setup the autoscan functions
me.repos.View.RegisterHideFunction(hideFunction)
me.repos.View.SetAutoScan(me.autoScanReposCB.Checked())
2024-02-14 13:43:43 -06:00
// processing is done. update the repo summary box
2024-02-21 11:18:16 -06:00
// me.summary.Update()
2024-02-14 13:43:43 -06:00
2024-02-18 07:24:56 -06:00
me.Enable()
2024-02-17 08:38:44 -06:00
// intermittently scans the status indefinitly
2024-02-18 07:24:56 -06:00
me.repos.View.Watchdog(func() {
log.Info("In main()")
// processing is done. update the repo summary box
2024-02-21 11:18:16 -06:00
// me.summary.Update()
2024-02-18 07:24:56 -06:00
})
}