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:
|
build:
|
||||||
echo "build it!"
|
echo "build it!"
|
||||||
-rm resources/*.so
|
-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
|
go build -v -x
|
||||||
|
|
||||||
install:
|
install:
|
||||||
|
|
|
@ -2,10 +2,8 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"go.wit.com/lib/gui/repostatus"
|
"go.wit.com/lib/gui/repostatus"
|
||||||
"go.wit.com/log"
|
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
)
|
)
|
||||||
|
@ -21,42 +19,47 @@ func globalTestingOptions(box *gui.Node) {
|
||||||
me.autoRebuildButton.SetLabel("rebuild autotypist")
|
me.autoRebuildButton.SetLabel("rebuild autotypist")
|
||||||
})
|
})
|
||||||
|
|
||||||
me.downloadEverythingButton = test1.NewButton("go get go.wit.com", func() {
|
/*
|
||||||
me.downloadEverythingButton.Disable()
|
me.downloadEverythingButton = test1.NewButton("go get go.wit.com", 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()
|
me.downloadEverythingButton.Disable()
|
||||||
return
|
me.autoWorkingPwd.SetValue("/home/jcarr/go/src")
|
||||||
} else {
|
var perfect bool = true
|
||||||
var notes string
|
repos := myrepolist()
|
||||||
notes = "download everything failed"
|
for _, line := range repos {
|
||||||
me.autoWorkingPwd.SetValue(notes)
|
log.Verbose("repo =", line)
|
||||||
me.downloadEverythingButton.Enable()
|
path, _, _, _ := splitLine(line)
|
||||||
}
|
path = strings.TrimSpace(path)
|
||||||
})
|
if path == "#" {
|
||||||
test1.NewButton("go.wit.com/list", func() {
|
// 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()
|
listWindow()
|
||||||
|
listallB.Enable()
|
||||||
})
|
})
|
||||||
test1.NewButton("repostatus.ListAll()", func() {
|
test1.NewButton("repostatus.ListAll()", func() {
|
||||||
repostatus.ListAll()
|
repostatus.ListAll()
|
||||||
|
|
|
@ -11,6 +11,7 @@ import (
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
|
"go.wit.com/lib/gui/repostatus"
|
||||||
)
|
)
|
||||||
|
|
||||||
var lw *gadgets.BasicWindow
|
var lw *gadgets.BasicWindow
|
||||||
|
@ -23,7 +24,9 @@ type witRepo struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type section struct {
|
type section struct {
|
||||||
name string
|
name string
|
||||||
|
hidden bool
|
||||||
|
|
||||||
parent *gui.Node
|
parent *gui.Node
|
||||||
box *gui.Node
|
box *gui.Node
|
||||||
group *gui.Node
|
group *gui.Node
|
||||||
|
@ -68,6 +71,16 @@ func listWindow() {
|
||||||
curs.add(parts[0])
|
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) {
|
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()})
|
quickCmd(fullpath, []string{"go", "get", "-v", tmp.path.String()})
|
||||||
lw.Enable()
|
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)
|
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 := new(section)
|
||||||
|
news.name = desc
|
||||||
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(desc)
|
||||||
news.hideCB = news.box.NewCheckbox("hide")
|
news.hideCB = news.box.NewCheckbox("hide")
|
||||||
news.hideCB.Custom = func() {
|
news.hideCB.Custom = func() {
|
||||||
news.toggle()
|
news.toggle()
|
||||||
|
@ -105,6 +124,21 @@ func NewSection(parent *gui.Node, path string) *section {
|
||||||
|
|
||||||
func (s *section) toggle() {
|
func (s *section) toggle() {
|
||||||
log.Warn(s.name)
|
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 {
|
for i, wrepo := range s.witRepos {
|
||||||
log.Warn(i, wrepo.path.String())
|
log.Warn(i, wrepo.path.String())
|
||||||
wrepo.path.Hide()
|
wrepo.path.Hide()
|
||||||
|
|
Loading…
Reference in New Issue