pass the account nickname to the socket
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
e5128f8b48
commit
1f80bd3249
12
main.go
12
main.go
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue