summaryrefslogtreecommitdiff
path: root/draw.go
diff options
context:
space:
mode:
Diffstat (limited to 'draw.go')
-rw-r--r--draw.go48
1 files changed, 48 insertions, 0 deletions
diff --git a/draw.go b/draw.go
new file mode 100644
index 0000000..33d655f
--- /dev/null
+++ b/draw.go
@@ -0,0 +1,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()
+}