From fdcd51d2111d05e8542c4383a53d8f8df9968aa3 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 5 Jan 2024 00:11:48 -0600 Subject: [PATCH] hide extra windows by default Signed-off-by: Jeff Carr --- Makefile | 2 +- gui.go | 17 ++++++++++++----- structs.go | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 5bbb710..ac0bed4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ run: build # ./control-panel-dns >/tmp/witgui.log.stderr 2>&1 - ./control-panel-dns --debugger + ./control-panel-dns install: go install -v go.wit.com/control-panel-dns@latest diff --git a/gui.go b/gui.go index 4434a97..c0ad477 100644 --- a/gui.go +++ b/gui.go @@ -25,7 +25,7 @@ func setupControlPanelWindow() { // setup the main tab mainWindow("DNS and IPv6 Control Panel") - detailsTab("Details") + detailsTab("DNS Details") debugTab("Debug") // me.digStatus = NewDigStatusWindow(me.window) @@ -70,14 +70,16 @@ func detailsTab(title string) { grid.Margin() grid.Pad() + + me.details.Hide() } func debugTab(title string) { var g2 *gui.Node - win := gadgets.NewBasicWindow(me.myGui, title) + me.debug = gadgets.NewBasicWindow(me.myGui, title) - g2 = win.Box().NewGroup("Real Stuff") + g2 = me.debug.Box().NewGroup("Real Stuff") g2.NewButton("GO GUI Debug Window", func () { debugger.DebugWindow(me.myGui) @@ -97,7 +99,7 @@ func debugTab(title string) { log.Println(o) }) - g2 = win.Box().NewGroup("debugging options") + g2 = me.debug.Box().NewGroup("debugging options") // makes a slider widget me.ttl = gadgets.NewDurationSlider(g2, "Loop Timeout", 10 * time.Millisecond, 5 * time.Second) @@ -109,6 +111,8 @@ func debugTab(title string) { g2.Margin() g2.Pad() + + me.debug.Hide() } // will return a AAAA value that needs to be deleted @@ -273,9 +277,12 @@ func mainWindow(title string) { gr.NewButton("GO GUI Debugger", func () { debugger.DebugWindow(me.myGui) }) - gr.NewButton("Details", func () { + gr.NewButton("DNS Details", func () { me.details.Toggle() }) + gr.NewButton("DNS Debug", func () { + me.debug.Toggle() + }) } func statusGrid(n *gui.Node) { diff --git a/structs.go b/structs.go index 8b882e3..3d4e153 100644 --- a/structs.go +++ b/structs.go @@ -43,6 +43,7 @@ type Host struct { window *gadgets.BasicWindow // the main window details *gadgets.BasicWindow // more details of the DNS state + debug *gadgets.BasicWindow // more attempts to debug the DNS state tab *gui.Node // the main dns tab notes *gui.Node // using this to put notes here