fixed. control panel is working again
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
3198bd3484
commit
601ffee7c0
20
gui.go
20
gui.go
|
@ -5,6 +5,8 @@ import "log"
|
||||||
import "github.com/andlabs/ui"
|
import "github.com/andlabs/ui"
|
||||||
import _ "github.com/andlabs/ui/winmanifest"
|
import _ "github.com/andlabs/ui/winmanifest"
|
||||||
|
|
||||||
|
import pb "git.wit.com/wit/witProtobuf"
|
||||||
|
|
||||||
import "github.com/davecgh/go-spew/spew"
|
import "github.com/davecgh/go-spew/spew"
|
||||||
|
|
||||||
func InitColumns(mh *TableData, parts []TableColumnData) {
|
func InitColumns(mh *TableData, parts []TableColumnData) {
|
||||||
|
@ -205,32 +207,34 @@ func CreateButton(name string, note string, custom func(*ButtonMap)) *ui.Button
|
||||||
return newB
|
return newB
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateAccountButton(account string, custom func(*ButtonMap)) *ui.Button {
|
func CreateAccountButton(pbC *pb.Config_Account, custom func(*ButtonMap)) *ui.Button {
|
||||||
name := "Show " + account
|
name := "Show " + pbC.Nick
|
||||||
newB := ui.NewButton(name)
|
newB := ui.NewButton(name)
|
||||||
newB.OnClicked(defaultButtonClick)
|
newB.OnClicked(defaultButtonClick)
|
||||||
|
|
||||||
var newmap ButtonMap
|
var newmap ButtonMap
|
||||||
newmap.B = newB
|
newmap.B = newB
|
||||||
|
newmap.Account = pbC
|
||||||
newmap.Note = "SHOW"
|
newmap.Note = "SHOW"
|
||||||
newmap.Name = name
|
// newmap.Name = name
|
||||||
newmap.AccNick = account
|
// newmap.AccNick = account
|
||||||
newmap.custom = custom
|
newmap.custom = custom
|
||||||
Data.AllButtons = append(Data.AllButtons, newmap)
|
Data.AllButtons = append(Data.AllButtons, newmap)
|
||||||
|
|
||||||
return newB
|
return newB
|
||||||
}
|
}
|
||||||
|
|
||||||
func CreateLoginButton(account string, custom func(*ButtonMap)) *ui.Button {
|
func CreateLoginButton(pbC *pb.Config_Account, custom func(*ButtonMap)) *ui.Button {
|
||||||
name := "Login " + account
|
name := "Login " + pbC.Nick
|
||||||
newB := ui.NewButton(name)
|
newB := ui.NewButton(name)
|
||||||
newB.OnClicked(defaultButtonClick)
|
newB.OnClicked(defaultButtonClick)
|
||||||
|
|
||||||
var newmap ButtonMap
|
var newmap ButtonMap
|
||||||
newmap.B = newB
|
newmap.B = newB
|
||||||
|
newmap.Account = pbC
|
||||||
newmap.Note = "LOGIN"
|
newmap.Note = "LOGIN"
|
||||||
newmap.Name = name
|
// newmap.Name = name
|
||||||
newmap.AccNick = account
|
// newmap.AccNick = account
|
||||||
newmap.custom = custom
|
newmap.custom = custom
|
||||||
Data.AllButtons = append(Data.AllButtons, newmap)
|
Data.AllButtons = append(Data.AllButtons, newmap)
|
||||||
|
|
||||||
|
|
|
@ -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].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)
|
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)
|
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)
|
agrid.Append(b, 5, row, 1, 1, true, ui.AlignFill, false, ui.AlignFill)
|
||||||
|
|
||||||
row += 1
|
row += 1
|
||||||
|
|
|
@ -99,9 +99,12 @@ type TableColumnData struct {
|
||||||
type ButtonMap struct {
|
type ButtonMap struct {
|
||||||
B *ui.Button
|
B *ui.Button
|
||||||
FB *ui.FontButton
|
FB *ui.FontButton
|
||||||
onClick func (int, string)
|
Account *pb.Config_Account
|
||||||
onChanged func (int, string)
|
|
||||||
|
// onClick func (int, string)
|
||||||
|
// onChanged func (int, string)
|
||||||
custom func (*ButtonMap)
|
custom func (*ButtonMap)
|
||||||
|
|
||||||
pbVM *pb.Event_VM
|
pbVM *pb.Event_VM
|
||||||
Name string // the text on the button
|
Name string // the text on the button
|
||||||
Note string // what type of button
|
Note string // what type of button
|
||||||
|
|
Loading…
Reference in New Issue