adding 'mirror' widget support is a win here

This commit is contained in:
Jeff Carr 2024-02-19 14:42:34 -06:00
parent 5d0c793ae9
commit 89e8d79d9b
4 changed files with 37 additions and 19 deletions

View File

@ -11,7 +11,8 @@ import (
func (r *Repo) Hide() {
r.pLabel.Hide()
r.lastTag.Hide()
r.vLabel.Hide()
r.currentName.Hide()
r.currentVersion.Hide()
r.masterVersion.Hide()
r.develVersion.Hide()
@ -33,7 +34,8 @@ func (r *Repo) Hidden() bool {
func (r *Repo) Show() {
r.pLabel.Show()
r.lastTag.Show()
r.vLabel.Show()
r.currentName.Show()
r.currentVersion.Show()
r.masterVersion.Show()
r.develVersion.Show()
@ -80,13 +82,19 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
newRepo.hidden = false
switch r.viewName {
case "autotypist":
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.lastTag = newRepo.Status.MirrorLastTag()
grid.Append(newRepo.lastTag)
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
newRepo.targetV = r.blind.NewLabel("")
newRepo.dirtyLabel = grid.NewLabel("")
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
newRepo.currentName = newRepo.Status.MirrorCurrentName()
grid.Append(newRepo.currentName)
newRepo.currentVersion = newRepo.Status.MirrorCurrentVersion()
grid.Append(newRepo.currentVersion)
newRepo.endBox = grid.NewHorizontalBox("HBOX")
newRepo.endBox.NewButton("Configure", func() {
if newRepo.Status == nil {
@ -143,12 +151,20 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
}
newRepo.goState = r.blind.NewLabel("in the blind")
case "guireleaser":
newRepo.targetV = grid.NewLabel("")
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.targetV = newRepo.Status.MirrorTargetVersion()
grid.Append(newRepo.targetV)
newRepo.lastTag = newRepo.Status.MirrorLastTag()
grid.Append(newRepo.lastTag)
newRepo.currentName = newRepo.Status.MirrorCurrentName()
grid.Append(newRepo.currentName)
newRepo.currentVersion = newRepo.Status.MirrorCurrentVersion()
grid.Append(newRepo.currentVersion)
newRepo.masterVersion = r.blind.NewLabel("").SetProgName("masterVersion")
newRepo.dirtyLabel = grid.NewLabel("")
newRepo.goState = grid.NewLabel("not in the blind")
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
newRepo.endBox = grid.NewHorizontalBox("HBOX")
newRepo.endBox.NewButton("Configure", func() {
if newRepo.Status == nil {

13
scan.go
View File

@ -55,11 +55,12 @@ func (r *Repo) NewScan() bool {
}
r.userVersion.SetLabel(uver)
cbname := r.Status.GetCurrentBranchName()
cbversion := r.Status.GetCurrentBranchVersion()
lasttag := r.Status.GetLastTagVersion()
r.lastTag.SetLabel(lasttag)
r.vLabel.SetLabel(cbname + " " + cbversion)
// cbname := r.Status.GetCurrentBranchName()
// cbversion := r.Status.GetCurrentBranchVersion()
// lasttag := r.Status.GetLastTagVersion()
// r.lastTag.SetLabel(lasttag)
// r.currentName.SetLabel(cbname)
// r.currentVersion.SetLabel(cbversion)
if c, ok := r.Status.Changed(); ok {
c := strings.TrimSpace(c)
@ -67,7 +68,7 @@ func (r *Repo) NewScan() bool {
log.Info(r.Status.Path(), line)
}
}
r.targetV.SetText(r.Status.GetTargetVersion())
// r.targetV.SetText(r.Status.GetTargetVersion())
status := r.Status.GetStatus()
r.dirtyLabel.SetLabel(status)

View File

@ -43,7 +43,8 @@ type Repo struct {
targetV *gui.Node // the target version
lastTag *gui.Node // last tagged version label
vLabel *gui.Node // version label
currentName *gui.Node // current branch name
currentVersion *gui.Node // current branch version
dirtyLabel *gui.Node // git state (dirty or not?)
goState *gui.Node // what is the state of the go.sum file

View File

@ -21,10 +21,10 @@ func GuireleaserView(parent *gui.Node) *RepoList {
me.reposgrid.NewLabel("") // path goes here
me.reposgrid.NewLabel("target")
me.reposgrid.NewLabel("last tag").SetProgName("last tag")
me.reposgrid.NewLabel("master version")
me.reposgrid.NewLabel("Status")
me.reposgrid.NewLabel("GO Status")
me.reposgrid.NewLabel("Current Version").SetProgName("Current Version")
me.reposgrid.NewLabel("Current")
me.reposgrid.NewLabel("Version")
me.reposgrid.NewLabel("git State")
me.reposgrid.NewLabel("GO State")
me.reposgrid.NextRow()
me.blind = gui.RawBox()
return me