clean up the code more
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
4b73667186
commit
3bc6811811
|
@ -89,37 +89,16 @@ func format(mybut *ui.Button) {
|
||||||
simpleProcess("dd if=../u-boot/u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1K seek=8")
|
simpleProcess("dd if=../u-boot/u-boot-sunxi-with-spl.bin of=/dev/sdb bs=1K seek=8")
|
||||||
}
|
}
|
||||||
|
|
||||||
func hostnameButton(hostname string, something func(*ui.Button)) ui.Control {
|
func addButton(vbox *ui.Box, label string, click func(*ui.Button)) {
|
||||||
tmpbox := ui.NewHorizontalBox()
|
hbox := ui.NewHorizontalBox()
|
||||||
tmpbox.SetPadded(true)
|
hbox.SetPadded(true)
|
||||||
|
|
||||||
tmpButton := ui.NewButton(hostname)
|
// look up translation here for 'label'
|
||||||
tmpbox.Append(tmpButton, false)
|
button := ui.NewButton(label)
|
||||||
tmpButton.OnClicked(something)
|
hbox.Append(button, false)
|
||||||
/*
|
button.OnClicked(click)
|
||||||
tmpButton.OnClicked(func(*ui.Button) {
|
|
||||||
log.Println("hostname =", config.String("hostname"), tmpButton)
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
return tmpbox
|
vbox.Append(hbox, false)
|
||||||
}
|
|
||||||
|
|
||||||
func addButton(vbox *ui.Box, hostname string, buttonClick func(*ui.Button)) {
|
|
||||||
tmpbox := ui.NewHorizontalBox()
|
|
||||||
tmpbox.SetPadded(true)
|
|
||||||
|
|
||||||
/*
|
|
||||||
tmpButton := ui.NewButton(hostname)
|
|
||||||
tmpbox.Append(tmpButton, false)
|
|
||||||
tmpButton.OnClicked(doButton)
|
|
||||||
log.Println("addButton() set doButton =", tmpButton)
|
|
||||||
tmpButton.OnClicked(func(*ui.Button) {
|
|
||||||
log.Println("hostname =", config.String("hostname"), tmpButton)
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
|
|
||||||
vbox.Append(hostnameButton(hostname, buttonClick), false)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeButtonsPage(names []string) ui.Control {
|
func makeButtonsPage(names []string) ui.Control {
|
||||||
|
|
Loading…
Reference in New Issue