summaryrefslogtreecommitdiff
path: root/draw.go
blob: 33d655f7c5edfabbb06448a3784cfdf7ec84e1d5 (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
package repostatus

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

// creates the actual widgets.
// it's assumed you are always passing in a box
func draw(rs *RepoStatus) {
	if ! rs.Ready() {return}
	rs.group = rs.window.Box().NewGroup("What GO Knows It Has")

	rs.grid = rs.group.NewGrid("gridnuts", 2, 2)

	rs.grid.SetNext(1,1)

	rs.path			= gadgets.NewOneLiner(rs.grid, "path")
	rs.currentBranch	= gadgets.NewOneLiner(rs.grid, "branch")
	rs.lasttag		= gadgets.NewOneLiner(rs.grid, "last tag")
	rs.currentVersion	= gadgets.NewOneLiner(rs.grid, "Version")

	rs.grid.NewLabel("tags")
	rs.tagsDrop		= rs.grid.NewDropdown("tags")
	rs.masterBranch		= gadgets.NewOneLiner(rs.grid, "master")
	rs.develBranch		= gadgets.NewOneLiner(rs.grid, "devel")
	rs.jcarrBranch		= gadgets.NewOneLiner(rs.grid, "jcarr")

	rs.dirtyLabel	= gadgets.NewOneLiner(rs.grid, "dirty")

	rs.speed	= gadgets.NewOneLiner(rs.grid, "refresh speed =")
	rs.speedActual	= gadgets.NewOneLiner(rs.grid, "speed actual =")

	rs.grid.NewButton("update", func() {
		rs.Update()
	})
	rs.grid.NewButton("recommend", func() {
		log.Warn("Is repo dirty?", rs.dirtyLabel.Get())
		log.Warn("list the known tags")
		rs.populateTags()
		log.Warn("Does master == devel? ")
		log.Warn("Does devel == jcarr?")
		log.Warn("Is repo pushed upstream? git.wit.org or github?")
	})

	rs.grid.Margin()
	rs.grid.Pad()
}