diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 43 |
1 files changed, 14 insertions, 29 deletions
@@ -43,13 +43,8 @@ type repo struct { func main() { myGui = gui.New().Default() - helloworld() + repoworld() checkrepos() - for _, r := range allrepos { - r.checkoutBranch("master") - r.checkoutBranch("devel") - r.checkoutBranch("jcarr") - } gui.Watchdog() } @@ -70,6 +65,7 @@ func addRepo(grid *gui.Node, path string) *repo { newRepo.cButton = grid.NewButton("status", func () { log.Println("repo status for", newRepo.path) + newRepo.scan() if newRepo.status == nil { newRepo.status = repostatus.New(myGui, newRepo.path) newRepo.status.InitWindow() @@ -80,23 +76,27 @@ func addRepo(grid *gui.Node, path string) *repo { newRepo.status.Toggle() }) newRepo.pButton = grid.NewButton("push", func () { - log.Println("push") + newRepo.scan() }) - if path == "" { return newRepo } + if path == "" { + newRepo.cButton.Hide() + newRepo.pButton.Hide() + return newRepo + } allrepos = append(allrepos, newRepo) return newRepo } // This creates a window -func helloworld() { - win := gadgets.NewBasicWindow(myGui, "helloworld golang wit/gui window") +func repoworld() { + win := gadgets.NewBasicWindow(myGui, "git autotypist. it types faster than you can.") box := win.Box().NewBox("bw vbox", false) box2 := win.Box().NewBox("bw vbox", false) - group := box.NewGroup("test") + group := box.NewGroup("go repositories (read from ~/.config/myrepolist)") grid := group.NewGrid("test", 11, 1) - grid.NewLabel("go repo") + grid.NewLabel("") grid.NewLabel("branch") grid.NewLabel("last tag") grid.NewLabel("Version") @@ -104,7 +104,7 @@ func helloworld() { grid.NewLabel("master") grid.NewLabel("devel") grid.NewLabel("jcarr") - grid.NewLabel("is dirty?") + grid.NewLabel("Status") grid.NewLabel("commit") grid.NewLabel("push to") @@ -125,21 +125,6 @@ func helloworld() { } mystatus.Toggle() }) - box2.NewButton("checkout jcarr (all repos)", func () { - for _, r := range allrepos { - r.checkoutBranch("jcarr") - } - }) - box2.NewButton("checkout devel (all repos)", func () { - for _, r := range allrepos { - r.checkoutBranch("devel") - } - }) - box2.NewButton("checkout master (all repos)", func () { - for _, r := range allrepos { - r.checkoutBranch("master") - } - }) box2.NewButton("hello", func () { log.Println("world") hellosmart() @@ -151,7 +136,7 @@ func hellosmart() { win := smartwindow.New() win.SetParent(myGui) win.InitWindow() - win.Title("helloworld golang wit/gui window") + win.Title("hellosmart test") win.Vertical() win.SetDraw(smartDraw) win.Make() |
