From 2c5841f5ecf7432fb09b3bcf6aee8783ec0c1432 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 10 Mar 2025 11:46:46 -0500 Subject: [PATCH] better Patchsets view --- windowNewPatchsets.go | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 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) - 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" - } - t.AddButtonFunc("view", butf) - t.AddStringFunc("#", func(p *forgepb.Patchset) string { return fmt.Sprintf("%d", p.Patches.Len()) }) - t.AddName() + testf := func(p *forgepb.Patchset) string { + return "test" + } + tp := t.AddButtonFunc("Analyse", testf) + tp.Custom = func(p *forgepb.Patchset) { + log.Info("test patchset here", p.Name) + } + + 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.AddComment() ctimef := func(p *forgepb.Patchset) string {