diff options
Diffstat (limited to 'windowPatches.go')
| -rw-r--r-- | windowPatches.go | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/windowPatches.go b/windowPatches.go index 48f854e..ae6a3b9 100644 --- a/windowPatches.go +++ b/windowPatches.go @@ -15,18 +15,14 @@ type patchesWindow struct { win *gadgets.BasicWindow // the patches window stack *gui.Node // the top box set as vertical grid *gui.Node // the list of available patches - summary *patchSummary // summary of current patches - setgrid *gui.Node // the list of each patchset - checkB *gui.Node + reason *gadgets.BasicEntry // the name of the patchset + submitB *gui.Node // the submit patchet button + psetgrid *gui.Node // the list of each patchset totalOL *gadgets.OneLiner dirtyOL *gadgets.OneLiner readonlyOL *gadgets.OneLiner rw *gadgets.OneLiner - reason *gadgets.BasicEntry - submitB *gui.Node -} - -type patchSummary struct { + // checkB *gui.Node } func (r *patchesWindow) Hidden() bool { @@ -62,7 +58,7 @@ func (r *patchesWindow) initWindow() { r.win.Hide() } - r.grid = r.stack.NewGrid("", 0, 0) + r.grid = r.stack.RawGrid() r.submitPatchesBox() // update the stats about the repos and patches @@ -71,7 +67,7 @@ func (r *patchesWindow) initWindow() { g := r.stack.NewGroup("Patchset List") // add the grid - r.setgrid = g.NewGrid("", 0, 0) + r.psetgrid = g.RawGrid() } func (r *patchesWindow) submitPatchesBox() { @@ -89,7 +85,7 @@ func (r *patchesWindow) submitPatchesBox() { r.rw = gadgets.NewOneLiner(grid, "r/w") grid.NextRow() - // make the 'widget group' for the buttons at the bottom of the window + // now, make the 'widget group' and the buttons at the bottom of the window group1 = r.stack.NewGroup("Patchset Create") grid = group1.RawGrid() @@ -122,7 +118,6 @@ func (r *patchesWindow) submitPatchesBox() { log.Info(err) return } - // line := "somedate " + s.reason.String() + " Author: me" + pset.GitAuthorEmail r.addPatchsetNew(pset) }) grid.NewButton("Get Patchset List", func() { @@ -131,7 +126,6 @@ func (r *patchesWindow) submitPatchesBox() { return } else { log.Info("got psets len", len(psets.Patchsets)) - // all := psets.All() all := psets.SortByName() for all.Scan() { pset := all.Next() @@ -145,24 +139,22 @@ func (r *patchesWindow) submitPatchesBox() { } func (r *patchesWindow) addPatchsetNew(pset *forgepb.Patchset) { - r.setgrid.NewLabel(pset.Name) - r.setgrid.NewLabel(pset.Comment) - r.setgrid.NewLabel(pset.GitAuthorName) + r.psetgrid.NewLabel(pset.Name) + r.psetgrid.NewLabel(pset.Comment) + r.psetgrid.NewLabel(pset.GitAuthorName) var win *patchWindow - r.setgrid.NewButton("View", func() { + r.psetgrid.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() + r.psetgrid.NextRow() } // will update this from the current state of the protobuf |
