Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-09 11:55:18 -06:00
parent cf3e295566
commit 41e517b85d
1 changed files with 25 additions and 2 deletions

27
main.go
View File

@ -10,6 +10,7 @@ import (
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
"go.wit.com/apps/control-panel-dns/smartwindow"
"go.wit.com/apps/myrepos/repostatus"
)
var myGui *gui.Node
@ -35,6 +36,8 @@ type repo struct {
cButton *gui.Node // commit button
pButton *gui.Node // push button
status *repostatus.RepoStatus
}
func main() {
@ -65,8 +68,16 @@ func addRepo(grid *gui.Node, path string) *repo {
newRepo.jcarrVersion = grid.NewLabel("")
newRepo.dirtyLabel = grid.NewLabel("")
newRepo.cButton = grid.NewButton("commit", func () {
log.Println("commit")
newRepo.cButton = grid.NewButton("status", func () {
log.Println("repo status for", newRepo.path)
if newRepo.status == nil {
newRepo.status = repostatus.New(myGui, newRepo.path)
newRepo.status.InitWindow()
newRepo.status.Make()
newRepo.status.Draw()
newRepo.status.Draw2()
}
newRepo.status.Toggle()
})
newRepo.pButton = grid.NewButton("push", func () {
log.Println("push")
@ -102,6 +113,18 @@ func helloworld() {
log.Warn("repo =", repo)
addRepo(grid, repo)
}
var mystatus *repostatus.RepoStatus
box2.NewButton("repostatus()", func () {
if mystatus == nil {
mystatus = repostatus.New(myGui, "go.wit.com/gui/gui")
mystatus.InitWindow()
mystatus.Make()
mystatus.Draw()
mystatus.Draw2()
}
mystatus.Toggle()
})
box2.NewButton("checkout jcarr (all repos)", func () {
for _, r := range allrepos {
r.checkoutBranch("jcarr")