diff options
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | args.go | 1 | ||||
| -rw-r--r-- | gui.go | 15 | ||||
| -rw-r--r-- | main.go | 5 |
4 files changed, 22 insertions, 5 deletions
@@ -1,5 +1,5 @@ run: build - ./control-panel-dns + ./control-panel-dns >/tmp/witgui.log.stderr 2>&1 install: go install -v go.wit.com/control-panel-dns@latest @@ -91,3 +91,7 @@ sudo-cp: go-get: go install -v check.lab.wit.org/gui + +log: + reset + tail -f /tmp/witgui.* /tmp/guilogfile @@ -12,6 +12,7 @@ type LogOptions struct { VerboseDNS bool `arg:"--verbose-dns" help:"debug your dns settings"` LogFile string `help:"write all output to a file"` // User string `arg:"env:USER"` + Display string `arg:"env:DISPLAY"` } var args struct { @@ -2,6 +2,7 @@ package main import ( + "fmt" "os" "os/user" "strconv" @@ -12,8 +13,8 @@ import ( "github.com/davecgh/go-spew/spew" ) -// This initializes the first window -func initGUI() { +// This setups up the dns control panel window +func setupControlPanelWindow() { me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard() me.window.Dump(true) @@ -36,6 +37,14 @@ func addDNSTab(title string) { g2.NewButton("gui.DebugWindow()", func () { gui.DebugWindow() }) + + g2.NewButton("Load 'gocui'", func () { + // this set the xterm and mate-terminal window title. maybe works generally? + fmt.Println("\033]0;" + title + "blah \007") + gui.StartS("gocui") + gui.Redraw("gocui") + }) + g2.NewButton("Network Interfaces", func () { for i, t := range me.ifmap { log("name =", t.iface.Name) @@ -106,7 +115,7 @@ func myDefaultExit(n *gui.Node) { func nsupdateGroup(w *gui.Node) { g := w.NewGroup("dns update") - grid := g.NewGrid("fucknuts", 2, 2) + grid := g.NewGrid("gridnuts", 2, 2) grid.SetNext(1,1) grid.NewLabel("hostname =") @@ -42,7 +42,10 @@ func main() { // myGui = gui.Main(initGUI) myGui = gui.Start() sleep(1) - initGUI() + setupControlPanelWindow() + sleep(1) + myGui.LoadPlugin("gocui") + // gui.Redraw("gocui") sleep(1) checkNetworkChanges() } |
