summaryrefslogtreecommitdiff
path: root/submitPatches.go
diff options
context:
space:
mode:
Diffstat (limited to 'submitPatches.go')
-rw-r--r--submitPatches.go32
1 files changed, 27 insertions, 5 deletions
diff --git a/submitPatches.go b/submitPatches.go
index 510479c..337d82a 100644
--- a/submitPatches.go
+++ b/submitPatches.go
@@ -10,7 +10,7 @@ import (
"go.wit.com/log"
)
-type develSummary struct {
+type patchSummary struct {
grid *gui.Node
updateB *gui.Node
docsB *gui.Node
@@ -20,11 +20,14 @@ type develSummary struct {
readonlyOL *gadgets.OneLiner
totalPatchesOL *gadgets.OneLiner
+ reason *gadgets.BasicEntry
+ submitB *gui.Node
+
allp []*patch
}
-func submitPatchesBox(box *gui.Node) *develSummary {
- s := new(develSummary)
+func submitPatchesBox(box *gui.Node) *patchSummary {
+ s := new(patchSummary)
group1 := box.NewGroup("Submit Patches Summary")
s.grid = group1.RawGrid()
@@ -61,10 +64,27 @@ func submitPatchesBox(box *gui.Node) *develSummary {
s.totalPatchesOL = gadgets.NewOneLiner(s.grid, "total commits")
s.grid.NextRow()
+ s.reason = gadgets.NewBasicEntry(s.grid, "patch name:")
+ s.reason.Custom = func() {
+ if s.reason.String() != "" {
+ s.submitB.Enable()
+ } else {
+ s.submitB.Disable()
+ }
+ }
+ s.submitB = s.grid.NewButton("Submit Patches", func() {
+ for i, p := range s.allp {
+ log.Info(i, p.ref, p.rs.String())
+ }
+ })
+ // disable these until there are not dirty repos
+ s.reason.Disable()
+ s.submitB.Disable()
+
return s
}
-func (s *develSummary) Update() {
+func (s *patchSummary) Update() {
var total, dirty, readonly int
for _, repo := range me.allrepos {
total += 1
@@ -86,6 +106,8 @@ func (s *develSummary) Update() {
}
if dirty == 0 {
s.totalPatchesOL.SetText(strconv.Itoa(p) + " patches")
+ s.submitB.Enable()
+ s.reason.Enable()
} else {
s.totalPatchesOL.SetText(strconv.Itoa(p) + " patches + ? dirty")
}
@@ -97,7 +119,7 @@ type patch struct {
rs *repostatus.RepoStatus
}
-func (s *develSummary) GetPatches() (int, []*patch) {
+func (s *patchSummary) GetPatches() (int, []*patch) {
var patchcount int
patches := make([]*patch, 0, 0)
for _, repo := range me.allrepos {