more gui buttons
This commit is contained in:
parent
8edebe18e1
commit
8c7f6c3c1b
5
doGui.go
5
doGui.go
|
@ -53,11 +53,6 @@ func doGui() {
|
||||||
}
|
}
|
||||||
makeZoodWin()
|
makeZoodWin()
|
||||||
})
|
})
|
||||||
grid.NewButton("update zood versions", func() {
|
|
||||||
if me.zood != nil {
|
|
||||||
doMachinesUpgradeTable()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
// sit here forever refreshing the GUI
|
// sit here forever refreshing the GUI
|
||||||
for {
|
for {
|
||||||
|
|
|
@ -19,10 +19,16 @@ func makeZoodWin() {
|
||||||
me.zood.win.Custom = func() {
|
me.zood.win.Custom = func() {
|
||||||
log.Info("test delete window here")
|
log.Info("test delete window here")
|
||||||
}
|
}
|
||||||
group := me.zood.win.Group
|
grid := me.zood.win.Group.RawGrid()
|
||||||
group.NewButton("save machines.pb", func() {
|
grid.NewButton("save machines.pb", func() {
|
||||||
saveMachineState()
|
saveMachineState()
|
||||||
})
|
})
|
||||||
|
grid.NewCheckbox("hide active")
|
||||||
|
grid.NewButton("update", func() {
|
||||||
|
doMachinesUpgradeTable()
|
||||||
|
})
|
||||||
|
|
||||||
|
// make a box at the bottom of the window for the protobuf table
|
||||||
me.zood.box = me.zood.win.Bottom.Box().SetProgName("TBOX")
|
me.zood.box = me.zood.win.Bottom.Box().SetProgName("TBOX")
|
||||||
doMachinesUpgradeTable()
|
doMachinesUpgradeTable()
|
||||||
}
|
}
|
||||||
|
@ -82,13 +88,13 @@ func findVersion(m *zoopb.Machine, pkgname string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func saveMachineState() {
|
func saveMachineState() {
|
||||||
now := zoopb.NewMachines()
|
cur := zoopb.NewMachines()
|
||||||
|
|
||||||
all := me.machines.SortByHostname()
|
all := me.machines.SortByHostname()
|
||||||
for all.Scan() {
|
for all.Scan() {
|
||||||
m := all.Next()
|
m := all.Next()
|
||||||
log.Info("have machine:", m.Hostname)
|
log.Info("have machine:", m.Hostname)
|
||||||
now.Append(m)
|
cur.Append(m)
|
||||||
}
|
}
|
||||||
// me.machines.ConfigSave()
|
cur.ConfigSave()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue