summaryrefslogtreecommitdiff
path: root/branchesBox.go
blob: 8849fb052dc7c909d675d7c12accbe18a931ea1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package repostatus

import (
	"go.wit.com/gui"
	"go.wit.com/lib/gadgets"
	"go.wit.com/log"
)

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") // `progname:"LASTTAG"`
	newgrid.NextRow()

	rs.mainBranchVersion = gadgets.NewOneLiner(newgrid, "master") // `progname:"MASTERBRANCH"`
	newgrid.NextRow()
	rs.develBranchVersion = gadgets.NewOneLiner(newgrid, "devel") // `progname:"DEVELBRANCH"`
	newgrid.NextRow()
	rs.userBranchVersion = gadgets.NewOneLiner(newgrid, "user") // `progname:"USERBRANCH"`
	newgrid.NextRow()

	rs.currentBranch = gadgets.NewOneLiner(newgrid, "current branch") // `progname:"CURRENTBRANCH"`
	newgrid.NextRow()
	rs.currentVersion = gadgets.NewOneLiner(newgrid, "current version") // `progname:"CURRENTVERSION"`
	newgrid.NextRow()

	/*
		rs.switchBranchB = newgrid.NewButton("Switch Branch", func() { // `progname:"SWITCH"`
		})

		rs.targetBranch = newgrid.NewDropdown() // `progname:"TARGET"`
		newgrid.NextRow()

		rs.showBranchesButton = newgrid.NewButton("find user and devel", func() {
			log.Info("redo this")
		})
		newgrid.NextRow()

		rs.checkBranchesButton = newgrid.NewButton("CheckBranches()", func() {
			log.Info("redo this")
		})
		newgrid.NextRow()

		newgrid.NewButton("Revert master to devel", func() {
			log.Info("redo this")
		})
	*/

	var win *repoBranchesWindow
	newgrid.NewButton("Branches Window", func() {
		if win != nil {
			win.Toggle()
			return
		}
		log.Info("redo this")
		win = MakeRepoBranchesWindow(rs.pb)
		win.Show()
	})
}