popup window if login fails

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-24 00:04:37 -07:00
parent f4acaa113a
commit 76243308af
1 changed files with 17 additions and 7 deletions

24
main.go
View File

@ -1,6 +1,7 @@
package main package main
import "log" import "log"
import "fmt"
import "os" import "os"
import "time" import "time"
import "os/user" import "os/user"
@ -174,13 +175,22 @@ func buttonClick(b *gui.ButtonMap) {
gui.SocketError() gui.SocketError()
gui.Data.State = "done" gui.Data.State = "done"
} else { } else {
count := countVMS(currentMessage) log.Println("LOGIN currentMessage =", currentMessage)
log.Println("LOGIN VMS currentMessage =", currentMessage) if (currentMessage.Type == pb.Event_OK) {
log.Println("LOGIN VMS count =", count) log.Println("LOGIN WAS OK!")
if (count != 0) { log.Println("LOGIN WAS OK!")
name := "Virtual Machines (" + b.AccNick + ")" log.Println("LOGIN WAS OK!")
mh := gui.AddVmsTab(name, count) }
ReadReceivedData(currentMessage, mh) if (currentMessage.Type == pb.Event_FAIL) {
log.Println("LOGIN FAILED")
log.Println("LOGIN FAILED")
log.Println("LOGIN FAILED")
msg := "On account " + gui.Data.AccNick + "\n"
msg += "pb.Comment = " + currentMessage.Comment + "\n"
msg += "pb.Id = " + fmt.Sprintf("%d", currentMessage.Id) + "\n"
msg += "pb.Email = " + currentMessage.Email + "\n"
msg += "pb.Username = " + currentMessage.Username + "\n"
gui.ErrorWindow("Login Failed", msg)
} }
currentMessage = nil currentMessage = nil
gui.Data.State = "done" gui.Data.State = "done"