summaryrefslogtreecommitdiff
path: root/windowNewPatchsets.go
diff options
context:
space:
mode:
Diffstat (limited to 'windowNewPatchsets.go')
-rw-r--r--windowNewPatchsets.go40
1 files changed, 35 insertions, 5 deletions
diff --git a/windowNewPatchsets.go b/windowNewPatchsets.go
index fecdf5d..484fa2f 100644
--- a/windowNewPatchsets.go
+++ b/windowNewPatchsets.go
@@ -39,13 +39,27 @@ func makePatchsetsWin() *stdPatchsetTableWin {
}
grid := dwin.win.Group.RawGrid()
- grid.NewButton("update patchsets", func() {
+ grid.NewButton("reload current patches", 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)
return
}
- dwin.doPatchsetsTable(psets)
+ all := psets.All()
+ for all.Scan() {
+ pset := all.Next()
+ log.Info("What is up with?", pset.Name)
+ }
})
// make a box at the bottom of the window for the protobuf table
@@ -86,14 +100,30 @@ func AddPatchsetsPB(tbox *gui.Node, pb *forgepb.Patchsets) *forgepb.PatchsetsTab
t.NewUuid()
t.SetParent(tbox)
+ testf := func(p *forgepb.Patchset) string {
+ /*
+ ctime := p.Ctime.AsTime()
+ s := ctime.Format("2006/01/02 15:04")
+ log.Info("test button", s, p.Name)
+ */
+ return "test"
+ }
+ t.AddButtonFunc("test", testf)
+
butf := func(p *forgepb.Patchset) string {
- ctime := p.Ctime.AsTime()
- s := ctime.Format("2006/01/02 15:04")
- log.Info("Found", s, p.Name)
+ /*
+ ctime := p.Ctime.AsTime()
+ s := ctime.Format("2006/01/02 15:04")
+ log.Info("view button", s, p.Name)
+ */
return "view"
}
t.AddButtonFunc("view", butf)
+ t.AddStringFunc("#", func(p *forgepb.Patchset) string {
+ return fmt.Sprintf("%d", p.Patches.Len())
+ })
+
t.AddName()
t.AddComment()