more cleanups after removing old window

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-06 15:07:30 -06:00
parent 5dee2af784
commit 34bbd63bfb
4 changed files with 6 additions and 53 deletions

51
gui.go
View File

@ -22,57 +22,9 @@ func setupControlPanelWindow() {
// setup the main tab
mainWindow("DNS and IPv6 Control Panel")
detailsTab("OS Details")
debugTab("Debug")
}
func detailsTab(title string) {
var g2 *gui.Node
me.details = gadgets.NewBasicWindow(me.myGui, title)
me.details.Draw()
me.details.Hide()
g2 = me.details.Box().NewGroup("Real Stuff")
grid := g2.NewGrid("gridnuts", 2, 2)
grid.SetNext(1,1)
grid.NewLabel("domainname =")
grid.NewLabel("DEPRECATED")
// me.domainname = grid.NewLabel("domainname")
grid.NewLabel("hostname -s =")
grid.NewLabel("DEPRECATED")
grid.NewLabel("NS records =")
grid.NewLabel("DEPRECATED")
grid.NewLabel("UID =")
grid.NewLabel("DEPRECATED")
grid.NewLabel("Current IPv4 =")
grid.NewLabel("DEPRECATED")
grid.NewLabel("Current IPv6 =")
grid.NewLabel("DEPRECATED")
grid.NewLabel("Working Real IPv6 =")
grid.NewLabel("?")
grid.NewLabel("interfaces =")
me.Interfaces = grid.NewCombobox("Interfaces")
grid.NewLabel("refresh speed")
me.LocalSpeedActual = grid.NewLabel("unknown")
grid.Margin()
grid.Pad()
me.details.Hide()
}
func debugTab(title string) {
var g2 *gui.Node
@ -218,9 +170,6 @@ func mainWindow(title string) {
me.status.window.Toggle()
})
gr.NewButton("OS details", func () {
me.details.Toggle()
})
gr.NewButton("linuxstatus.New()", func () {
if (me.statusOS == nil) {
me.statusOS = linuxstatus.New()

View File

@ -29,3 +29,8 @@ func sortLines(input string) string {
tmp = strings.TrimRight(tmp, "\n")
return tmp
}
func (ls *LinuxStatus) SetSpeedActual(s string) {
if ! ls.Ready() {return}
ls.speedActual.Set(s)
}

View File

@ -100,7 +100,7 @@ func checkNetworkChanges() {
if (runtime.GOOS == "linux") {
duration := timeFunction(linuxLoop)
s := fmt.Sprint(duration)
me.LocalSpeedActual.SetText(s)
me.statusOS.SetSpeedActual(s)
} else {
// TODO: make windows and macos diagnostics
log.Warn("Windows and MacOS don't work yet")

View File

@ -44,7 +44,6 @@ type Host struct {
ipv6s map[string]dns.RR
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