add download buttons to the go.wit.com/list window
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
fba99bb2f5
commit
c488fcaf6c
|
@ -29,9 +29,12 @@ func quickCmd(fullpath string, cmd []string) bool {
|
||||||
if me.autoWorkingPwd.String() != fullpath {
|
if me.autoWorkingPwd.String() != fullpath {
|
||||||
me.autoWorkingPwd.SetValue(fullpath)
|
me.autoWorkingPwd.SetValue(fullpath)
|
||||||
}
|
}
|
||||||
log.Warn("RUN:", fullpath, cmd)
|
|
||||||
if me.autoDryRun.Checked() {
|
if me.autoDryRun.Checked() {
|
||||||
|
log.Warn("RUN --dry-run", fullpath, cmd)
|
||||||
return false
|
return false
|
||||||
|
} else {
|
||||||
|
log.Warn("RUN:", fullpath, cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
err, b, output = repostatus.RunCmd(fullpath, cmd)
|
err, b, output = repostatus.RunCmd(fullpath, cmd)
|
||||||
|
|
|
@ -9,6 +9,37 @@ import (
|
||||||
// "go.wit.com/gui/gadgets"
|
// "go.wit.com/gui/gadgets"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func globalDisplayHide() {
|
||||||
|
for _, repo := range me.allrepos {
|
||||||
|
if me.autoHideReadOnly.Checked() {
|
||||||
|
if repo.status.ReadOnly() {
|
||||||
|
repo.Hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if me.autoHidePerfect.Checked() {
|
||||||
|
if repo.dirtyLabel.String() == "PERFECT" {
|
||||||
|
repo.Hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func globalDisplayShow() {
|
||||||
|
for _, repo := range me.allrepos {
|
||||||
|
if me.autoHideReadOnly.Checked() {
|
||||||
|
if repo.status.ReadOnly() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if me.autoHidePerfect.Checked() {
|
||||||
|
if repo.dirtyLabel.String() == "PERFECT" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repo.Show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func globalDisplayOptions(box *gui.Node) {
|
func globalDisplayOptions(box *gui.Node) {
|
||||||
vbox := box.NewVerticalBox("DISPLAYVBOX")
|
vbox := box.NewVerticalBox("DISPLAYVBOX")
|
||||||
|
|
||||||
|
@ -47,26 +78,18 @@ func globalDisplayOptions(box *gui.Node) {
|
||||||
me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true)
|
me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true)
|
||||||
me.autoHideReadOnly.Custom = func() {
|
me.autoHideReadOnly.Custom = func() {
|
||||||
if me.autoHideReadOnly.Checked() {
|
if me.autoHideReadOnly.Checked() {
|
||||||
for _, repo := range me.allrepos {
|
globalDisplayHide()
|
||||||
if repo.status.ReadOnly() {
|
} else {
|
||||||
repo.Hide()
|
globalDisplayShow()
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(false)
|
me.autoHidePerfect = group1.NewCheckbox("Hide Perfectly clean repos").SetChecked(false)
|
||||||
me.autoHidePerfect.Custom = func() {
|
me.autoHidePerfect.Custom = func() {
|
||||||
if me.autoHidePerfect.Checked() {
|
if me.autoHidePerfect.Checked() {
|
||||||
for _, repo := range me.allrepos {
|
globalDisplayHide()
|
||||||
if repo.dirtyLabel.String() == "PERFECT" {
|
|
||||||
repo.Hide()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
for _, repo := range me.allrepos {
|
globalDisplayShow()
|
||||||
repo.Show()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ func globalTestingOptions(box *gui.Node) {
|
||||||
me.downloadEverythingButton.Enable()
|
me.downloadEverythingButton.Enable()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
test1.NewButton("build all apps", func() {
|
test1.NewButton("go.wit.com/list", func() {
|
||||||
listWindow()
|
listWindow()
|
||||||
})
|
})
|
||||||
test1.NewButton("repostatus.ListAll()", func() {
|
test1.NewButton("repostatus.ListAll()", func() {
|
||||||
|
|
|
@ -4,6 +4,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
@ -15,13 +16,20 @@ import (
|
||||||
var lw *gadgets.BasicWindow
|
var lw *gadgets.BasicWindow
|
||||||
var allsections []*section
|
var allsections []*section
|
||||||
|
|
||||||
|
type witRepo struct {
|
||||||
|
sec *section
|
||||||
|
path *gui.Node
|
||||||
|
downloadB *gui.Node
|
||||||
|
}
|
||||||
|
|
||||||
type section struct {
|
type section struct {
|
||||||
name string
|
name string
|
||||||
parent *gui.Node
|
parent *gui.Node
|
||||||
box *gui.Node
|
box *gui.Node
|
||||||
group *gui.Node
|
group *gui.Node
|
||||||
checkbox *gui.Node
|
grid *gui.Node // where the repos are listed
|
||||||
repos []*gui.Node
|
hideCB *gui.Node
|
||||||
|
witRepos []*witRepo
|
||||||
}
|
}
|
||||||
|
|
||||||
func listWindow() {
|
func listWindow() {
|
||||||
|
@ -66,8 +74,19 @@ func (s *section) add(path string) {
|
||||||
if s == nil {
|
if s == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
tmp := s.parent.NewLabel(path)
|
tmp := new(witRepo)
|
||||||
s.repos = append(s.repos, tmp)
|
tmp.sec = s
|
||||||
|
tmp.path = s.grid.NewLabel(path)
|
||||||
|
tmp.downloadB = s.grid.NewButton("download", func() {
|
||||||
|
lw.Disable()
|
||||||
|
log.Info("downloading", tmp.path.String(), "here")
|
||||||
|
os.Setenv("GO111MODULE", "off")
|
||||||
|
fullpath := "/home/jcarr/go/src/go.wit.com/"
|
||||||
|
quickCmd(fullpath, []string{"go", "get", "-v", tmp.path.String()})
|
||||||
|
lw.Enable()
|
||||||
|
})
|
||||||
|
|
||||||
|
s.witRepos = append(s.witRepos, tmp)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSection(parent *gui.Node, path string) *section {
|
func NewSection(parent *gui.Node, path string) *section {
|
||||||
|
@ -75,19 +94,21 @@ func NewSection(parent *gui.Node, path string) *section {
|
||||||
news.parent = parent
|
news.parent = parent
|
||||||
news.box = news.parent.NewBox("bw vbox", true)
|
news.box = news.parent.NewBox("bw vbox", true)
|
||||||
news.group = news.box.NewGroup(path)
|
news.group = news.box.NewGroup(path)
|
||||||
news.checkbox = news.box.NewCheckbox("hide")
|
news.hideCB = news.box.NewCheckbox("hide")
|
||||||
news.checkbox.Custom = func() {
|
news.hideCB.Custom = func() {
|
||||||
news.toggle()
|
news.toggle()
|
||||||
}
|
}
|
||||||
|
news.grid = news.parent.NewGrid("sections", 2, 1)
|
||||||
allsections = append(allsections, news)
|
allsections = append(allsections, news)
|
||||||
return news
|
return news
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *section) toggle() {
|
func (s *section) toggle() {
|
||||||
log.Warn(s.name)
|
log.Warn(s.name)
|
||||||
for i, n := range s.repos {
|
for i, wrepo := range s.witRepos {
|
||||||
log.Warn(i, n.String())
|
log.Warn(i, wrepo.path.String())
|
||||||
n.Hide()
|
wrepo.path.Hide()
|
||||||
|
wrepo.downloadB.Hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,8 @@ type autoType struct {
|
||||||
autotypistWindow *gadgets.BasicWindow
|
autotypistWindow *gadgets.BasicWindow
|
||||||
|
|
||||||
// #### autotypist Global Display Options
|
// #### autotypist Global Display Options
|
||||||
autoHidePerfect *gui.Node
|
autoHidePerfect *gui.Node
|
||||||
autoHideReadOnly *gui.Node
|
autoHideReadOnly *gui.Node
|
||||||
|
|
||||||
// #### autotypist Global Build Options
|
// #### autotypist Global Build Options
|
||||||
// what to change all the branches to
|
// what to change all the branches to
|
||||||
|
|
Loading…
Reference in New Issue