summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--globalDisplayOptions.go1
-rw-r--r--repoview.go3
-rw-r--r--submitPatches.go56
3 files changed, 38 insertions, 22 deletions
diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go
index 6c9ed1e..89f0c74 100644
--- a/globalDisplayOptions.go
+++ b/globalDisplayOptions.go
@@ -82,7 +82,6 @@ func globalDisplayOptions(vbox *gui.Node) {
log.Info("re-scanning repos done", i, s)
me.duration.SetText(s)
})
- me.duration = scanbox.NewLabel("")
var tagsW *tagWindow
group1.NewButton("git tags Window", func() {
diff --git a/repoview.go b/repoview.go
index 9e1af9f..10d8c2d 100644
--- a/repoview.go
+++ b/repoview.go
@@ -60,6 +60,9 @@ func makeRepoView() *repoWindow {
showncount := r.View.MirrorShownCount()
r.topbox.Append(showncount)
+ duration := r.View.MirrorScanDuration()
+ r.topbox.Append(duration)
+
r.View.RegisterHideFunction(hideFunction)
return r
}
diff --git a/submitPatches.go b/submitPatches.go
index 88a7dce..07a6c5e 100644
--- a/submitPatches.go
+++ b/submitPatches.go
@@ -6,6 +6,7 @@ import (
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
+ "go.wit.com/lib/gui/gowit"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/shell"
"go.wit.com/log"
@@ -42,7 +43,7 @@ type patchSummary struct {
totalMasterPatches *gui.Node
// patch set generation
- unknownOL *gadgets.OneLiner
+ unknownOL *gadgets.BasicEntry
unknownSubmitB *gui.Node
reason *gadgets.BasicEntry
submitB *gui.Node
@@ -125,7 +126,6 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.totalMasterRepos = s.grid.NewLabel("x go repos")
s.grid.NextRow()
-
s.totalPatchesOL = gadgets.NewOneLiner(s.grid, "total commits")
s.totalUserPatches = s.grid.NewLabel("x patches")
s.totalDevelPatches = s.grid.NewLabel("")
@@ -167,27 +167,29 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.grid.NextRow()
// map a path to gitea
- s.unknownOL = gadgets.NewOneLiner(s.grid, "Unknown Repo:")
+ s.unknownOL = gadgets.NewBasicEntry(s.grid, "Unknown Repo:")
s.unknownSubmitB = s.grid.NewButton("map new repo path", func() {
- /*
- log.Info("Submit repo:", s.unknownOL.String())
- if repolist.Exists(s.unknownOL.String()) {
- log.Info("found repo:", repo.String(), "with giturl", repo.giturl)
- localurl := repo.status.GitURL()
- if localurl == "" {
- log.Info("local repo check failed. repo is not uploaded?")
- } else {
- log.Info("local repo has", localurl)
- // attempts to register the unknown repo
- if gowit.Register(repo.String(), localurl) {
- s.unknownOL.Hide()
- s.unknownSubmitB.Hide()
- }
- }
- } else {
- log.Info("what is this?", s.unknownOL.String())
+ log.Info("Submit repo:", s.unknownOL.String())
+ repo := me.repos.View.FindRepo(s.unknownOL.String())
+ if repo == nil {
+ log.Info("could not find repo:", s.unknownOL.String(), "in ~/go/src")
+ return
+ }
+
+ localurl := repo.Status.GitURL()
+ log.Info("found repo:", repo.GoPath(), "with giturl", localurl)
+ if localurl == "" {
+ log.Info("local repo check failed. repo")
+ } else {
+ log.Info("local repo has", localurl)
+ // check if go.wit.com works, if not, add it
+ // attempts to register the unknown repo
+ if gowit.Register(repo.GoPath(), localurl) {
+ // todo: check if this works
+ // s.unknownOL.Hide()
+ // s.unknownSubmitB.Hide()
}
- */
+ }
})
s.unknownOL.Disable()
s.unknownSubmitB.Disable()
@@ -238,4 +240,16 @@ func (s *patchSummary) Update() {
s.totalUserRepos.SetText(strconv.Itoa(userT) + " repos")
s.totalDevelRepos.SetText(strconv.Itoa(develT) + " repos")
s.totalMasterRepos.SetText(strconv.Itoa(masterT) + " repos")
+
+ if dirty == 0 {
+ s.reason.Enable()
+ s.submitB.Enable()
+ s.unknownOL.Enable()
+ s.unknownSubmitB.Enable()
+ } else {
+ s.reason.Disable()
+ s.submitB.Enable()
+ s.unknownOL.Enable()
+ s.unknownSubmitB.Enable()
+ }
}