summaryrefslogtreecommitdiff
path: root/testGui/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-12-05 12:30:18 -0600
committerJeff Carr <[email protected]>2024-12-05 12:30:18 -0600
commit87f53b432fb9bb097c21bd3e01957d0e0b97de33 (patch)
treeae651220b9e198c3067373dae7cfdfb14c762c1d /testGui/main.go
parent2f33fc86488202b4df04e94da9fff29bbf079103 (diff)
remove guiv0.0.8
Diffstat (limited to 'testGui/main.go')
-rw-r--r--testGui/main.go99
1 files changed, 16 insertions, 83 deletions
diff --git a/testGui/main.go b/testGui/main.go
index ddfa433..7bef94c 100644
--- a/testGui/main.go
+++ b/testGui/main.go
@@ -1,14 +1,11 @@
package main
import (
- "fmt"
"os"
-
- "go.wit.com/log"
+ "time"
"go.wit.com/gui"
- "go.wit.com/lib/gui/repolist"
- "go.wit.com/lib/protobuf/forgepb"
+ "go.wit.com/log"
)
// sent via -ldflags
@@ -17,87 +14,23 @@ var BUILDTIME string
func main() {
me = new(autoType)
-
- // load the ~/.config/forge/ config
- me.forge = forgepb.Init()
- me.forge.ConfigPrintTable()
-
// setup the GUI
me.myGui = gui.New()
- me.myGui.Default()
-
- me.repoList = repolist.Init(me.forge, me.myGui)
- me.repoList.Enable()
-
- failed := make(map[*repolist.RepoRow]string)
- versions := make(map[*repolist.RepoRow]string)
-
- rloop := me.repoList.ReposSortByName()
- for rloop.Scan() {
- repo := rloop.Repo()
- repotype := repo.RepoType()
- if repotype != "binary" {
- // we only want to process golang binaries where package == 'main'
- // log.Info("skipping repo", repo.GoPath(), repotype)
- continue
- }
- // var cmd []string
- var start string
- var end string
- var alreadyBuilt bool
- ver := repo.Status.DebianReleaseVersion()
- name := me.forge.DebName(repo.GoPath())
- if me.forge.Machine.IsInstalled(name) {
- end += "(installed) "
- }
- if actualp := me.forge.Machine.FindVersion(name, ver); actualp != nil {
- end += " (version match) " + actualp.Version + " " + ver + " "
- alreadyBuilt = true
- } else {
- end += " (need to build) " + ver + " "
- }
-
- if alreadyBuilt {
- start = fmt.Sprintf("already built %-30s %-8s %-50s", name, ver, repo.GoPath())
- } else {
- start = fmt.Sprintf("need to build %-30s %-8s %-50s", name, ver, repo.GoPath())
- }
- log.Info(start, "("+versions[repo]+")", end)
- if name == "" {
- // err := fmt.Sprintf("name is blank error %+v", repo)
- log.Warn("name is blank error", repo.GoPath())
- }
-
- if argv.DryRun {
- continue
- }
-
- // skip if already built. (unless --force)
- if alreadyBuilt {
- // don't rebuild things
- if argv.Force {
- // well, okay, force me to rebuild them then
- } else {
- continue
- }
- }
-
- if repo.Status.IsPrivate() {
- // cmd = []string{"go-deb", "--auto", "--repo", repo.GoPath()}
- } else {
+ testLoad("nocui")
+ testLoad("pixelgl")
+ testLoad("gocui")
+ testLoad("andlabs")
+ testLoad("fyne")
+ //testLoad("fail")
+}
- }
- }
- log.Info("")
- log.Info("something failed on:")
- var fail bool = true
- for repo, cmd := range failed {
- log.Info("failed cmd :", cmd, repo.Status.Path())
- fail = false
- }
- if fail {
- os.Exit(0)
+func testLoad(name string) {
+ if _, err := me.myGui.LoadToolkit(name); err == nil {
+ } else {
+ log.Warn("LoadToolkit() failed to load", name, "error:", err)
+ os.Exit(-1)
}
- os.Exit(-1)
+ time.Sleep(3 * time.Second)
+ me.myGui.CloseToolkit(name)
}