cleaning up boxes
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
26bcac9b85
commit
0316547d1d
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import "log"
|
||||
import "fmt"
|
||||
|
||||
import "git.wit.com/wit/gui"
|
||||
|
||||
|
@ -18,25 +19,26 @@ func makeCloudInfoBox(gw *gui.GuiWindow) {
|
|||
tmp := config.Hostname + " (" + config.IPv6 + ")"
|
||||
gui.MakeEntryHbox(box, "hostname:", tmp, true, "Hostname")
|
||||
|
||||
box = gui.HardBox(gw, gui.Xaxis)
|
||||
for key, a := range config.Accounts {
|
||||
gui.HardVerticalBreak(box)
|
||||
vbox := gui.VerticalBox(box, fmt.Sprintf("ACCOUNT %d", key))
|
||||
log.Println("account = ", key, a)
|
||||
log.Println("Accounts[key] = ", config.Accounts[key])
|
||||
log.Println("account.Nick = ", config.Accounts[key].Nick)
|
||||
log.Println("account.Username = ", config.Accounts[key].Username)
|
||||
log.Println("account.Token = ", config.Accounts[key].Token)
|
||||
|
||||
gui.NewLabel(box, config.Accounts[key].Domain)
|
||||
gui.NewLabel(box, config.Accounts[key].Email)
|
||||
gui.NewLabel(vbox, config.Accounts[key].Domain)
|
||||
gui.NewLabel(vbox, config.Accounts[key].Email)
|
||||
|
||||
name := "Login " + config.Accounts[key].Nick
|
||||
makeButton(box, config.Accounts[key], nil, name, "LOGIN", login)
|
||||
makeButton(vbox, config.Accounts[key], nil, name, "LOGIN", login)
|
||||
|
||||
name = "Show " + config.Accounts[key].Nick
|
||||
makeButton(box, config.Accounts[key], nil, name, "SHOW", nil)
|
||||
makeButton(vbox, config.Accounts[key], nil, name, "SHOW", nil)
|
||||
}
|
||||
|
||||
makeButton(box, nil, nil, "Add Account", "ADD TAB", addSubdomainButton)
|
||||
makeButton(box, nil, nil, "Add Account", "ADD TAB", addSubdomainClick)
|
||||
makeButton(box, nil, nil, "Quit", "QUIT", nil)
|
||||
log.Println("makeCloudInfoBox() END")
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package main
|
||||
|
||||
import "log"
|
||||
|
||||
import "git.wit.com/wit/gui"
|
||||
|
||||
// import "github.com/andlabs/ui"
|
||||
// import _ "github.com/andlabs/ui/winmanifest"
|
||||
|
||||
// import pb "git.wit.com/wit/witProtobuf"
|
||||
|
||||
func debugClick(b *gui.GuiButton) {
|
||||
log.Println("debugClick() START")
|
||||
gw := b.Box.Window
|
||||
|
||||
// if there is not an account, then go to 'make account'
|
||||
gw = gui.InitGuiWindow("debugClick() Box22", gw)
|
||||
|
||||
log.Println("debugClick() AddGenericBox() START")
|
||||
box := gui.AddGenericBox(gw, "debugClick")
|
||||
log.Println("debugClick() AddGenericBox() END box =", box)
|
||||
|
||||
makeButton(box, nil, nil, "Generate", "SUBDOMAIN", nil)
|
||||
gui.HorizontalBreak(box)
|
||||
makeButton(box, nil, nil, "Create Subdomain Account", "ADD", addSubdomainClick)
|
||||
box = gui.HardBox(gw, gui.Xaxis)
|
||||
makeButton(box, nil, nil, "Generate 1", "SUBDOMAIN", nil)
|
||||
makeButton(box, nil, nil, "Generate 2", "SUBDOMAIN", nil)
|
||||
|
||||
log.Println("debugClick() END box =", box)
|
||||
}
|
|
@ -83,13 +83,14 @@ func splashClick(b *gui.GuiButton) {
|
|||
|
||||
gui.AddEntry(box, "SUBDOMAIN")
|
||||
gui.HorizontalBreak(box)
|
||||
makeButton(box, nil, nil, "Create Subdomain Account", "ADD", addSubdomainButton)
|
||||
makeButton(box, nil, nil, "Create Subdomain Account", "ADD", addSubdomainClick)
|
||||
makeButton(box, nil, nil, "Debug Tab", "DEBUG", debugClick)
|
||||
|
||||
log.Println("splashClick() END box =", box)
|
||||
}
|
||||
|
||||
func addSubdomainButton(b *gui.GuiButton) {
|
||||
log.Println("addSubdomainButton() START")
|
||||
func addSubdomainClick(b *gui.GuiButton) {
|
||||
log.Println("addSubdomainClick() START")
|
||||
subdomain := gui.GetText(b.Box, "SUBDOMAIN")
|
||||
if (subdomain == "") {
|
||||
gui.ErrorWindow(b.Box.Window, "Blank Name", "You must have a valid subdomain")
|
||||
|
@ -108,7 +109,7 @@ func addSubdomainButton(b *gui.GuiButton) {
|
|||
|
||||
makeCloudInfoBox(b.Box.Window)
|
||||
State = "done"
|
||||
log.Println("addSubdomainButton() END")
|
||||
log.Println("addSubdomainClick() END")
|
||||
}
|
||||
|
||||
func generateSubdomain(b *gui.GuiButton) {
|
||||
|
|
Loading…
Reference in New Issue