diff --git a/main.go b/main.go index 91e896e..d814277 100644 --- a/main.go +++ b/main.go @@ -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")