diff options
| author | Jeff Carr <[email protected]> | 2024-12-23 02:37:48 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-23 02:37:48 -0600 |
| commit | cc55a5ad7a0561ba8385e35d2ddf7fdf94555c75 (patch) | |
| tree | 90b319b20e325e8972d77710a644e3590bef0a45 /subitPatches.go | |
| parent | 30a4988f08f149ed22f4e770b822a9d87bf13f93 (diff) | |
start working on the GUI again for this
Diffstat (limited to 'subitPatches.go')
| -rw-r--r-- | subitPatches.go | 97 |
1 files changed, 51 insertions, 46 deletions
diff --git a/subitPatches.go b/subitPatches.go index 6844297..a653bcf 100644 --- a/subitPatches.go +++ b/subitPatches.go @@ -30,8 +30,8 @@ type patchSummary struct { checkB *gui.Node // stats - totalOL *gadgets.OneLiner - totalGoOL *gadgets.OneLiner + totalOL *gadgets.OneLiner + // totalGoOL *gadgets.OneLiner dirtyOL *gadgets.OneLiner readonlyOL *gadgets.OneLiner totalPatchesOL *gadgets.OneLiner @@ -52,44 +52,47 @@ type patchSummary struct { func submitPatchesBox(box *gui.Node) *patchSummary { s := new(patchSummary) - group1 := box.NewGroup("Submit Patches Summary") + group1 := box.NewGroup("Patch Summary") s.grid = group1.RawGrid() s.grid.NewButton("Update Patch Counts", func() { - var repocount, patchcount int - // broken after move to forge protobuf - all := me.forge.Repos.SortByFullPath() - for all.Scan() { - repo := all.Next() - if repo.GetReadOnly() { - continue + /* + var repocount, patchcount int + // broken after move to forge protobuf + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if repo.GetReadOnly() { + continue + } + i, _ := repo.GetMasterPatches() + patchcount += i + if i > 0 { + repocount += 1 + } } - i, _ := repo.GetMasterPatches() - patchcount += i - if i > 0 { - repocount += 1 - } - } - s.totalMasterPatches.SetText(strconv.Itoa(patchcount) + " patches") - s.totalMasterRepos.SetText(strconv.Itoa(repocount) + " go repos") + s.totalMasterPatches.SetText(strconv.Itoa(patchcount) + " patches") + s.totalMasterRepos.SetText(strconv.Itoa(repocount) + " go repos") - repocount = 0 - patchcount = 0 - // broken after move to forge protobuf - all = me.forge.Repos.SortByFullPath() - for all.Scan() { - repo := all.Next() - if repo.GetReadOnly() { - continue + repocount = 0 + patchcount = 0 + // broken after move to forge protobuf + all = me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + if repo.GetReadOnly() { + continue + } + i, _ := repo.GetUserPatches() + patchcount += i + if i > 0 { + repocount += 1 + } } - i, _ := repo.GetUserPatches() - patchcount += i - if i > 0 { - repocount += 1 - } - } - s.totalUserPatches.SetText(strconv.Itoa(patchcount) + " patches") - s.totalUserRepos.SetText(strconv.Itoa(repocount) + " go repos") + s.totalUserPatches.SetText(strconv.Itoa(patchcount) + " patches") + s.totalUserRepos.SetText(strconv.Itoa(repocount) + " go repos") + */ + s.Update() }) /* this used to be the way and should probably be revisited @@ -105,8 +108,8 @@ func submitPatchesBox(box *gui.Node) *patchSummary { s.totalOL = gadgets.NewOneLiner(s.grid, "Total") s.grid.NextRow() - s.totalGoOL = gadgets.NewOneLiner(s.grid, "Total GO") - s.grid.NextRow() + // s.totalGoOL = gadgets.NewOneLiner(s.grid, "Total GO") + // s.grid.NextRow() s.dirtyOL = gadgets.NewOneLiner(s.grid, "dirty") s.grid.NextRow() @@ -145,9 +148,9 @@ func submitPatchesBox(box *gui.Node) *patchSummary { }) s.grid.NextRow() - group1 = box.NewGroup("Create GUI Patch Set") + group1 = box.NewGroup("Submit Patch Set") s.grid = group1.RawGrid() - s.reason = gadgets.NewBasicEntry(s.grid, "patch name:") + s.reason = gadgets.NewBasicEntry(s.grid, "set name:") s.reason.Custom = func() { if s.reason.String() != "" { s.submitB.Enable() @@ -155,7 +158,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary { s.submitB.Disable() } } - s.submitB = s.grid.NewButton("Create Patch Set", func() { + s.submitB = s.grid.NewButton("Submit", func() { dirname := "submit-patchset.quilt" patchdir := filepath.Join(me.userHomePwd.String(), dirname) if shell.Exists(patchdir) { @@ -169,11 +172,13 @@ func submitPatchesBox(box *gui.Node) *patchSummary { } me.repos.View.MakePatchset(patchdir) }) - s.submitB = s.grid.NewButton("Submit quilt", func() { - log.Info("do a submit here") - }) + /* + s.submitB = s.grid.NewButton("Submit quilt", func() { + log.Info("do a submit here") + }) + */ // disable these until there are not dirty repos - s.reason.Disable() + // s.reason.Disable() s.submitB.Disable() s.grid.NextRow() @@ -186,7 +191,7 @@ func submitPatchesBox(box *gui.Node) *patchSummary { // does not run any commands func (s *patchSummary) Update() { - var total, totalgo, dirty, readonly int + var total, dirty, readonly int var userT, develT, masterT int // var userP, develP, masterP int // broken after move to forge protobuf @@ -219,7 +224,7 @@ func (s *patchSummary) Update() { } } s.totalOL.SetText(strconv.Itoa(total) + " repos") - s.totalGoOL.SetText(strconv.Itoa(totalgo) + " repos") + // s.totalGoOL.SetText(strconv.Itoa(totalgo) + " repos") s.dirtyOL.SetText(strconv.Itoa(dirty) + " repos") s.readonlyOL.SetText(strconv.Itoa(readonly) + " repos") @@ -233,7 +238,7 @@ func (s *patchSummary) Update() { // s.unknownOL.Enable() // s.unknownSubmitB.Enable() } else { - s.reason.Disable() + // s.reason.Disable() s.submitB.Enable() // s.unknownOL.Enable() // s.unknownSubmitB.Enable() |
