From 2c5841f5ecf7432fb09b3bcf6aee8783ec0c1432 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 10 Mar 2025 11:46:46 -0500 Subject: better Patchsets view --- windowNewPatchsets.go | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/windowNewPatchsets.go b/windowNewPatchsets.go index 484fa2f..d5b2e79 100644 --- a/windowNewPatchsets.go +++ b/windowNewPatchsets.go @@ -100,31 +100,26 @@ func AddPatchsetsPB(tbox *gui.Node, pb *forgepb.Patchsets) *forgepb.PatchsetsTab t.NewUuid() t.SetParent(tbox) + t.AddStringFunc("#", func(p *forgepb.Patchset) string { + return fmt.Sprintf("%d", p.Patches.Len()) + }) + 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("view button", s, p.Name) - */ - return "view" + tp := t.AddButtonFunc("Analyse", testf) + tp.Custom = func(p *forgepb.Patchset) { + log.Info("test patchset here", p.Name) } - t.AddButtonFunc("view", butf) - t.AddStringFunc("#", func(p *forgepb.Patchset) string { - return fmt.Sprintf("%d", p.Patches.Len()) + vp := t.AddButtonFunc("View Patchset", func(p *forgepb.Patchset) string { + return p.Name }) + vp.Custom = func(pset *forgepb.Patchset) { + win := makePatchWindow(pset) + win.Show() + } - t.AddName() t.AddComment() ctimef := func(p *forgepb.Patchset) string { -- cgit v1.2.3