diff options
Diffstat (limited to 'windowPatchesSubmit.go')
| -rw-r--r-- | windowPatchesSubmit.go | 39 |
1 files changed, 37 insertions, 2 deletions
diff --git a/windowPatchesSubmit.go b/windowPatchesSubmit.go index 518e7e1..1aeea11 100644 --- a/windowPatchesSubmit.go +++ b/windowPatchesSubmit.go @@ -6,6 +6,7 @@ import ( "go.wit.com/gui" "go.wit.com/lib/gadgets" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/log" ) @@ -81,8 +82,21 @@ func (r *patchesWindow) submitPatchesBox(box *gui.Node) *patchSummary { log.Info(err) return } - line := "somedate " + s.reason.String() + " Author: me" + pset.GitAuthorEmail - me.patchWin.addPatchset(line) + // line := "somedate " + s.reason.String() + " Author: me" + pset.GitAuthorEmail + me.patchWin.addPatchsetNew(pset) + }) + s.grid.NewButton("Get Patchsets", func() { + if psets, err := me.forge.GetPatchesets(); err != nil { + log.Info("Get Patchsets failed", err) + return + } else { + log.Info("got psets len", len(psets.Patchsets)) + all := psets.All() + for all.Scan() { + pset := all.Next() + r.addPatchsetNew(pset) + } + } }) // disable these until there are not dirty repos @@ -92,6 +106,27 @@ func (r *patchesWindow) submitPatchesBox(box *gui.Node) *patchSummary { return s } +func (r *patchesWindow) addPatchsetNew(pset *forgepb.Patchset) { + r.setgrid.NewLabel(pset.Name) + r.setgrid.NewLabel(pset.Comment) + r.setgrid.NewLabel(pset.GitAuthorName) + + var win *patchWindow + r.setgrid.NewButton("View", func() { + // has the window already been created? + if win != nil { + // it has been already created. just show it + win.Toggle() + log.Info("TRYING TO TOGGLE WINDOW") + return + } + + win = makePatchWindow(pset) + win.Show() + }) + r.setgrid.NextRow() +} + // does not run any commands func (s *patchSummary) Update() { var total, dirty, readonly, rw int |
