summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addRepo.go22
-rw-r--r--common.go21
-rw-r--r--scan.go2
-rw-r--r--structs.go11
-rw-r--r--viewGuiReleaser.go1
5 files changed, 42 insertions, 15 deletions
diff --git a/addRepo.go b/addRepo.go
index c8d054f..3ea8042 100644
--- a/addRepo.go
+++ b/addRepo.go
@@ -21,7 +21,8 @@ func (r *Repo) Hide() {
r.endBox.Hide()
// r.statusButton.Hide()
// r.diffButton.Hide()
- r.goSumStatus.Hide()
+ r.goState.Hide()
+ r.targetV.Hide()
r.hidden = true
}
@@ -42,7 +43,8 @@ func (r *Repo) Show() {
r.endBox.Show()
// r.statusButton.Show()
// r.diffButton.Show()
- r.goSumStatus.Show()
+ r.goState.Show()
+ r.targetV.Show()
r.hidden = false
}
@@ -75,13 +77,14 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
}
newRepo.pLabel = grid.NewLabel(path).SetProgName("path")
- newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
- newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.hidden = false
switch r.viewName {
case "autotypist":
+ newRepo.lastTag = grid.NewLabel("").SetProgName("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.endBox = grid.NewHorizontalBox("HBOX")
@@ -138,12 +141,13 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
newRepo.Status.Build()
})
}
- newRepo.goSumStatus = r.blind.NewLabel("in the blind")
+ newRepo.goState = r.blind.NewLabel("in the blind")
case "guireleaser":
- newRepo.develVersion = r.blind.NewLabel("").SetProgName("develVersion")
- newRepo.userVersion = r.blind.NewLabel("").SetProgName("userVersion")
+ newRepo.targetV = grid.NewLabel("")
+ newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
+ newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
newRepo.dirtyLabel = grid.NewLabel("")
- newRepo.goSumStatus = grid.NewLabel("in the blind")
+ newRepo.goState = grid.NewLabel("not in the blind")
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
newRepo.endBox = grid.NewHorizontalBox("HBOX")
newRepo.endBox.NewButton("Configure", func() {
@@ -171,6 +175,8 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
newRepo.Status.Build()
})
}
+ newRepo.develVersion = r.blind.NewLabel("").SetProgName("develVersion")
+ newRepo.userVersion = r.blind.NewLabel("").SetProgName("userVersion")
default:
}
grid.NextRow()
diff --git a/common.go b/common.go
index 2374b33..6c5c1c2 100644
--- a/common.go
+++ b/common.go
@@ -2,6 +2,7 @@ package repolist
import (
"go.wit.com/lib/gui/repostatus"
+ "go.wit.com/log"
)
func (r *RepoList) Hidden() bool {
@@ -88,11 +89,27 @@ func (r *Repo) LastTag() string {
// because this are changing too often at this point
// TODO: revisit this in 2025 or 2026
func (r *Repo) GoState() string {
- return r.Status.GetGoSumStatus()
+ if r == nil {
+ log.Info("GoState() r == nil")
+ return "goState == nil"
+ }
+ if r.goState == nil {
+ log.Info("GoState() r.goState == nil")
+ return "goState == nil"
+ }
+ return r.goState.String()
}
func (r *Repo) SetGoState(s string) {
- r.Status.SetGoSumStatus(s)
+ if r == nil {
+ log.Info("SetGoState() r == nil")
+ return
+ }
+ if r.goState == nil {
+ log.Info("goState == nil")
+ return
+ }
+ r.goState.SetText(s)
}
func (r *Repo) IsPerfect() bool {
diff --git a/scan.go b/scan.go
index 4311dd1..68fc036 100644
--- a/scan.go
+++ b/scan.go
@@ -67,6 +67,8 @@ func (r *Repo) NewScan() bool {
log.Info(r.Status.Path(), line)
}
}
+ r.targetV.SetText(r.Status.GetTargetVersion())
+
status := r.Status.GetStatus()
r.dirtyLabel.SetLabel(status)
if status == "PERFECT" {
diff --git a/structs.go b/structs.go
index 392934d..a2b1413 100644
--- a/structs.go
+++ b/structs.go
@@ -30,7 +30,7 @@ type RepoList struct {
reposgroup *gui.Node
// put things here that can't be seen
- blind *gui.Node
+ blind *gui.Node
}
type Repo struct {
@@ -41,10 +41,11 @@ type Repo struct {
pLabel *gui.Node // path label
- lastTag *gui.Node // last tagged version label
- vLabel *gui.Node // version label
- dirtyLabel *gui.Node // git state (dirty or not?)
- goSumStatus *gui.Node // what is the state of the go.sum file
+ targetV *gui.Node // the target version
+ lastTag *gui.Node // last tagged version label
+ vLabel *gui.Node // version label
+ dirtyLabel *gui.Node // git state (dirty or not?)
+ goState *gui.Node // what is the state of the go.sum file
masterVersion *gui.Node // the master branch version
develVersion *gui.Node // the devel branch version
diff --git a/viewGuiReleaser.go b/viewGuiReleaser.go
index b445eb9..f9dcd7d 100644
--- a/viewGuiReleaser.go
+++ b/viewGuiReleaser.go
@@ -19,6 +19,7 @@ func GuireleaserView(parent *gui.Node) *RepoList {
me.reposgrid = me.reposgroup.NewGrid("test", 0, 0)
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")