disable state works
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
1a459d6f6f
commit
0e979faf5b
2
Makefile
2
Makefile
|
@ -14,7 +14,7 @@ goimports:
|
|||
build:
|
||||
echo "build it!"
|
||||
-rm resources/*.so
|
||||
cp ~/go/src/go.wit.com/toolkits/*.so resources/
|
||||
cp -a ~/go/src/go.wit.com/toolkits/*.so resources/
|
||||
go build -v -x
|
||||
|
||||
install:
|
||||
|
|
|
@ -2,10 +2,8 @@ package main
|
|||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"go.wit.com/lib/gui/repostatus"
|
||||
"go.wit.com/log"
|
||||
|
||||
"go.wit.com/gui"
|
||||
)
|
||||
|
@ -21,42 +19,47 @@ func globalTestingOptions(box *gui.Node) {
|
|||
me.autoRebuildButton.SetLabel("rebuild autotypist")
|
||||
})
|
||||
|
||||
me.downloadEverythingButton = test1.NewButton("go get go.wit.com", func() {
|
||||
me.downloadEverythingButton.Disable()
|
||||
me.autoWorkingPwd.SetValue("/home/jcarr/go/src")
|
||||
var perfect bool = true
|
||||
repos := myrepolist()
|
||||
for _, line := range repos {
|
||||
log.Verbose("repo =", line)
|
||||
path, _, _, _ := splitLine(line)
|
||||
path = strings.TrimSpace(path)
|
||||
if path == "#" {
|
||||
// skip comment lines
|
||||
continue
|
||||
}
|
||||
if doesExist("/home/jcarr/go/src/" + path) {
|
||||
continue
|
||||
}
|
||||
// attempt to download it
|
||||
quickCmd("/home/jcarr/go/src/go.wit.com", []string{"go", "get", "-v", path})
|
||||
perfect = false
|
||||
}
|
||||
|
||||
if perfect {
|
||||
var notes string
|
||||
notes = "you have already downloaded\neverything on go.wit.com"
|
||||
me.autoWorkingPwd.SetValue(notes)
|
||||
/*
|
||||
me.downloadEverythingButton = test1.NewButton("go get go.wit.com", func() {
|
||||
me.downloadEverythingButton.Disable()
|
||||
return
|
||||
} else {
|
||||
var notes string
|
||||
notes = "download everything failed"
|
||||
me.autoWorkingPwd.SetValue(notes)
|
||||
me.downloadEverythingButton.Enable()
|
||||
}
|
||||
})
|
||||
test1.NewButton("go.wit.com/list", func() {
|
||||
me.autoWorkingPwd.SetValue("/home/jcarr/go/src")
|
||||
var perfect bool = true
|
||||
repos := myrepolist()
|
||||
for _, line := range repos {
|
||||
log.Verbose("repo =", line)
|
||||
path, _, _, _ := splitLine(line)
|
||||
path = strings.TrimSpace(path)
|
||||
if path == "#" {
|
||||
// skip comment lines
|
||||
continue
|
||||
}
|
||||
if doesExist("/home/jcarr/go/src/" + path) {
|
||||
continue
|
||||
}
|
||||
// attempt to download it
|
||||
quickCmd("/home/jcarr/go/src/go.wit.com", []string{"go", "get", "-v", path})
|
||||
perfect = false
|
||||
}
|
||||
|
||||
if perfect {
|
||||
var notes string
|
||||
notes = "you have already downloaded\neverything on go.wit.com"
|
||||
me.autoWorkingPwd.SetValue(notes)
|
||||
me.downloadEverythingButton.Disable()
|
||||
return
|
||||
} else {
|
||||
var notes string
|
||||
notes = "download everything failed"
|
||||
me.autoWorkingPwd.SetValue(notes)
|
||||
me.downloadEverythingButton.Enable()
|
||||
}
|
||||
})
|
||||
*/
|
||||
var listallB *gui.Node
|
||||
listallB = test1.NewButton("go.wit.com/list", func() {
|
||||
listallB.Disable()
|
||||
listWindow()
|
||||
listallB.Enable()
|
||||
})
|
||||
test1.NewButton("repostatus.ListAll()", func() {
|
||||
repostatus.ListAll()
|
||||
|
|
|
@ -11,6 +11,7 @@ import (
|
|||
"go.wit.com/log"
|
||||
|
||||
"go.wit.com/lib/gadgets"
|
||||
"go.wit.com/lib/gui/repostatus"
|
||||
)
|
||||
|
||||
var lw *gadgets.BasicWindow
|
||||
|
@ -23,7 +24,9 @@ type witRepo struct {
|
|||
}
|
||||
|
||||
type section struct {
|
||||
name string
|
||||
name string
|
||||
hidden bool
|
||||
|
||||
parent *gui.Node
|
||||
box *gui.Node
|
||||
group *gui.Node
|
||||
|
@ -68,6 +71,16 @@ func listWindow() {
|
|||
curs.add(parts[0])
|
||||
}
|
||||
}
|
||||
for i, sec := range allsections {
|
||||
log.Info("section name:", sec.name, "hidden:", sec.hidden, i)
|
||||
parts := strings.Split(sec.name, " ")
|
||||
if len(parts) > 1 {
|
||||
if parts[1] != "Applications" {
|
||||
sec.Hide()
|
||||
}
|
||||
}
|
||||
}
|
||||
// lw.Toggle()
|
||||
}
|
||||
|
||||
func (s *section) add(path string) {
|
||||
|
@ -85,15 +98,21 @@ func (s *section) add(path string) {
|
|||
quickCmd(fullpath, []string{"go", "get", "-v", tmp.path.String()})
|
||||
lw.Enable()
|
||||
})
|
||||
if repostatus.VerifyLocalGoRepo(path) {
|
||||
log.Verbose("newRepo actually exists", path)
|
||||
tmp.downloadB.SetLabel("downloaded")
|
||||
tmp.downloadB.Disable()
|
||||
}
|
||||
|
||||
s.witRepos = append(s.witRepos, tmp)
|
||||
}
|
||||
|
||||
func NewSection(parent *gui.Node, path string) *section {
|
||||
func NewSection(parent *gui.Node, desc string) *section {
|
||||
news := new(section)
|
||||
news.name = desc
|
||||
news.parent = parent
|
||||
news.box = news.parent.NewBox("bw vbox", true)
|
||||
news.group = news.box.NewGroup(path)
|
||||
news.group = news.box.NewGroup(desc)
|
||||
news.hideCB = news.box.NewCheckbox("hide")
|
||||
news.hideCB.Custom = func() {
|
||||
news.toggle()
|
||||
|
@ -105,6 +124,21 @@ func NewSection(parent *gui.Node, path string) *section {
|
|||
|
||||
func (s *section) toggle() {
|
||||
log.Warn(s.name)
|
||||
if s.hidden {
|
||||
s.hidden = false
|
||||
for i, wrepo := range s.witRepos {
|
||||
log.Warn(i, wrepo.path.String())
|
||||
wrepo.path.Show()
|
||||
wrepo.downloadB.Show()
|
||||
}
|
||||
} else {
|
||||
s.Hide()
|
||||
}
|
||||
}
|
||||
|
||||
func (s *section) Hide() {
|
||||
s.hidden = true
|
||||
s.hideCB.SetChecked(true)
|
||||
for i, wrepo := range s.witRepos {
|
||||
log.Warn(i, wrepo.path.String())
|
||||
wrepo.path.Hide()
|
||||
|
|
Loading…
Reference in New Issue