add guireleaser view

This commit is contained in:
Jeff Carr 2024-02-18 10:49:52 -06:00
parent 860981e63d
commit 02542bafe8
4 changed files with 129 additions and 56 deletions

View File

@ -75,6 +75,9 @@ 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.develVersion = grid.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
newRepo.dirtyLabel = grid.NewLabel("")
@ -114,7 +117,6 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
r.reposbox.Enable()
})
newRepo.hidden = false
// newRepo.Status.SetMainWorkingName(master)
// newRepo.Status.SetDevelWorkingName(devel)
// newRepo.Status.SetUserWorkingName(user)
@ -134,6 +136,41 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str
newRepo.Status.Build()
})
}
newRepo.goSumStatus = r.blind.NewLabel("in the blind")
case "guireleaser":
newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion")
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
newRepo.dirtyLabel = grid.NewLabel("")
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
newRepo.endBox = grid.NewHorizontalBox("HBOX")
newRepo.endBox.NewButton("Configure", func() {
if newRepo.Status == nil {
// this should never happen, but it does happen because I'm not that smart and forget I can nil Status
// for some reason that makes sense in my head. again, I'm not that smart
log.Warn("status window wasn't created")
return
}
newRepo.Status.Toggle()
})
var showBuildB bool = false
switch newRepo.Status.RepoType() {
case "binary":
// log.Info("compile here. Show()")
showBuildB = true
case "library":
// log.Info("library here. Hide()")
default:
// log.Info("unknown RepoType", newRepo.Status.RepoType())
}
if showBuildB {
newRepo.endBox.NewButton("build", func() {
newRepo.Status.Build()
})
}
newRepo.goSumStatus = r.blind.NewLabel("in the blind")
default:
}
grid.NextRow()
r.allrepos[path] = newRepo

View File

@ -22,11 +22,15 @@ type RepoList struct {
autoHidePerfect bool
autoScan bool
allrepos map[string]*Repo
viewName string
// reposwin *gadgets.BasicWindow
reposbox *gui.Node
reposgrid *gui.Node
reposgroup *gui.Node
// put things here that can't be seen
blind *gui.Node
}
type Repo struct {

View File

@ -10,6 +10,7 @@ func AutotypistView(parent *gui.Node) *RepoList {
}
me = new(RepoList)
me.allrepos = make(map[string]*Repo)
me.viewName = "autotypist"
// me.reposbox = gui.RawBox()
me.reposbox = parent
@ -25,5 +26,6 @@ func AutotypistView(parent *gui.Node) *RepoList {
me.reposgrid.NewLabel("Status")
me.reposgrid.NewLabel("Current Version").SetProgName("Current Version")
me.reposgrid.NextRow()
me.blind = gui.RawBox()
return me
}

30
viewGuiReleaser.go Normal file
View File

@ -0,0 +1,30 @@
package repolist
import "go.wit.com/gui"
// This creates a view of the repos
// you can only have one at this point
func GuireleaserView(parent *gui.Node) *RepoList {
if me != nil {
return me
}
me = new(RepoList)
me.allrepos = make(map[string]*Repo)
me.viewName = "guireleaser"
// me.reposbox = gui.RawBox()
me.reposbox = parent
me.reposgroup = me.reposbox.NewGroup("go repositories (configure in ~/.config/myrepolist)")
me.reposgrid = me.reposgroup.NewGrid("test", 0, 0)
me.reposgrid.NewLabel("") // path goes here
me.reposgrid.NewLabel("last tag").SetProgName("last tag")
me.reposgrid.NewLabel("master version")
me.reposgrid.NewLabel("Status")
me.reposgrid.NewLabel("GO Status")
me.reposgrid.NewLabel("Current Version").SetProgName("Current Version")
me.reposgrid.NextRow()
me.blind = gui.RawBox()
return me
}