table mouse clicks are now almost all handled the same way
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
2a00db1c6b
commit
ce7788d613
|
@ -123,6 +123,15 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData) {
|
||||||
mh.Rows[row].HumanData[5].Color = defaultTextBlack
|
mh.Rows[row].HumanData[5].Color = defaultTextBlack
|
||||||
mh.Rows[row].HumanData[6].Text = fmt.Sprintf("Details %s",item.Name)
|
mh.Rows[row].HumanData[6].Text = fmt.Sprintf("Details %s",item.Name)
|
||||||
|
|
||||||
|
// create 'fake' button entries for the mouse clicks within tables
|
||||||
|
var newButtonMap gui.ButtonMap
|
||||||
|
newButtonMap.Action = "SHOW VM"
|
||||||
|
newButtonMap.VM = item // set the button to this VM
|
||||||
|
newButtonMap.Account = data.Account
|
||||||
|
gui.Data.AllButtons = append(gui.Data.AllButtons, newButtonMap)
|
||||||
|
mh.Rows[row].HumanData[6].Button = &newButtonMap
|
||||||
|
mh.Rows[row].HumanData[6].VM = item
|
||||||
|
|
||||||
mh.Rows[row].VM = item
|
mh.Rows[row].VM = item
|
||||||
|
|
||||||
log.Println("\titem=", item)
|
log.Println("\titem=", item)
|
||||||
|
|
6
main.go
6
main.go
|
@ -163,8 +163,10 @@ func mainMouseClick(b *gui.ButtonMap) {
|
||||||
onExit(fmt.Errorf("mainMouseClick() got b = nil"))
|
onExit(fmt.Errorf("mainMouseClick() got b = nil"))
|
||||||
}
|
}
|
||||||
log.Println("mainMouseClick() b.Action =", b.Action)
|
log.Println("mainMouseClick() b.Action =", b.Action)
|
||||||
|
log.Println("mainMouseClick() b.Action =", b.Account)
|
||||||
|
spew.Dump(b.Account)
|
||||||
|
|
||||||
gui.Data.Current = b.Account
|
// gui.Data.Current = b.Account
|
||||||
log.Println("mainMouseClick() BACK IN CONTROL PANEL CODE")
|
log.Println("mainMouseClick() BACK IN CONTROL PANEL CODE")
|
||||||
if (b.Account != nil) {
|
if (b.Account != nil) {
|
||||||
log.Println("\tmainMouseClick() setting current account = ", b.Account.Nick)
|
log.Println("\tmainMouseClick() setting current account = ", b.Account.Nick)
|
||||||
|
@ -191,6 +193,7 @@ func mainMouseClick(b *gui.ButtonMap) {
|
||||||
log.Println("\tFINISHED FULL STACK DUMP")
|
log.Println("\tFINISHED FULL STACK DUMP")
|
||||||
} else if (b.Action == "ADD") {
|
} else if (b.Action == "ADD") {
|
||||||
log.Println("\tSHOULD ADD ACCOUNT HERE")
|
log.Println("\tSHOULD ADD ACCOUNT HERE")
|
||||||
|
/*
|
||||||
if (gui.Data.CurrentTab != nil) {
|
if (gui.Data.CurrentTab != nil) {
|
||||||
if (gui.Data.CurrentTab.EntryNick != nil) {
|
if (gui.Data.CurrentTab.EntryNick != nil) {
|
||||||
nick := gui.Data.CurrentTab.EntryNick.Text()
|
nick := gui.Data.CurrentTab.EntryNick.Text()
|
||||||
|
@ -208,6 +211,7 @@ func mainMouseClick(b *gui.ButtonMap) {
|
||||||
config.Accounts = append(config.Accounts, acc)
|
config.Accounts = append(config.Accounts, acc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
} else if (b.Action == "LOGIN") {
|
} else if (b.Action == "LOGIN") {
|
||||||
log.Println("\tTRIGGER LOGIN ACCOUNT")
|
log.Println("\tTRIGGER LOGIN ACCOUNT")
|
||||||
gui.Data.State = "SEND LOGIN"
|
gui.Data.State = "SEND LOGIN"
|
||||||
|
|
Loading…
Reference in New Issue