fix tab view. had to pull andlabs/ui back into here
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
6d36172e2c
commit
c82e8eb6ad
|
@ -10,6 +10,8 @@ import pb "git.wit.com/wit/witProtobuf"
|
||||||
|
|
||||||
import "git.wit.com/wit/gui"
|
import "git.wit.com/wit/gui"
|
||||||
|
|
||||||
|
import "github.com/andlabs/ui"
|
||||||
|
|
||||||
var mychannel chan *pb.Event
|
var mychannel chan *pb.Event
|
||||||
|
|
||||||
var currentMessage *pb.Event
|
var currentMessage *pb.Event
|
||||||
|
@ -73,7 +75,7 @@ func countVMS(data *pb.Event) int {
|
||||||
return len(vms)
|
return len(vms)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ReadReceivedData(data *pb.Event, mh *gui.TableData) {
|
func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *ui.Window, tab *ui.Tab) {
|
||||||
msgItems := data.GetResults()
|
msgItems := data.GetResults()
|
||||||
log.Println("ReadReceivedData() Event msgItems=", msgItems)
|
log.Println("ReadReceivedData() Event msgItems=", msgItems)
|
||||||
for _, item := range msgItems {
|
for _, item := range msgItems {
|
||||||
|
@ -128,6 +130,8 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData) {
|
||||||
newButtonMap.Action = "SHOW VM"
|
newButtonMap.Action = "SHOW VM"
|
||||||
newButtonMap.VM = item // set the button to this VM
|
newButtonMap.VM = item // set the button to this VM
|
||||||
newButtonMap.Account = data.Account
|
newButtonMap.Account = data.Account
|
||||||
|
newButtonMap.W = window
|
||||||
|
newButtonMap.T = tab
|
||||||
gui.Data.AllButtons = append(gui.Data.AllButtons, newButtonMap)
|
gui.Data.AllButtons = append(gui.Data.AllButtons, newButtonMap)
|
||||||
mh.Rows[row].HumanData[6].Button = &newButtonMap
|
mh.Rows[row].HumanData[6].Button = &newButtonMap
|
||||||
mh.Rows[row].HumanData[6].VM = item
|
mh.Rows[row].HumanData[6].VM = item
|
||||||
|
|
4
main.go
4
main.go
|
@ -276,7 +276,7 @@ func mainMouseClick(b *gui.ButtonMap) {
|
||||||
log.Println("\tATTEMPTING TO SHOW VM IN WINDOW")
|
log.Println("\tATTEMPTING TO SHOW VM IN WINDOW")
|
||||||
go gui.GoShowVM()
|
go gui.GoShowVM()
|
||||||
} else {
|
} else {
|
||||||
log.Println("\tATTEMPTING TO SHOW VM TAB")
|
log.Println("\tATTEMPTING TO SHOW VM TAB", b.T)
|
||||||
gui.CreateVmBox(b.T, b.VM)
|
gui.CreateVmBox(b.T, b.VM)
|
||||||
}
|
}
|
||||||
} else if (b.Action == "SHOW") {
|
} else if (b.Action == "SHOW") {
|
||||||
|
@ -302,7 +302,7 @@ func mainMouseClick(b *gui.ButtonMap) {
|
||||||
if (count != 0) {
|
if (count != 0) {
|
||||||
name := "Virtual Machines (" + b.Account.Nick + ")"
|
name := "Virtual Machines (" + b.Account.Nick + ")"
|
||||||
mh := gui.AddVmsTab(name, count, b.Account)
|
mh := gui.AddVmsTab(name, count, b.Account)
|
||||||
ReadReceivedData(currentMessage, mh)
|
ReadReceivedData(currentMessage, mh, b.W, b.T)
|
||||||
}
|
}
|
||||||
currentMessage = nil
|
currentMessage = nil
|
||||||
gui.Data.State = "done"
|
gui.Data.State = "done"
|
||||||
|
|
Loading…
Reference in New Issue