From ea35f3c0fb4d3ac45569ed6a4715f7f1a25e4a02 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 7 Jan 2025 20:35:43 -0600 Subject: [PATCH] attempt to set repo.State --- newRepo.go | 3 +++ scan.go | 13 +++++-------- structs.go | 2 +- viewAutotypist.go | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/newRepo.go b/newRepo.go index d0e5588..2a4d0ef 100644 --- a/newRepo.go +++ b/newRepo.go @@ -23,6 +23,7 @@ func (r *RepoRow) Hide() { r.userVersion.Hide() r.gitState.Hide() + r.pbState.Hide() r.endBox.Hide() r.targetV.Hide() r.hidden = true @@ -39,6 +40,7 @@ func (r *RepoRow) Show() { r.userVersion.Show() r.gitState.Show() + r.pbState.Show() r.endBox.Show() r.targetV.Show() r.hidden = false @@ -93,6 +95,7 @@ func (r *RepoList) AddRepo(pb *gitpb.Repo) (*RepoRow, error) { newRepo.develVersion = r.reposgrid.NewLabel("") newRepo.userVersion = r.reposgrid.NewLabel("") newRepo.gitState = r.reposgrid.NewLabel("") + newRepo.pbState = r.reposgrid.NewLabel("") newRepo.currentName = r.reposgrid.NewLabel("") newRepo.currentVersion = r.reposgrid.NewLabel("") diff --git a/scan.go b/scan.go index f13f83a..39e2836 100644 --- a/scan.go +++ b/scan.go @@ -56,23 +56,20 @@ func (r *RepoRow) NewScan() int { return changed } - // run the repostatus update - r.Status.Update() + pb.Reload() if r.lastTag != nil { r.lastTag.SetLabel(pb.GetLastTag()) } - if r.masterVersion == nil { - panic("what the fuck node") - } - - pb.State = r.Status.GitState() + // run the repostatus update + r.Status.Update() r.masterVersion.SetLabel(pb.GetMasterVersion()) r.develVersion.SetLabel(pb.GetDevelVersion()) r.userVersion.SetLabel(pb.GetUserVersion()) - r.gitState.SetLabel(pb.GetState()) + r.gitState.SetLabel(r.Status.CheckGitState()) + r.pbState.SetLabel(pb.GetState()) r.currentName.SetLabel(pb.GetCurrentBranchName()) r.currentVersion.SetLabel(pb.GetCurrentBranchVersion()) diff --git a/structs.go b/structs.go index 9e33d1a..ae3874b 100644 --- a/structs.go +++ b/structs.go @@ -63,7 +63,7 @@ type RepoRow struct { currentName *gui.Node // current branch name currentVersion *gui.Node // current branch version gitState *gui.Node // git state (dirty or not?) - // goState *gui.Node // what is the state of the go.sum file + pbState *gui.Node // the state of the protobuf masterVersion *gui.Node // the master branch version develVersion *gui.Node // the devel branch version diff --git a/viewAutotypist.go b/viewAutotypist.go index 090b37e..ae8a615 100644 --- a/viewAutotypist.go +++ b/viewAutotypist.go @@ -21,6 +21,7 @@ func (rl *RepoList) AutotypistView(parent *gui.Node) { rl.reposgrid.NewLabel("devel version") rl.reposgrid.NewLabel("user version") rl.reposgrid.NewLabel("Status") + rl.reposgrid.NewLabel("pb state") rl.reposgrid.NewLabel("Current").SetProgName("CurrentName") rl.reposgrid.NewLabel("Version").SetProgName("CurrentVersion") rl.reposgrid.NextRow()