diff --git a/eventChannel.go b/eventChannel.go index e16cc4f..5c11d2d 100644 --- a/eventChannel.go +++ b/eventChannel.go @@ -137,7 +137,7 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *ui.Window, tab newGuiButton.Account = data.Account newGuiButton.W = window newGuiButton.T = tab - gui.Data.AllButtons = append(gui.Data.AllButtons, newGuiButton) + gui.Data.AllButtons = append(gui.Data.AllButtons, &newGuiButton) mh.Rows[row].HumanData[6].Button = &newGuiButton mh.Rows[row].HumanData[6].VM = vm diff --git a/main.go b/main.go index 9201c3e..2eca5e5 100644 --- a/main.go +++ b/main.go @@ -259,26 +259,24 @@ func mainMouseClick(b *gui.GuiButton) { log.Println("\tFINISHED FULL STACK DUMP") } else if (b.Action == "ADD") { log.Println("\tSHOULD ADD ACCOUNT HERE") - if (gui.Data.EntryNick != nil) { - nick := gui.Data.EntryNick.Text() - username := gui.Data.EntryUser.Text() - password := gui.Data.EntryPass.Text() - log.Println("\tEntryNick =", nick) - log.Println("\tEntryName =", username) - log.Println("\tEntryPass =", password) - - acc := new(pb.Account) - acc.Nick = nick - acc.Username = username - acc.Password = password - - config.Accounts = append(config.Accounts, acc) - } - if (gui.Data.State == "main") { - gui.ShowMainTab(wm) - gui.Data.State = "done" + subdomain := gui.GetText(b.Box, "SUBDOMAIN") + if (subdomain == "") { + gui.ErrorWindow(wm, "Blank Name", "You must have a valid subdomain") return } + log.Println("\tsubdomain =", subdomain) + + acc := new(pb.Account) + acc.Nick = subdomain + acc.Domain = subdomain + acc.Username = "jcarr@wit.com" + acc.Email = "jcarr@wit.com" + acc.Password = "badpass" + acc.URL = "http://stackapi-api1.stackapi.customers.dev.wit.com:4000/" + config.Accounts = append(config.Accounts, acc) + + gui.ShowMainTab(wm) + gui.Data.State = "done" } else if (b.Action == "LOGIN") { log.Println("\tTRIGGER LOGIN ACCOUNT") gui.Data.State = "SEND LOGIN"