summaryrefslogtreecommitdiff
path: root/windowNewPatchsets.go
diff options
context:
space:
mode:
Diffstat (limited to 'windowNewPatchsets.go')
-rw-r--r--windowNewPatchsets.go39
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
}