summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-25 18:37:44 -0600
committerJeff Carr <[email protected]>2024-02-25 18:37:44 -0600
commit7b4eb41de7e1c65c07dfc8f04f1263b3f258b268 (patch)
tree0b8e95385cef782a74c554d53223c2ad55d60825
parentfd082d49659c722776d72b97b9eca9d4aab8b78e (diff)
better names with Init() vs New()v0.21.1
-rw-r--r--argv.go (renamed from debugger.go)1
-rw-r--r--controlPanelWindow.go6
-rw-r--r--digStatusWindow.go2
-rw-r--r--errorBox.go2
-rw-r--r--hostnameStatusWindow.go2
-rw-r--r--main.go10
6 files changed, 14 insertions, 9 deletions
diff --git a/debugger.go b/argv.go
index 116d549..324e7d7 100644
--- a/debugger.go
+++ b/argv.go
@@ -11,6 +11,7 @@ import (
)
var args struct {
+ Daemon bool `arg:"--daemon" help:"run without a gui"`
}
func init() {
diff --git a/controlPanelWindow.go b/controlPanelWindow.go
index 827e6c3..c9e1917 100644
--- a/controlPanelWindow.go
+++ b/controlPanelWindow.go
@@ -46,13 +46,14 @@ func makeMainWindow() {
func statusGrid(n *gui.Node) {
problems := n.NewGroup("status")
- grid := problems.NewGrid("nuts", 3, 1)
+ grid := problems.RawGrid()
grid.NewLabel("hostname =")
me.hostnameStatus = grid.NewLabel("invalid")
grid.NewButton("Linux Status", func() {
me.statusOS.Toggle()
})
+ grid.NextRow()
me.statusIPv6 = gadgets.NewOneLiner(grid, "DNS Lookup")
me.statusIPv6.SetText("known")
@@ -62,6 +63,7 @@ func statusGrid(n *gui.Node) {
}
me.digStatus.window.Toggle()
})
+ grid.NextRow()
grid.NewLabel("DNS Status")
me.DnsStatus = grid.NewLabel("unknown")
@@ -71,6 +73,7 @@ func statusGrid(n *gui.Node) {
}
me.statusDNS.window.Toggle()
})
+ grid.NextRow()
grid.NewLabel("DNS API")
me.DnsAPIstatus = grid.NewLabel("unknown")
@@ -85,6 +88,7 @@ func statusGrid(n *gui.Node) {
}
}
})
+ grid.NextRow()
}
func myDefaultExit(n *gui.Node) {
diff --git a/digStatusWindow.go b/digStatusWindow.go
index a0917f5..e62be77 100644
--- a/digStatusWindow.go
+++ b/digStatusWindow.go
@@ -55,7 +55,7 @@ type digStatus struct {
statusHTTP *gadgets.OneLiner
}
-func NewDigStatusWindow() *digStatus {
+func InitDigStatus() *digStatus {
var ds *digStatus
ds = new(digStatus)
diff --git a/errorBox.go b/errorBox.go
index 0a16631..b2605e5 100644
--- a/errorBox.go
+++ b/errorBox.go
@@ -43,7 +43,7 @@ type anError struct {
problem *Problem
}
-func NewErrorBox(p *gui.Node, name string, ip string) *errorBox {
+func InitErrorBox(p *gui.Node, name string, ip string) *errorBox {
var eb *errorBox
eb = new(errorBox)
eb.parent = p
diff --git a/hostnameStatusWindow.go b/hostnameStatusWindow.go
index 6a88fae..5ce8ae9 100644
--- a/hostnameStatusWindow.go
+++ b/hostnameStatusWindow.go
@@ -56,7 +56,7 @@ type hostnameStatus struct {
// dnsAction *gui.Node
}
-func NewHostnameStatusWindow() *hostnameStatus {
+func InitHostnameStatus() *hostnameStatus {
var hs *hostnameStatus
hs = new(hostnameStatus)
diff --git a/main.go b/main.go
index c220754..5e4d7e2 100644
--- a/main.go
+++ b/main.go
@@ -46,17 +46,17 @@ func main() {
makeMainWindow()
// These are your problems
- me.problems = NewErrorBox(me.window.Box(), "Errors", "has problems?")
+ me.problems = InitErrorBox(me.window.Box(), "Errors", "has problems?")
me.problems.addIPerror(RR, USER, "1:1:1:1")
me.window.Show()
me.debug = debugWindow("Debugging")
- me.digStatus = NewDigStatusWindow()
- me.statusDNS = NewHostnameStatusWindow()
-
- me.statusOS = linuxstatus.NewLinuxStatus(me.myGui)
+ // 3 external windows that should be seperate go packages
+ me.digStatus = InitDigStatus()
+ me.statusDNS = InitHostnameStatus()
+ me.statusOS = linuxstatus.InitLinuxStatus()
digLoop()