diff options
| author | Jeff Carr <[email protected]> | 2019-05-24 19:29:08 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-05-24 19:29:08 -0700 |
| commit | 601ffee7c0d064abf5cab9f0c0df6069ed661c08 (patch) | |
| tree | eb4688b7bda8c6c601553bc2d306b4a0209f3ce1 | |
| parent | 3198bd3484fed9e3fe59d20a5828c3de0e2c75e9 (diff) | |
fixed. control panel is working again
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | gui.go | 20 | ||||
| -rw-r--r-- | mainCloudBox.go | 4 | ||||
| -rw-r--r-- | structs.go | 7 |
3 files changed, 19 insertions, 12 deletions
@@ -5,6 +5,8 @@ import "log" import "github.com/andlabs/ui" import _ "github.com/andlabs/ui/winmanifest" +import pb "git.wit.com/wit/witProtobuf" + import "github.com/davecgh/go-spew/spew" func InitColumns(mh *TableData, parts []TableColumnData) { @@ -205,32 +207,34 @@ func CreateButton(name string, note string, custom func(*ButtonMap)) *ui.Button return newB } -func CreateAccountButton(account string, custom func(*ButtonMap)) *ui.Button { - name := "Show " + account +func CreateAccountButton(pbC *pb.Config_Account, custom func(*ButtonMap)) *ui.Button { + name := "Show " + pbC.Nick newB := ui.NewButton(name) newB.OnClicked(defaultButtonClick) var newmap ButtonMap newmap.B = newB + newmap.Account = pbC newmap.Note = "SHOW" - newmap.Name = name - newmap.AccNick = account +// newmap.Name = name +// newmap.AccNick = account newmap.custom = custom Data.AllButtons = append(Data.AllButtons, newmap) return newB } -func CreateLoginButton(account string, custom func(*ButtonMap)) *ui.Button { - name := "Login " + account +func CreateLoginButton(pbC *pb.Config_Account, custom func(*ButtonMap)) *ui.Button { + name := "Login " + pbC.Nick newB := ui.NewButton(name) newB.OnClicked(defaultButtonClick) var newmap ButtonMap newmap.B = newB + newmap.Account = pbC newmap.Note = "LOGIN" - newmap.Name = name - newmap.AccNick = account +// newmap.Name = name +// newmap.AccNick = account newmap.custom = custom Data.AllButtons = append(Data.AllButtons, newmap) diff --git a/mainCloudBox.go b/mainCloudBox.go index a3a4b0c..76a5ba8 100644 --- a/mainCloudBox.go +++ b/mainCloudBox.go @@ -72,10 +72,10 @@ func makeCloudInfoBox(custom func(*ButtonMap)) *ui.Box { agrid.Append(ui.NewLabel(Data.Config.Accounts[key].Username), 2, row, 1, 1, true, ui.AlignFill, false, ui.AlignFill) agrid.Append(ui.NewLabel(Data.Config.Accounts[key].Domainname), 3, row, 1, 1, true, ui.AlignFill, false, ui.AlignFill) - l := CreateLoginButton(Data.Config.Accounts[key].Nick, custom) + l := CreateLoginButton(Data.Config.Accounts[key], custom) agrid.Append(l, 4, row, 1, 1, true, ui.AlignFill, false, ui.AlignFill) - b := CreateAccountButton(Data.Config.Accounts[key].Nick, custom) + b := CreateAccountButton(Data.Config.Accounts[key], custom) agrid.Append(b, 5, row, 1, 1, true, ui.AlignFill, false, ui.AlignFill) row += 1 @@ -99,9 +99,12 @@ type TableColumnData struct { type ButtonMap struct { B *ui.Button FB *ui.FontButton - onClick func (int, string) - onChanged func (int, string) + Account *pb.Config_Account + +// onClick func (int, string) +// onChanged func (int, string) custom func (*ButtonMap) + pbVM *pb.Event_VM Name string // the text on the button Note string // what type of button |
