From 3e823f12cb6b7c85b76cc49d6c2cc6b5317fa581 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 31 May 2019 21:28:22 -0700 Subject: [PATCH] almost final code restructure for alpha Signed-off-by: Jeff Carr --- eventChannel.go | 45 ++------------------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/eventChannel.go b/eventChannel.go index 8afd2ca..48d5fc2 100644 --- a/eventChannel.go +++ b/eventChannel.go @@ -4,7 +4,6 @@ import "log" import "github.com/golang/protobuf/proto" import pb "git.wit.com/wit/witProtobuf" - import "git.wit.com/wit/gui" var mychannel chan *pb.Event @@ -53,46 +52,6 @@ func countVMS(data *pb.Event) int { return len(vms) } -/* -func setRowValues(mh *gui.TableData, row int, vm *pb.Event_VM) { - defaultTextColor := linuxTextBlue - defaultTextYellow := linuxTextYellow - defaultTextBlack := linuxTextBlack - - if runtime.GOOS == "windows" { - defaultTextColor = windowsTextRed - defaultTextBlack = windowsTextBlack - } - // if (row % 2) == 1 { - if (row == 1) { - mh.Rows[row].HumanData[0].Color = color.RGBA{100, 100, 100, 142} // makes the background of each other row grey - } else if (row == 2) { - mh.Rows[row].HumanData[0].Color = color.RGBA{0, 0, 0, 0} // makes the background of each other row grey - } else if (row == 3) { - mh.Rows[row].HumanData[0].Color = color.RGBA{255, 255, 255, 255} // makes the background of each other row grey - } else if (row == 4) { - mh.Rows[row].HumanData[0].Color = color.RGBA{255, 255, 255, 0} // makes the background of each other row grey - } else if (row == 5) { - mh.Rows[row].HumanData[0].Color = color.RGBA{55, 55, 55, 255} // makes the background of each other row grey - } else if (row < 10) { - mh.Rows[row].HumanData[0].Color = linuxBgMauve - } else { - mh.Rows[row].HumanData[0].Color = color.RGBA{250, 250, 250, 250} - } - mh.Rows[row].HumanData[1].Text = vm.Name - mh.Rows[row].HumanData[1].Color = defaultTextColor - mh.Rows[row].HumanData[2].Text = vm.Hostname - mh.Rows[row].HumanData[2].Color = defaultTextYellow - mh.Rows[row].HumanData[3].Text = fmt.Sprintf("%d",vm.Cpus) - mh.Rows[row].HumanData[3].Color = defaultTextColor - mh.Rows[row].HumanData[4].Text = fmt.Sprintf("%d",vm.Memory) - mh.Rows[row].HumanData[4].Color = defaultTextBlack - mh.Rows[row].HumanData[5].Text = fmt.Sprintf("%d",vm.Disk) - mh.Rows[row].HumanData[5].Color = defaultTextBlack - mh.Rows[row].HumanData[6].Text = fmt.Sprintf("Details %s",vm.Name) -} -*/ - func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *gui.GuiWindow) { msgItems := data.GetResults() log.Println("ReadReceivedData() Event msgItems=", msgItems) @@ -116,8 +75,8 @@ func ReadReceivedData(data *pb.Event, mh *gui.TableData, window *gui.GuiWindow) newGuiButton.Action = "SHOW VM" newGuiButton.VM = vm // set the button to this VM newGuiButton.Account = data.Account - newGuiButton.W = window.UiWindow - newGuiButton.T = window.UiTab +// newGuiButton.W = window.UiWindow +// newGuiButton.T = window.UiTab newGuiButton.Box = mh.Box gui.Data.AllButtons = append(gui.Data.AllButtons, &newGuiButton) mh.Rows[row].HumanData[6].Button = &newGuiButton