pass the account nickname to the socket

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-23 17:43:41 -07:00
parent e5128f8b48
commit 1f80bd3249
1 changed files with 9 additions and 3 deletions

12
main.go
View File

@ -122,6 +122,7 @@ func buttonClick(b *gui.ButtonMap) {
} else {
log.Println("\tb.Name", b.Name)
log.Println("\tb.Note", b.Note)
log.Println("\tb.AccNick", b.AccNick)
if (b.Note == "BACK") {
gui.Data.State = "splash"
}
@ -154,22 +155,26 @@ func buttonClick(b *gui.ButtonMap) {
}
if (b.Note == "SHOW") {
log.Println("\tTRIGGER DISPLAY ACCOUNT")
gui.Data.State = "READ WEBSOCKET"
gui.Data.State = "READ WEBSOCKET"
gui.Data.AccNick = b.AccNick
for {
log.Println("Sleep() in buttonClick() gui.Data.State =", gui.Data.State)
time.Sleep(200 * time.Millisecond)
if (gui.Data.State == "NEW PROTOBUF") {
if (currentMessage == nil) {
gui.SocketError()
gui.Data.State = "done"
} else {
count := countVMS(currentMessage)
log.Println("SHOW VMS currentMessage =", currentMessage)
log.Println("SHOW VMS count =", count)
if (count != 0) {
mh := gui.AddVmsTab(count)
name := "Virtual Machines (" + b.AccNick + ")"
mh := gui.AddVmsTab(name, count)
ReadReceivedData(currentMessage, mh)
}
currentMessage = nil
gui.Data.State = "done"
}
return
}
@ -185,7 +190,8 @@ func buttonClick(b *gui.ButtonMap) {
time.Sleep(200 * time.Millisecond)
if (gui.Data.State == "NEW PROTOBUF") {
count := countVMS(currentMessage)
mh := gui.AddVmsTab(count)
name := "Bmath VMs"
mh := gui.AddVmsTab(name, count)
ReadReceivedData(currentMessage, mh)
currentMessage = nil
return