diff options
Diffstat (limited to 'doGui.go')
| -rw-r--r-- | doGui.go | 27 |
1 files changed, 19 insertions, 8 deletions
@@ -21,7 +21,7 @@ import ( ) func debug() { - time.Sleep(5 * time.Second) + time.Sleep(2 * time.Second) for { now := time.Now() tmp := fmt.Sprintf("All (%d)", me.forge.Repos.Len()) @@ -45,8 +45,9 @@ func debug() { tmp = fmt.Sprintf("writable (%d)", me.found.Len()) me.repoWritableB.SetLabel(tmp) - doDirty() - tmp = fmt.Sprintf("dirty (%d)", me.found.Len()) + doCheckDirtyAndConfigSave() + found := findDirty() + tmp = fmt.Sprintf("dirty (%d)", found.Len()) me.repoDirtyB.SetLabel(tmp) log.Printf("finished a forge scan here in (%s)\n", shell.FormatDuration(time.Since(now))) @@ -197,9 +198,19 @@ func drawWindow(win *gadgets.BasicWindow) { grid = group2.RawGrid() me.repoDirtyB = grid.NewButton("dirty", func() { - me.found = new(gitpb.Repos) - findDirty() - makeStandardReposWindow("dirty repos", me.found) + doCheckDirtyAndConfigSave() + found := findDirty() + _, box := makeStandardReposWindow("dirty repos", found) + box.NewButton("commit all", func() { + all := found.SortByFullPath() + for all.Scan() { + repo := all.Next() + log.Info("do commit here on", repo.GetGoPath()) + } + log.Info("TODO: fix this") + log.Info("run 'forge commit --all'") + }) + }) me.repoWritableB = grid.NewButton("writable", func() { @@ -360,7 +371,7 @@ func makeStandardReposGrid(pb *gitpb.Repos) *gitpb.ReposTable { } // this is the magic that generates a window directly from the protocol buffer -func makeStandardReposWindow(title string, pb *gitpb.Repos) *gitpb.ReposTable { +func makeStandardReposWindow(title string, pb *gitpb.Repos) (*gitpb.ReposTable, *gui.Node) { win := gadgets.RawBasicWindow(title) win.Make() win.Show() @@ -373,7 +384,7 @@ func makeStandardReposWindow(title string, pb *gitpb.Repos) *gitpb.ReposTable { t := makeStandardReposGrid(pb) t.SetParent(box) t.ShowTable() - return t + return t, box } func findMergeToDevel() { |
