summaryrefslogtreecommitdiff
path: root/branchesBox.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-15 22:50:50 -0600
committerJeff Carr <[email protected]>2024-02-15 22:50:50 -0600
commit2bc2096e841f3b262563126feb8a7a4c2b66f090 (patch)
treea940a0200555f1a75096cdc1895246ed46ffb159 /branchesBox.go
parente6eb92845ace066aa36c8730d28c3e53fe6bdca8 (diff)
xterm fixes
also a i18n syntax idea show all tags in the main window
Diffstat (limited to 'branchesBox.go')
-rw-r--r--branchesBox.go29
1 files changed, 18 insertions, 11 deletions
diff --git a/branchesBox.go b/branchesBox.go
index d24af80..c1de0e2 100644
--- a/branchesBox.go
+++ b/branchesBox.go
@@ -1,30 +1,33 @@
package repostatus
import (
+ "strings"
+
+ "go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/log"
)
-func (rs *RepoStatus) makeBranchesBox() {
- rs.gitBranchesGroup = rs.window.Box().NewGroup("branches")
+func (rs *RepoStatus) makeBranchesBox(parent *gui.Node) {
+ rs.gitBranchesGroup = parent.NewGroup("branches") // `progname:"BRANCHES"` // can the toolkits use these for i18n support?
newgrid := rs.gitBranchesGroup.NewGrid("gridnuts", 0, 0)
- rs.lasttag = gadgets.NewOneLiner(newgrid, "last tag")
+ rs.lasttag = gadgets.NewOneLiner(newgrid, "last tag") // `progname:"LASTTAG"`
newgrid.NextRow()
- rs.masterBranchVersion = gadgets.NewOneLiner(newgrid, "master")
+ rs.masterBranchVersion = gadgets.NewOneLiner(newgrid, "master") // `progname:"MASTERBRANCH"`
newgrid.NextRow()
- rs.develBranchVersion = gadgets.NewOneLiner(newgrid, "devel")
+ rs.develBranchVersion = gadgets.NewOneLiner(newgrid, "devel") // `progname:"DEVELBRANCH"`
newgrid.NextRow()
- rs.userBranchVersion = gadgets.NewOneLiner(newgrid, "user")
+ rs.userBranchVersion = gadgets.NewOneLiner(newgrid, "user") // `progname:"USERBRANCH"`
newgrid.NextRow()
- rs.currentBranch = gadgets.NewOneLiner(newgrid, "current branch")
+ rs.currentBranch = gadgets.NewOneLiner(newgrid, "current branch") // `progname:"CURRENTBRANCH"`
newgrid.NextRow()
- rs.currentVersion = gadgets.NewOneLiner(newgrid, "current version")
+ rs.currentVersion = gadgets.NewOneLiner(newgrid, "current version") // `progname:"CURRENTVERSION"`
newgrid.NextRow()
- rs.switchBranchB = newgrid.NewButton("Switch Branch", func() {
+ rs.switchBranchB = newgrid.NewButton("Switch Branch", func() { // `progname:"SWITCH"`
bname := rs.targetBranch.String()
log.Info("Should switch to branch", bname, "here")
@@ -38,12 +41,16 @@ func (rs *RepoStatus) makeBranchesBox() {
rs.UpdateCurrent()
})
- rs.targetBranch = newgrid.NewDropdown()
+ rs.targetBranch = newgrid.NewDropdown() // `progname:"TARGET"`
// rs.targetBranch.AddText("master")
newgrid.NextRow()
rs.showBranchesButton = newgrid.NewButton("scan branches()", func() {
- all := rs.getBranches()
+ err, out := rs.RunCmd([]string{"git", "branch", "--all"})
+ if err != nil {
+ log.Log(WARN, "git branch failed", rs.String())
+ }
+ all := strings.Split(out, "\n")
for i, s := range all {
log.Log(WARN, "found branch", i, s)
rs.targetBranch.AddText(s)