add account tab working again. still cleaning up this logic

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2019-05-27 15:25:50 -07:00
parent 258152f94c
commit 9924d6eddf
1 changed files with 23 additions and 2 deletions

25
main.go
View File

@ -191,6 +191,21 @@ func mainMouseClick(b *gui.ButtonMap) {
log.Println("THIS IS LAME. CONFIG FILE MADE NULL ACCOUNTS key =", key)
}
}
if (gui.Data.State == "main") {
gui.ShowMainTab()
gui.Data.State = "done"
return
} else if (gui.Data.State == "account1") {
gui.ShowAccountTab(0)
gui.Data.State = "main"
return
}
} else if (b.Action == "ADD TAB") {
log.Println("\tADD TAB TRY b.Action = ", b.Action)
log.Println("\tADD TAB TRY gui.ShowAccountTab(-1)")
gui.ShowAccountTab(-1)
gui.Data.State = "done"
return
} else if (b.Action == "QUIT") {
onExit(nil)
} else if (b.Action == "CREATE") {
@ -229,6 +244,11 @@ func mainMouseClick(b *gui.ButtonMap) {
config.Accounts = append(config.Accounts, acc)
}
if (gui.Data.State == "main") {
gui.ShowMainTab()
gui.Data.State = "done"
return
}
} else if (b.Action == "LOGIN") {
log.Println("\tTRIGGER LOGIN ACCOUNT")
gui.Data.State = "SEND LOGIN"
@ -336,6 +356,7 @@ func mainMouseClick(b *gui.ButtonMap) {
}
}
/*
if (gui.Data.State == "splash") {
gui.Data.State = "account1"
return
@ -349,6 +370,7 @@ func mainMouseClick(b *gui.ButtonMap) {
} else if (gui.Data.State == "QUIT") {
onExit(nil)
}
*/
}
//
@ -382,6 +404,7 @@ func prepareAndSend(event *pb.Event) {
}
// this watches the GUI primarily to process protobuf's
// maybe this is pointless or wrong
func watchGUI() {
count := 0
@ -399,7 +422,5 @@ func watchGUI() {
log.Println("gui.State = kill")
onExit(nil)
}
if (gui.Data.State == "splash") {
}
}
}