From eef2c0592fb0f0d9b1076069b8a0e72881ff4fc6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 3 Nov 2021 00:47:11 -0500 Subject: [PATCH] SSH: fix files. use os/user Current() Signed-off-by: Jeff Carr --- window-main.go | 17 ++++++----------- window-ssh-generic.go | 16 +++++++++------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/window-main.go b/window-main.go index e107017..5b069bd 100644 --- a/window-main.go +++ b/window-main.go @@ -1,26 +1,23 @@ package main -import ( "log" +import ( +// "log" "git.wit.org/wit/gui" ) func mainWindow(w *gui.Node) *gui.Node { if (w == nil) { - gui.Config.Title = "Main Personal GUI Window" + gui.Config.Title = "WIT Debian Control Panel" gui.Config.Width = 101 gui.Config.Height = 101 w = gui.NewWindow() } - newTab := w.AddTab("MAIN TAB", nil) + newTab := w.AddTab("Main Tab", nil) ////////////////////////// MAIN //////////////////////////////// - g1 := newTab.AddGroup("Windows") + g1 := newTab.AddGroup("unsorted") - g1.AddButton("resolv.conf", func (*gui.Node) { - log.Println("supposed to make the resolv.conf window") - resolvWindow(nil) - }) g1.AddButton("Generic SSH Window", func (*gui.Node) { sshGenericWindow(nil) }) @@ -29,9 +26,7 @@ func mainWindow(w *gui.Node) *gui.Node { updateDNS(nil) }) - g1.AddButton("tabResets()", func (*gui.Node) { - tabResets(w) - }) + tabResets(w) g1.AddButton("www url's", func (*gui.Node) { windowAddWWW(nil) diff --git a/window-ssh-generic.go b/window-ssh-generic.go index 0f61977..e384391 100644 --- a/window-ssh-generic.go +++ b/window-ssh-generic.go @@ -1,6 +1,7 @@ package main import "log" +import "os/user" import "reflect" import "git.wit.org/wit/gui" @@ -26,13 +27,15 @@ func sshGenericWindow(w *gui.Node) { "jcarr", "hugo") - userNode.SetText("something") userNode.OnChanged = func () { username = userNode.GetText() log.Println("SETTING: username=", username) userNode.Dump() // panic("blah") } + tmp, _ := user.Current() + username = tmp.Username + userNode.SetText(username) userNode.Dump() // panic("blah") @@ -40,18 +43,17 @@ func sshGenericWindow(w *gui.Node) { gNode = tab.AddGroup("homename") hostNode := gNode.AddComboBox("hostname", - "fire.lab.wit.org", - "www.wit.org", - "bind.wit.org", - "ns1.wit.com", - "ns2.wit.com") + "www", + "mirrors", + "git") - hostNode.SetText("fire") hostNode.OnChanged = func () { log.Println("STARTED HOSTNAME") hostname = hostNode.GetText() log.Println("ENDED GetText() HOSTNAME") } + hostname = "mirrors" + hostNode.SetText("mirrors") ////////////// connect ///////////////////////// gNode = tab.AddGroup("connect")