From 80df33888ab4e9b0f7d7b56f45d1bd22b253da3a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 30 Jan 2025 09:38:28 -0600 Subject: done on this part of the GUI for now I think --- windowViewPatchset.go | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'windowViewPatchset.go') diff --git a/windowViewPatchset.go b/windowViewPatchset.go index 24f17c7..52758de 100644 --- a/windowViewPatchset.go +++ b/windowViewPatchset.go @@ -12,14 +12,14 @@ import ( ) type patchWindow struct { - once sync.Once // only init() the window once - win *gadgets.BasicWindow // the patches window - stack *gui.Node // the top box set as vertical - shelf *gui.Node // the first box in the stack, set as horizontal - grid *gui.Node // the list of available patches - summary *patchSummary // summary of current patches - setgrid *gui.Node // the list of each patchset - pset *forgepb.Patchset // the patchset in question + once sync.Once // only init() the window once + win *gadgets.BasicWindow // the patches window + stack *gui.Node // the top box set as vertical + shelf *gui.Node // the first box in the stack, set as horizontal + grid *gui.Node // the list of available patches + // summary *patchSummary // summary of current patches + setgrid *gui.Node // the list of each patchset + pset *forgepb.Patchset // the patchset in question } // todo: autogenerate these or make them standared 'gui' package functions @@ -75,17 +75,26 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow { grid := pw.stack.NewGrid("", 0, 0) + grid.NewLabel("Patchset Details:") grid.NewLabel(pset.GitAuthorName) grid.NewLabel(pset.GitAuthorEmail) - grid.NextRow() grid.NewLabel("start branch: " + pset.StartBranchName) grid.NewLabel(pset.StartBranchHash) - grid.NextRow() grid.NewLabel("end branch: " + pset.EndBranchName) grid.NewLabel(pset.EndBranchHash) grid.NextRow() - grid.NewButton("Extract files to disk", func() { + g := pw.stack.NewGroup("PatchSet List") + + // make a grid to put the list of git repos that have patches + // in this particular patchset + grid = g.NewGrid("", 0, 0) + grid.NewLabel("repo") + grid.NewLabel("patch name") + grid.NewLabel("Applied in current branch?") + grid.NewLabel("start hash") + grid.NewLabel("") + grid.NewButton("Extract", func() { if err := savePatchset(pset); err != nil { log.Info("Save err:", err) return @@ -105,19 +114,10 @@ func makePatchWindow(pset *forgepb.Patchset) *patchWindow { applyPatchset(pset) } }) - - g := pw.stack.NewGroup("PatchSet List") - - // make a grid and a header - filegrid := g.NewGrid("", 0, 0) - filegrid.NewLabel("repo") - filegrid.NewLabel("patch name") - filegrid.NewLabel("Applied in current branch?") - filegrid.NewLabel("start hash") - filegrid.NextRow() + grid.NextRow() // add the patches to the grid - pw.addPatchset(filegrid, pset) + pw.addPatchset(grid, pset) return pw } @@ -164,6 +164,8 @@ func (r *patchWindow) addPatchset(grid *gui.Node, pset *forgepb.Patchset) { win = makeRepoPatchWindow(repo, patches) win.Show() }) + grid.NewCheckbox("").SetChecked(true) + grid.NewCheckbox("").SetChecked(true) grid.NextRow() } } -- cgit v1.2.3