diff options
| author | Jeff Carr <[email protected]> | 2025-03-12 08:17:23 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-12 08:17:23 -0500 |
| commit | 6cf3648b9467a08ea9e664774a319f67fc965528 (patch) | |
| tree | 0226a6f18123630f1dab064f9273fff37d4f0dd8 /windowNewPatchsets.go | |
| parent | 369c252a68c7a8b68cc314751afd4f71f7d1f30e (diff) | |
better patch window
Diffstat (limited to 'windowNewPatchsets.go')
| -rw-r--r-- | windowNewPatchsets.go | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/windowNewPatchsets.go b/windowNewPatchsets.go index 8fc8415..96b293f 100644 --- a/windowNewPatchsets.go +++ b/windowNewPatchsets.go @@ -39,41 +39,52 @@ func makePatchsetsWin() *stdPatchsetTableWin { } grid := dwin.win.Group.RawGrid() - grid.NewButton("reload", func() { + grid.NewButton("ondisk", func() { + openPatchsets() + if me.psets == nil { + log.Info("No Patchsets loaded") + return + } + dwin.doPatchsetsTable(me.psets) + }) + + grid.NewButton("upstream", func() { psets, err := me.forge.GetPatchesets() if err != nil { log.Info("Get Patchsets failed", err) return } - savePatchsets(psets) dwin.doPatchsetsTable(psets) }) - grid.NewButton("analyse patchsets", func() { - psets, err := openPatchsets() - if err != nil { - log.Info("Open Patchsets failed", err) + grid.NewButton("analyse and save patchsets", func() { + if me.psets == nil { + log.Info("No Patchsets loaded") return } - all := psets.All() + all := me.psets.All() for all.Scan() { pset := all.Next() - log.Info("What is up with?", pset.Name) - setPatchsetState(pset) + if pset.State == "" { + log.Info("What is up with?", pset.Name) + setPatchsetState(pset) + } else { + log.Info("patchset already had state", pset.Name, pset.State) + } } - savePatchsets(psets) + savePatchsets() }) // make a box at the bottom of the window for the protobuf table dwin.box = dwin.win.Bottom.Box().SetProgName("TBOX") // load and show the current patch sets - psets, err := openPatchsets() - if err != nil { - log.Info("Open Patchsets failed", err) + openPatchsets() + if me.psets == nil { + log.Info("Open Patchsets failed") return dwin } - dwin.doPatchsetsTable(psets) + dwin.doPatchsetsTable(me.psets) return dwin } |
