tag dropdown

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-09 08:41:32 -06:00
parent 8c999a6993
commit 3aced19260
1 changed files with 7 additions and 1 deletions

View File

@ -27,6 +27,7 @@ type repo struct {
bLabel *gui.Node // branch label bLabel *gui.Node // branch label
lastLabel *gui.Node // last tagged version label lastLabel *gui.Node // last tagged version label
vLabel *gui.Node // version label vLabel *gui.Node // version label
tagsDrop *gui.Node // list of all tags
sLabel *gui.Node // git state (dirty or not?) sLabel *gui.Node // git state (dirty or not?)
cButton *gui.Node // commit button cButton *gui.Node // commit button
@ -70,6 +71,9 @@ func (r *repo) scan() {
r.lastLabel.SetText(out) r.lastLabel.SetText(out)
r.tags = listFiles(fullpath(r.path + "/.git/refs/tags")) r.tags = listFiles(fullpath(r.path + "/.git/refs/tags"))
for _, tag := range r.tags {
r.tagsDrop.AddText(tag)
}
// cmd := "dig +noall +answer www.wit.com A" // cmd := "dig +noall +answer www.wit.com A"
// out = shell.Run(cmd) // out = shell.Run(cmd)
@ -89,6 +93,7 @@ func addRepo(grid *gui.Node, path string) *repo {
newRepo.pLabel = grid.NewLabel(path) newRepo.pLabel = grid.NewLabel(path)
newRepo.bLabel = grid.NewLabel("") newRepo.bLabel = grid.NewLabel("")
newRepo.lastLabel = grid.NewLabel("") newRepo.lastLabel = grid.NewLabel("")
newRepo.tagsDrop = grid.NewDropdown("tags")
newRepo.vLabel = grid.NewLabel("") newRepo.vLabel = grid.NewLabel("")
newRepo.sLabel = grid.NewLabel("") newRepo.sLabel = grid.NewLabel("")
@ -109,11 +114,12 @@ func helloworld() {
box := win.Box().NewBox("bw vbox", false) box := win.Box().NewBox("bw vbox", false)
group := box.NewGroup("test") group := box.NewGroup("test")
grid := group.NewGrid("test", 7, 1) grid := group.NewGrid("test", 8, 1)
grid.NewLabel("go repo") grid.NewLabel("go repo")
grid.NewLabel("branch") grid.NewLabel("branch")
grid.NewLabel("last tag") grid.NewLabel("last tag")
grid.NewLabel("tags")
grid.NewLabel("Version") grid.NewLabel("Version")
grid.NewLabel("is dirty?") grid.NewLabel("is dirty?")
grid.NewLabel("commit") grid.NewLabel("commit")