From c11e03c4998afbaacbba67fc50ee2dabba8c63f9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 1 Jun 2019 02:41:03 -0700 Subject: [PATCH] more moving to vm Signed-off-by: Jeff Carr --- debug.go | 2 +- gui.go | 12 +++++++----- mainCloudBox.go | 2 ++ vmBox.go | 19 +++++++++++++------ 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/debug.go b/debug.go index 8e21122..7ea50b8 100644 --- a/debug.go +++ b/debug.go @@ -14,7 +14,7 @@ import "github.com/davecgh/go-spew/spew" // import pb "git.wit.com/wit/witProtobuf" -// THIS IS CLEAN +// THIS IS NOT CLEAN (but probably doesn't need to be. it's debugging) // can not pass any args to this (?) /* diff --git a/gui.go b/gui.go index f0f3cfb..7090a5f 100644 --- a/gui.go +++ b/gui.go @@ -103,8 +103,8 @@ func AddTableTab(gw *GuiWindow, name string, rowcount int, parts []TableColumnDa hbox := ui.NewHorizontalBox() hbox.SetPadded(true) - a := CreateButton(gb, account, nil, "Add Virtual Machine", "createAddVmBox", nil) - hbox.Append(a.B, false) +// a := CreateButton(gb, account, nil, "Add Virtual Machine", "createAddVmBox", nil) +// hbox.Append(a.B, false) vbox.Append(hbox, false) @@ -136,11 +136,13 @@ func mouseClick(b *GuiButton) { log.Println("\tgui.mouseClick() START b = nil") } else { log.Println("\tgui.mouseClick() START b.Action =", b.Action) - if (b.Action == "createAddVmBox") { - log.Println("\tgui.mouseClick() createAddVmBox for b =", b) - createAddVmBox(b.GW, b) + /* + if (b.Action == "CreateAddVmBox") { + log.Println("\tgui.mouseClick() CreateAddVmBox for b =", b) + CreateAddVmBox(b.GW, b) return } + */ /* if (b.Action == "WINDOW CLOSE") { b.W.Hide() diff --git a/mainCloudBox.go b/mainCloudBox.go index 8f628e6..2b1b252 100644 --- a/mainCloudBox.go +++ b/mainCloudBox.go @@ -13,6 +13,8 @@ import pb "git.wit.com/wit/witProtobuf" // import "github.com/davecgh/go-spew/spew" +// THIS IS NOT CLEAN + func makeCloudInfoBox(gw *GuiWindow) *GuiBox { var gb *GuiBox gb = new(GuiBox) diff --git a/vmBox.go b/vmBox.go index bb5bd69..55f78d3 100644 --- a/vmBox.go +++ b/vmBox.go @@ -10,6 +10,8 @@ import pb "git.wit.com/wit/witProtobuf" import "github.com/davecgh/go-spew/spew" +// THIS IS NOT CLEAN + func CreateVmBox(gw *GuiWindow, vm *pb.Event_VM) { log.Println("CreateVmBox() START") log.Println("CreateVmBox() vm.Name =", vm.Name) @@ -70,9 +72,8 @@ func CreateVmBox(gw *GuiWindow, vm *pb.Event_VM) { AddBoxToTab(vm.Name, gw.UiTab, vbox) } -func createAddVmBox(gw *GuiWindow, b *GuiButton) { - log.Println("createAddVmBox() START") - name := "(" + b.Account.Nick + ")" +func CreateAddVmBox(gw *GuiWindow, b *GuiButton, name string) *GuiBox{ + log.Println("CreateAddVmBox() START name =", name) var box *GuiBox box = new(GuiBox) @@ -87,12 +88,19 @@ func createAddVmBox(gw *GuiWindow, b *GuiButton) { hbox.SetPadded(true) vbox.Append(hbox, false) + // abox := gw.MakeTab(gw) + + AddBoxToTab(name, gw.UiTab, vbox) + + return box + + /* // Add hostname entry box hostname := MakeEntryHbox(box, "Hostname:", "testhost", true, "Hostname") memory := MakeEntryHbox(box, "Memory:", "512", true, "Memory") disk := MakeEntryHbox(box, "Disk:", "20", true, "Disk") - log.Println("createAddVmBox() hostname, memory, disk =", hostname, memory, disk) + log.Println("CreateAddVmBox() hostname, memory, disk =", hostname, memory, disk) vbox.Append(ui.NewHorizontalSeparator(), false) @@ -111,6 +119,5 @@ func createAddVmBox(gw *GuiWindow, b *GuiButton) { a := CreateButton(box, nil, nil, "Cancel", "CLOSE", nil) hboxButtons.Append(a.B, false) - - AddBoxToTab(name, gw.UiTab, vbox) + */ }