From f3a30ed95bdc02a0152759cc65692c998122af2a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Tue, 20 Feb 2024 14:45:09 -0600 Subject: [PATCH] add scan duration label --- addRepo.go | 1 + common.go | 4 ++++ scan.go | 3 ++- structs.go | 1 + viewAutotypist.go | 1 + viewGuiReleaser.go | 1 + 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addRepo.go b/addRepo.go index 79c78d5..007ecc8 100644 --- a/addRepo.go +++ b/addRepo.go @@ -204,5 +204,6 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str grid.NextRow() r.allrepos[path] = newRepo + newRepo.NewScan() return nil, newRepo } diff --git a/common.go b/common.go index a72775e..cf7e463 100644 --- a/common.go +++ b/common.go @@ -156,3 +156,7 @@ func (r *Repo) DeleteTag(t *repostatus.Tag) bool { func (rl *RepoList) MirrorShownCount() *gui.Node { return gui.RawMirror(rl.shownCount) } + +func (rl *RepoList) MirrorScanDuration() *gui.Node { + return gui.RawMirror(rl.duration) +} diff --git a/scan.go b/scan.go index 38f1d44..de876e3 100644 --- a/scan.go +++ b/scan.go @@ -42,6 +42,7 @@ func (r *RepoList) ScanRepositories() (int, string) { tmp := strconv.Itoa(shown) + " repos shown" log.Info("Setting shownCount to", tmp) me.shownCount.SetText(tmp) + me.duration.SetText(s) log.Info("Scanned", i, "repositories. todo: count/show changes in", s) return i, s @@ -54,7 +55,7 @@ func (r *Repo) NewScan() bool { } // run the repostatus update - r.Status.UpdateNew() + r.Status.Update() // print out whatever changes have happened if c, ok := r.Status.Changed(); ok { diff --git a/structs.go b/structs.go index 721dced..19ffada 100644 --- a/structs.go +++ b/structs.go @@ -33,6 +33,7 @@ type RepoList struct { shownCount *gui.Node hideFunction func(*Repo) + duration *gui.Node } type Repo struct { diff --git a/viewAutotypist.go b/viewAutotypist.go index 4e1b071..b0a07eb 100644 --- a/viewAutotypist.go +++ b/viewAutotypist.go @@ -30,5 +30,6 @@ func AutotypistView(parent *gui.Node) *RepoList { me.blind = gui.RawBox() me.shownCount = me.blind.NewLabel("showCount") + me.duration = me.blind.NewLabel("duration") return me } diff --git a/viewGuiReleaser.go b/viewGuiReleaser.go index c8c1b02..572d470 100644 --- a/viewGuiReleaser.go +++ b/viewGuiReleaser.go @@ -29,5 +29,6 @@ func GuireleaserView(parent *gui.Node) *RepoList { me.blind = gui.RawBox() me.shownCount = me.blind.NewLabel("showCount") + me.duration = me.blind.NewLabel("duration") return me }