summaryrefslogtreecommitdiff
path: root/scan.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-30 11:02:37 -0600
committerJeff Carr <[email protected]>2025-01-30 11:02:37 -0600
commitb91475b55b93a87aabb63e661a46d85c28623eb9 (patch)
treed9dd098e1ce66e47aa21fa6e41d61ee83658677b /scan.go
parent8247d748bd26be6eb87a978573b0d435e83178a1 (diff)
switching from the old way to using protobufv0.22.49v0.22.48v0.22.47v0.22.46v0.22.45v0.22.44
Diffstat (limited to 'scan.go')
-rw-r--r--scan.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/scan.go b/scan.go
index 9249076..27b2e8c 100644
--- a/scan.go
+++ b/scan.go
@@ -12,14 +12,14 @@ func (r *RepoList) RegisterHideFunction(f func(*RepoRow)) {
me.hideFunction = f
}
-func (r *RepoList) ScanRepositories() (int, string) {
+func (r *RepoList) ScanRepositoriesOld() (int, string) {
var i int
var shown int
var total int
t := TimeFunction(func() {
for _, repo := range me.allrepos {
i += 1
- changed := repo.NewScan()
+ changed := repo.Update()
total += changed
}
var hidden int
@@ -44,7 +44,7 @@ func (r *RepoRow) UpdatePb(newpb *gitpb.Repo) {
r.pb = newpb
}
-func (r *RepoRow) NewScan() int {
+func (r *RepoRow) Update() int {
var changed int = 0
if r.Status == nil {
log.Log(WARN, "repo.Status = nil. not initialized for some reason")
@@ -61,7 +61,7 @@ func (r *RepoRow) NewScan() int {
}
// run the repostatus update
- r.Status.Update()
+ // r.Status.Update()
r.masterVersion.SetLabel(pb.GetMasterVersion())
r.develVersion.SetLabel(pb.GetDevelVersion())
@@ -70,6 +70,14 @@ func (r *RepoRow) NewScan() int {
r.currentName.SetLabel(pb.GetCurrentBranchName())
r.currentVersion.SetLabel(pb.GetCurrentBranchVersion())
+ // disable the commit button if the repo is not on the user branch
+ if pb.GetCurrentBranchName() == pb.GetUserBranchName() {
+ r.commitB.Enable()
+ } else {
+ r.commitB.Disable()
+ }
+
+ // TODO: finally make this alot smarter
if r.State() == "merge to main" {
r.Hide()
}