summaryrefslogtreecommitdiff
path: root/tagWindow.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-21 08:32:59 -0600
committerJeff Carr <[email protected]>2024-02-21 08:32:59 -0600
commitdf0ff5af1cd92287f79c7033cde4d339e0d8b628 (patch)
tree9230b0b2cc4d4e776c0a91e50f36c6685f92a764 /tagWindow.go
parent42c506c0982ea85d54443a39e4995c44060287df (diff)
purge code for the autotypist
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'tagWindow.go')
-rw-r--r--tagWindow.go93
1 files changed, 0 insertions, 93 deletions
diff --git a/tagWindow.go b/tagWindow.go
deleted file mode 100644
index f34be05..0000000
--- a/tagWindow.go
+++ /dev/null
@@ -1,93 +0,0 @@
-package main
-
-import (
- "go.wit.com/gui"
- "go.wit.com/log"
-
- "go.wit.com/lib/gadgets"
- "go.wit.com/lib/gui/repolist"
- "go.wit.com/lib/gui/repostatus"
-)
-
-var tagW *tagWindow
-
-type tagWindow struct {
- win *gadgets.BasicWindow
- box *gui.Node
- grid *gui.Node
- group *gui.Node
- allTags []*gitTag
-}
-
-type gitTag struct {
- rs *repostatus.RepoStatus
- hidden bool
-}
-
-func makeTagWindow() *tagWindow {
- if tagW != nil {
- tagW.win.Toggle()
- return tagW
- }
- tagW = new(tagWindow)
- tagW.win = gadgets.NewBasicWindow(me.myGui, "git tag tasks")
- tagW.win.Custom = func() {
- log.Warn("got to close")
- }
-
- tagW.win.Make()
- tagW.win.StandardClose()
- tagW.win.Draw()
-
- tagW.box = tagW.win.Box()
- topGrid := tagW.box.RawGrid()
- tagW.group = tagW.box.NewGroup("tags")
- tagW.grid = tagW.box.RawGrid()
-
- topGrid.NewButton("list all tags", func() {
- me.autotypistWindow.Disable()
- defer me.autotypistWindow.Enable()
- for _, repo := range repolist.AllRepos() {
- allTags := repo.AllTags()
- for _, t := range allTags {
- log.Info("found tag:", t.TagString(), "from", repo.Name())
- }
- }
- }).SetProgName("TAGSLISTALL")
-
- topGrid.NewButton("delete all dup tags", func() {
- me.autotypistWindow.Disable()
- defer me.autotypistWindow.Enable()
- for _, repo := range repolist.AllRepos() {
- if repo.GoPath() == "go.wit.com/lib/gadgets" {
- // only do log for now
- } else {
- // continue
- }
- tagsW := repo.TagsBox()
- tagsW.PruneSmart()
- deleteTags := tagsW.List()
- for _, t := range deleteTags {
- tagW.grid.NewLabel(t.TagString())
- tagW.grid.NewLabel(repo.Name())
- tagW.grid.NewButton("delete", func() {
- repo.DeleteTag(t)
- })
- tagW.grid.NextRow()
- if me.autoDryRun.Checked() {
- log.Info("delete tag --dry-run:", t.TagString(), "from", repo.Name())
- } else {
- log.Info("Deleting tag:", t.TagString(), "from", repo.Name())
- go repo.DeleteTag(t)
- log.Sleep(1)
- }
- }
- }
- })
-
- return tagW
-}
-
-func (t *gitTag) Hide() {
- t.hidden = true
-}