summaryrefslogtreecommitdiff
path: root/testGui
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-11-28 19:57:03 -0600
committerJeff Carr <[email protected]>2024-11-28 19:57:03 -0600
commit931e345895e99e9cb058029763e12562cc6d5fba (patch)
tree1fe4213dbc8fa186c30f6d9b2e4831fa723a2c1c /testGui
parentcc7a1b0bdc69335132a022111c759931db6d1566 (diff)
testGui example is starting to work
Diffstat (limited to 'testGui')
-rw-r--r--testGui/main.go26
-rw-r--r--testGui/structs.go11
2 files changed, 11 insertions, 26 deletions
diff --git a/testGui/main.go b/testGui/main.go
index c6880c1..4c55f66 100644
--- a/testGui/main.go
+++ b/testGui/main.go
@@ -20,27 +20,21 @@ func main() {
// load the ~/.config/forge/ config
me.forge = forgepb.Init()
- if me.forge == nil {
- panic("damn it, forge is nil")
- }
- if me.forge.Config == nil {
- panic("damn it config")
- }
me.forge.ConfigPrintTable()
+ if err := me.forge.Machine.ConfigLoad(); err != nil {
+ log.Warn("zoopb.ConfigLoad() failed", err)
+ os.Exit(-1)
+ }
+ me.forge.Machine.InitWit()
+
// setup the GUI
me.myGui = gui.New()
me.myGui.Default()
- // todo: this code sucks. fix it soon
- me.mainWindow = me.myGui.NewWindow("builds and uploads all the packages")
- me.mainbox = me.mainWindow.NewBox("bw hbox", true)
-
- // make a window with a table of all the repos
- me.repoList = repolist.AutotypistView(me.mainbox)
- me.repoList.Init(me.forge)
+ me.repoList = repolist.Init(me.forge, me.myGui)
- me.Enable()
+ me.repoList.Enable()
failed := make(map[*repolist.RepoRow]string)
versions := make(map[*repolist.RepoRow]string)
@@ -54,10 +48,10 @@ func main() {
var alreadyBuilt bool
ver := repo.Status.DebianReleaseVersion()
name := me.forge.DebName(repo.GoPath())
- if me.machine.IsInstalled(name) {
+ if me.forge.Machine.IsInstalled(name) {
end += "(installed) "
}
- if actualp := me.machine.FindVersion(name, ver); actualp != nil {
+ if actualp := me.forge.Machine.FindVersion(name, ver); actualp != nil {
end += " (version match) " + actualp.Version + " " + ver + " "
alreadyBuilt = true
} else {
diff --git a/testGui/structs.go b/testGui/structs.go
index 2d223bf..a836504 100644
--- a/testGui/structs.go
+++ b/testGui/structs.go
@@ -5,19 +5,10 @@ import (
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/protobuf/forgepb"
- "go.wit.com/lib/protobuf/zoopb"
)
var me *autoType
-func (b *autoType) Disable() {
- b.mainbox.Disable()
-}
-
-func (b *autoType) Enable() {
- b.mainbox.Enable()
-}
-
// this app's variables
type autoType struct {
// allrepos map[string]*repo
@@ -42,7 +33,7 @@ type autoType struct {
goSrcPath string
// use zookeeper to get the list of installed packages
- machine zoopb.Machine
+ // machine zoopb.Machine
// #### autotypist Global Display Options
autoHidePerfect *gui.Node