2024-02-11 01:00:05 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"go.wit.com/lib/gadgets"
|
2024-02-11 02:16:51 -06:00
|
|
|
"go.wit.com/lib/gui/shell"
|
2024-02-11 01:00:05 -06:00
|
|
|
"go.wit.com/log"
|
|
|
|
)
|
|
|
|
|
|
|
|
// This initializes the first window, a group and a button
|
|
|
|
func makebasicWindow() *gadgets.BasicWindow {
|
|
|
|
log.Warn("init basicWindow state")
|
|
|
|
basicWindow = gadgets.NewBasicWindow(myGui, "Create .deb files for GO applications")
|
|
|
|
basicWindow.Make()
|
|
|
|
basicWindow.Custom = func() {
|
|
|
|
log.Info("got to close")
|
|
|
|
os.Exit(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
box1 := basicWindow.Box()
|
2024-02-11 06:32:48 -06:00
|
|
|
cBox = newControl(box1)
|
2024-02-11 01:00:05 -06:00
|
|
|
|
|
|
|
vbox := box1.Box().Horizontal()
|
|
|
|
group1 := vbox.NewGroup("controls").Horizontal() // Vertical()
|
2024-02-11 02:16:51 -06:00
|
|
|
|
2024-02-11 01:00:05 -06:00
|
|
|
group1.NewButton("go build", func() {
|
2024-02-11 02:16:51 -06:00
|
|
|
shell.Run([]string{"go", "build", "-v", "-x"})
|
|
|
|
})
|
|
|
|
|
|
|
|
group1.NewButton("read control file", func() {
|
2024-02-11 06:32:48 -06:00
|
|
|
cBox.readControlFile()
|
2024-02-11 01:00:05 -06:00
|
|
|
})
|
2024-02-11 02:16:51 -06:00
|
|
|
|
2024-02-11 01:00:05 -06:00
|
|
|
group1.NewButton("Make .deb", func() {
|
2024-02-11 03:11:41 -06:00
|
|
|
basicWindow.Disable()
|
2024-03-02 15:58:56 -06:00
|
|
|
if ok, err := cBox.buildPackage(); ok {
|
2024-02-11 03:11:41 -06:00
|
|
|
log.Info("build worked")
|
|
|
|
} else {
|
2024-03-01 07:44:02 -06:00
|
|
|
log.Warn("build failed", err)
|
2024-02-11 03:11:41 -06:00
|
|
|
}
|
|
|
|
basicWindow.Enable()
|
2024-02-11 01:00:05 -06:00
|
|
|
})
|
2024-02-11 02:16:51 -06:00
|
|
|
|
2024-02-11 01:00:05 -06:00
|
|
|
group1.NewButton("open repo", func() {
|
2024-02-11 06:32:48 -06:00
|
|
|
cBox.status.Update()
|
|
|
|
cBox.status.Toggle()
|
2024-02-11 01:00:05 -06:00
|
|
|
})
|
|
|
|
|
|
|
|
return basicWindow
|
|
|
|
}
|