summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doGui.go23
-rw-r--r--windowRepoProblems.go57
2 files changed, 55 insertions, 25 deletions
diff --git a/doGui.go b/doGui.go
index bc84555..8c70cd4 100644
--- a/doGui.go
+++ b/doGui.go
@@ -371,6 +371,29 @@ func drawWindow(win *gadgets.BasicWindow) {
}
// this is the magic that generates a window directly from the protocol buffer
+func makeStandardReposGrid(pb *gitpb.Repos) *gitpb.ReposTable {
+ t := pb.NewTable("testDirty")
+ sf := t.AddStringFunc("repo", func(r *gitpb.Repo) string {
+ return r.GetGoPath()
+ })
+ // t.Custom = func() {
+ // log.Info("close grid?")
+ // }
+ sf.Custom = func(r *gitpb.Repo) {
+ log.Info("do button click on", r.GetGoPath())
+ }
+ t.AddTimeFunc("age", func(repo *gitpb.Repo) time.Time {
+ return repo.NewestTime()
+ })
+ t.AddMasterVersion()
+ t.AddDevelVersion()
+ t.AddUserVersion()
+ t.AddCurrentBranchName()
+ t.AddState()
+ return t
+}
+
+// this is the magic that generates a window directly from the protocol buffer
func makeStandardReposWindow(pb *gitpb.Repos) {
t := pb.NewTable("testDirty")
sf := t.AddStringFunc("repo", func(r *gitpb.Repo) string {
diff --git a/windowRepoProblems.go b/windowRepoProblems.go
index b406f11..b60125c 100644
--- a/windowRepoProblems.go
+++ b/windowRepoProblems.go
@@ -6,7 +6,6 @@ package main
import (
"fmt"
"sync"
- "time"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/protobuf/forgepb"
@@ -86,46 +85,54 @@ func makeRepoProblemsWindow() *repoProblemsWindow {
found = develBehindMasterProblem()
txt = fmt.Sprintf("devel is behind master (%d)", found.Len())
grid.NewButton(txt, func() {
- found := develBehindMasterProblem()
- win := gadgets.RawBasicWindow("pbgrid in window")
+ win := gadgets.RawBasicWindow("devel branches that are out of sync with master")
win.Make()
win.Show()
- box := win.Box().NewBox("bw vbox", false)
-
win.Custom = func() {
// sets the hidden flag to false so Toggle() works
win.Hide()
}
+ box := win.Box().NewBox("bw vbox", false)
- t := found.NewTable("testDirty")
- t.SetParent(box)
- sf := t.AddStringFunc("repo", func(r *gitpb.Repo) string {
- return r.GetGoPath()
+ found := develBehindMasterProblem()
+ group := box.NewGroup("test buttons")
+ group.NewButton("hello", func() {
+ log.Info("world")
})
- // t.Custom = func() {
- // log.Info("close grid?")
- // }
- sf.Custom = func(r *gitpb.Repo) {
- log.Info("do button click on", r.GetGoPath())
- }
- t.AddTimeFunc("age", func(repo *gitpb.Repo) time.Time {
- return repo.NewestTime()
+ group.NewButton("list", func() {
+ log.Info("world")
})
- t.AddMasterVersion()
- t.AddDevelVersion()
- t.AddUserVersion()
- t.AddCurrentBranchName()
- t.AddState()
- t.ShowTable()
- // makeStandardReposWindow(found, box)
+ t := makeStandardReposGrid(found)
+ t.SetParent(box)
+ t.ShowTable()
})
found = remoteUserBranchProblem()
txt = fmt.Sprintf("user branch is remote (%d)", found.Len())
grid.NewButton(txt, func() {
+ win := gadgets.RawBasicWindow("repos that seem to have remote user branches")
+ win.Make()
+ win.Show()
+ win.Custom = func() {
+ // sets the hidden flag to false so Toggle() works
+ win.Hide()
+ }
+ box := win.Box().NewBox("bw vbox", false)
+
found := remoteUserBranchProblem()
- makeStandardReposWindow(found)
+ group := box.NewGroup("test buttons")
+ group.NewButton("git branch delete", func() {
+ all := found.SortByFullPath()
+ for all.Scan() {
+ repo := all.Next()
+ log.Info("git branch -D jcarr", repo.GetGoPath())
+ }
+ })
+
+ t := makeStandardReposGrid(found)
+ t.SetParent(box)
+ t.ShowTable()
})
grid.NewButton("unknown branches", func() {