fixes for GUI API changes

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-02-21 10:34:13 -06:00
parent 67d9306298
commit fd082d4965
4 changed files with 23 additions and 42 deletions

View File

@ -12,26 +12,6 @@ import (
// This setups up the dns control panel window
func setupControlPanelWindow(title string) {
log.Info("artificial sleep of:", me.artificialSleep)
log.Sleep(me.artificialSleep)
// setup the main tab
me.window = gadgets.NewBasicWindow(me.myGui, title)
me.window.Vertical()
me.window.Make()
makeMainWindow()
// These are your problems
me.problems = NewErrorBox(me.window.Box(), "Errors", "has problems?")
me.problems.addIPerror(RR, USER, "1:1:1:1")
me.window.Draw()
}
func myDefaultExit(n *gui.Node) {
log.Println("You can Do exit() things here")
os.Exit(0)
}
func makeMainWindow() {
@ -106,3 +86,8 @@ func statusGrid(n *gui.Node) {
}
})
}
func myDefaultExit(n *gui.Node) {
log.Println("You can Do exit() things here")
os.Exit(0)
}

View File

@ -55,14 +55,14 @@ type digStatus struct {
statusHTTP *gadgets.OneLiner
}
func NewDigStatusWindow(p *gui.Node) *digStatus {
func NewDigStatusWindow() *digStatus {
var ds *digStatus
ds = new(digStatus)
ds.ready = false
ds.hidden = true
ds.window = gadgets.NewBasicWindow(p, "DNS Resolver Status")
ds.window = gadgets.RawBasicWindow("DNS Resolver Status")
ds.window.Make()
// ds.window.Draw()
// ds.window.Hide()

View File

@ -56,7 +56,7 @@ type hostnameStatus struct {
// dnsAction *gui.Node
}
func NewHostnameStatusWindow(p *gui.Node) *hostnameStatus {
func NewHostnameStatusWindow() *hostnameStatus {
var hs *hostnameStatus
hs = new(hostnameStatus)
@ -64,7 +64,7 @@ func NewHostnameStatusWindow(p *gui.Node) *hostnameStatus {
hs.hidden = true
// hs.hostname = me.hostname
hs.window = gadgets.NewBasicWindow(p, "fix hostname here"+" Status")
hs.window = gadgets.RawBasicWindow("fix hostname here"+" Status")
hs.window.Make()
// hs.window.Draw()
// hs.window.Hide()

32
main.go
View File

@ -11,9 +11,9 @@ import (
"time"
"go.wit.com/gui"
"go.wit.com/lib/debugger"
"go.wit.com/log"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/linuxstatus"
"github.com/miekg/dns"
@ -39,29 +39,25 @@ func main() {
me.myGui.InitEmbed(resToolkit)
me.myGui.Default()
// setup the main window
setupControlPanelWindow("DNS and IPv6 Control Panel")
// setup the main tab
me.window = gadgets.RawBasicWindow("DNS and IPv6 Control Panel")
me.window.Make()
makeMainWindow()
// These are your problems
me.problems = NewErrorBox(me.window.Box(), "Errors", "has problems?")
me.problems.addIPerror(RR, USER, "1:1:1:1")
me.window.Show()
me.debug = debugWindow("Debugging")
// TODO: track this bug down
log.Sleep(1)
me.window.Toggle()
log.Sleep(1)
me.window.Toggle()
me.digStatus = NewDigStatusWindow(me.myGui)
me.statusDNS = NewHostnameStatusWindow(me.myGui)
me.digStatus = NewDigStatusWindow()
me.statusDNS = NewHostnameStatusWindow()
me.statusOS = linuxstatus.NewLinuxStatus(me.myGui)
if debugger.ArgDebug() {
go func() {
log.Sleep(2)
debugger.DebugWindow()
}()
}
digLoop()
// TCP & UDP port 53 lookups + DNS over HTTP lookups + os.Exec(dig)