general cleanups

This commit is contained in:
Jeff Carr 2025-01-29 16:18:04 -06:00
parent b95118a30d
commit 8247d748bd
5 changed files with 10 additions and 29 deletions

View File

@ -56,28 +56,9 @@ func (r *RepoList) FindRepo(path string) *RepoRow {
return repo return repo
} }
/*
func (r *RepoList) AllRepos() []*RepoRow {
var all []*RepoRow
for _, repo := range me.allrepos {
all = append(all, repo)
}
return all
}
// deprecate this
func AllRepos() []*RepoRow {
var all []*RepoRow
for _, repo := range me.allrepos {
all = append(all, repo)
}
return all
}
*/
// a human readable state of the current repo // a human readable state of the current repo
func (r *RepoRow) State() string { func (r *RepoRow) State() string {
return r.gitState.String() return r.pbState.String()
} }
func (r *RepoRow) Scan() int { func (r *RepoRow) Scan() int {
@ -126,6 +107,7 @@ func (r *RepoRow) LastTag() string {
return r.lastTag.String() return r.lastTag.String()
} }
/*
func (r *RepoRow) IsPerfect() bool { func (r *RepoRow) IsPerfect() bool {
if r.gitState.String() == "PERFECT" { if r.gitState.String() == "PERFECT" {
return true return true
@ -135,6 +117,7 @@ func (r *RepoRow) IsPerfect() bool {
} }
return false return false
} }
*/
func (r *RepoRow) Run(cmd []string) cmd.Status { func (r *RepoRow) Run(cmd []string) cmd.Status {
return r.pb.Run(cmd) return r.pb.Run(cmd)

View File

@ -22,7 +22,7 @@ func (r *RepoRow) Hide() {
r.develVersion.Hide() r.develVersion.Hide()
r.userVersion.Hide() r.userVersion.Hide()
r.gitState.Hide() // r.gitState.Hide()
r.pbState.Hide() r.pbState.Hide()
r.endBox.Hide() r.endBox.Hide()
r.targetV.Hide() r.targetV.Hide()
@ -39,7 +39,7 @@ func (r *RepoRow) Show() {
r.develVersion.Show() r.develVersion.Show()
r.userVersion.Show() r.userVersion.Show()
r.gitState.Show() // r.gitState.Show()
r.pbState.Show() r.pbState.Show()
r.endBox.Show() r.endBox.Show()
r.targetV.Show() r.targetV.Show()
@ -56,7 +56,7 @@ func (r *RepoRow) Show2() {
r.develVersion.Show() r.develVersion.Show()
r.userVersion.Show() r.userVersion.Show()
r.gitState.Show() // r.gitState.Show()
r.endBox.Show() r.endBox.Show()
r.targetV.Show() r.targetV.Show()
r.hidden = false r.hidden = false
@ -93,7 +93,7 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) {
newRepo.masterVersion = r.reposgrid.NewLabel("") newRepo.masterVersion = r.reposgrid.NewLabel("")
newRepo.develVersion = r.reposgrid.NewLabel("") newRepo.develVersion = r.reposgrid.NewLabel("")
newRepo.userVersion = r.reposgrid.NewLabel("") newRepo.userVersion = r.reposgrid.NewLabel("")
newRepo.gitState = r.reposgrid.NewLabel("") // newRepo.gitState = r.reposgrid.NewLabel("")
newRepo.pbState = r.reposgrid.NewLabel("") newRepo.pbState = r.reposgrid.NewLabel("")
newRepo.currentName = r.reposgrid.NewLabel("") newRepo.currentName = r.reposgrid.NewLabel("")
newRepo.currentVersion = r.reposgrid.NewLabel("") newRepo.currentVersion = r.reposgrid.NewLabel("")

View File

@ -66,7 +66,6 @@ func (r *RepoRow) NewScan() int {
r.masterVersion.SetLabel(pb.GetMasterVersion()) r.masterVersion.SetLabel(pb.GetMasterVersion())
r.develVersion.SetLabel(pb.GetDevelVersion()) r.develVersion.SetLabel(pb.GetDevelVersion())
r.userVersion.SetLabel(pb.GetUserVersion()) r.userVersion.SetLabel(pb.GetUserVersion())
r.gitState.SetLabel(r.Status.CheckGitState())
r.pbState.SetLabel(pb.GetState()) r.pbState.SetLabel(pb.GetState())
r.currentName.SetLabel(pb.GetCurrentBranchName()) r.currentName.SetLabel(pb.GetCurrentBranchName())
r.currentVersion.SetLabel(pb.GetCurrentBranchVersion()) r.currentVersion.SetLabel(pb.GetCurrentBranchVersion())
@ -74,7 +73,7 @@ func (r *RepoRow) NewScan() int {
if r.State() == "merge to main" { if r.State() == "merge to main" {
r.Hide() r.Hide()
} }
if r.Status.GitState() == "PERFECT" { if pb.GetState() == "PERFECT" {
r.Hide() r.Hide()
} else { } else {
r.Show() r.Show()

View File

@ -62,7 +62,7 @@ type RepoRow struct {
lastTag *gui.Node // last tagged version label lastTag *gui.Node // last tagged version label
currentName *gui.Node // current branch name currentName *gui.Node // current branch name
currentVersion *gui.Node // current branch version currentVersion *gui.Node // current branch version
gitState *gui.Node // git state (dirty or not?) // gitState *gui.Node // git state (dirty or not?)
pbState *gui.Node // the state of the protobuf pbState *gui.Node // the state of the protobuf
masterVersion *gui.Node // the master branch version masterVersion *gui.Node // the master branch version

View File

@ -20,7 +20,6 @@ func (rl *RepoList) AutotypistView(parent *gui.Node) {
rl.reposgrid.NewLabel("master version") rl.reposgrid.NewLabel("master version")
rl.reposgrid.NewLabel("devel version") rl.reposgrid.NewLabel("devel version")
rl.reposgrid.NewLabel("user version") rl.reposgrid.NewLabel("user version")
rl.reposgrid.NewLabel("Status")
rl.reposgrid.NewLabel("pb state") rl.reposgrid.NewLabel("pb state")
rl.reposgrid.NewLabel("Current").SetProgName("CurrentName") rl.reposgrid.NewLabel("Current").SetProgName("CurrentName")
rl.reposgrid.NewLabel("Version").SetProgName("CurrentVersion") rl.reposgrid.NewLabel("Version").SetProgName("CurrentVersion")