disable state works

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-26 13:45:27 -06:00
parent 1a459d6f6f
commit 0e979faf5b
3 changed files with 77 additions and 40 deletions

View File

@ -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:

View File

@ -2,10 +2,8 @@ package main
import (
"os"
"strings"
"go.wit.com/lib/gui/repostatus"
"go.wit.com/log"
"go.wit.com/gui"
)
@ -21,6 +19,7 @@ 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")
@ -55,8 +54,12 @@ func globalTestingOptions(box *gui.Node) {
me.downloadEverythingButton.Enable()
}
})
test1.NewButton("go.wit.com/list", func() {
*/
var listallB *gui.Node
listallB = test1.NewButton("go.wit.com/list", func() {
listallB.Disable()
listWindow()
listallB.Enable()
})
test1.NewButton("repostatus.ListAll()", func() {
repostatus.ListAll()

View File

@ -11,6 +11,7 @@ import (
"go.wit.com/log"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repostatus"
)
var lw *gadgets.BasicWindow
@ -24,6 +25,8 @@ type witRepo struct {
type section struct {
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()