From dda63e3732ddb94ca7e4533d7dfbc0c95e99c497 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 14 Jan 2024 21:43:31 -0600 Subject: [PATCH] testing Delete/Show/Hide Signed-off-by: Jeff Carr --- go.mod | 6 ++++-- go.sum | 8 ++++++++ main.go | 17 +++++++++++++---- scan.go | 2 +- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 5bd518f..9f60e04 100644 --- a/go.mod +++ b/go.mod @@ -6,13 +6,15 @@ require ( go.wit.com/apps/control-panel-dns v0.12.2 go.wit.com/gui/gadgets v0.12.2 go.wit.com/gui/gadgets/repostatus v0.12.2 - go.wit.com/gui/gui v0.12.6 + go.wit.com/gui/gui v0.12.8 go.wit.com/log v0.5.3 ) require ( github.com/alexflint/go-scalar v1.2.0 // indirect + go.wit.com/dev/alexflint/arg v1.4.5 // indirect go.wit.com/dev/alexflint/go-arg v1.4.6 // indirect + go.wit.com/dev/alexflint/scalar v1.2.1 // indirect go.wit.com/dev/davecgh/spew v1.1.3 // indirect - go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93 // indirect + go.wit.com/gui/widget v1.1.3 // indirect ) diff --git a/go.sum b/go.sum index 4508a40..b31dadd 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,12 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= go.wit.com/apps/control-panel-dns v0.12.2 h1:YkqiEbGcJIXX8n0L5sYsfDz3nd5/J5YaUTln+38VNOs= go.wit.com/apps/control-panel-dns v0.12.2/go.mod h1:y+DRqorB3K/xAiDSil5cCVUalsJzMdUQuK9HambO0fQ= +go.wit.com/dev/alexflint/arg v1.4.5 h1:asDx5f9IlfpknKjPBqqb2qndE91Pbo7ZDkWUgddfMhY= +go.wit.com/dev/alexflint/arg v1.4.5/go.mod h1:wnWc+c6z8kSdDKYriMf6RpM+FiXmo5RYp/t4FNi0MU0= go.wit.com/dev/alexflint/go-arg v1.4.6 h1:0kxl4YQvC8t89eGIY5e/qPSMKWmLc32aJXF08g8jRlA= go.wit.com/dev/alexflint/go-arg v1.4.6/go.mod h1:td08jpeZ4vQ/Bu870In78YE2QRrNXhxvY1A34hC7qFo= +go.wit.com/dev/alexflint/scalar v1.2.1 h1:loXOcbVnd+8YeJRLey+XXidecBiedMDO00zQ26TvKNs= +go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs= go.wit.com/dev/davecgh/spew v1.1.3 h1:hqnB5qsPgC2cLZaJXqQJspQ5n/Ugry9kyL3tLk0hVzQ= go.wit.com/dev/davecgh/spew v1.1.3/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA= go.wit.com/gui/gadgets v0.12.2 h1:mjlTLJHHcrt4UAgs8TlzanDU/1fX314dOBzTVg0KP4o= @@ -19,8 +23,12 @@ go.wit.com/gui/gadgets/repostatus v0.12.2 h1:wRUAsNmQksyqZez8feLehim7MgwYoHBusCz go.wit.com/gui/gadgets/repostatus v0.12.2/go.mod h1:xIfy2RGM9jjSJxO7el2JwpwIQ23as8TI1dQgclUOJFs= go.wit.com/gui/gui v0.12.6 h1:GvLqXShPa8Y1gIHNHKeMQgEQljGw0AWBLBrJg7IxaNE= go.wit.com/gui/gui v0.12.6/go.mod h1:WrAJB4kIR/U0z/PzrkYYQG6QeuXDLcpgiH5vXnz5I1s= +go.wit.com/gui/gui v0.12.8 h1:YJ7YjdP9+vwWYVvMakaJPPpfPt9g33Iw0xfuwNQZkmA= +go.wit.com/gui/gui v0.12.8/go.mod h1:iALRA0qw7mn82MX21wrU0FOq/vR9l27If7ObNdOSlNE= go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93 h1:zCzaHvXJJ/rWXmDc/v79VvM6W2lxxzJGfnW2lHCv3Ho= go.wit.com/gui/widget v0.0.0-20240105185907-84aafa536a93/go.mod h1:A6/FaiFQtAHTjgo7c4FrokXe6bXX1Cowo35b2Lgi31E= +go.wit.com/gui/widget v1.1.3 h1:GvLzGSOF9tfmoh6HNbFdN+NSlBo2qeS/Ba2TnQQ1A1U= +go.wit.com/gui/widget v1.1.3/go.mod h1:A6/FaiFQtAHTjgo7c4FrokXe6bXX1Cowo35b2Lgi31E= go.wit.com/log v0.5.3 h1:/zHkniOPusPEuX1R401rMny9uwSO/nSU/QOMx6qoEnE= go.wit.com/log v0.5.3/go.mod h1:LzIzVxc2xJQxWQBtV9VbV605P4TOxmYDCl+BZF38yGE= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/main.go b/main.go index 40a842d..0e99f1f 100644 --- a/main.go +++ b/main.go @@ -47,6 +47,14 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri newRepo.newScan() }) + grid.NewButton("Update()", func () { + if newRepo.status == nil { + log.Warn("status window doesn't exist") + return + } + log.Warn("status window exists. trying Update() here") + newRepo.status.Update() + }) grid.NewButton("Hide()", func () { if newRepo.status == nil { log.Warn("status window doesn't exist") @@ -83,7 +91,7 @@ func repoworld() { reposbox = reposwin.Box().NewBox("bw vbox", false) reposgroup = reposbox.NewGroup("go repositories (read from ~/.config/myrepolist)") - reposgrid = reposgroup.NewGrid("test", 14, 1) + reposgrid = reposgroup.NewGrid("test", 15, 1) reposgrid.NewLabel("") reposgrid.NewLabel("branch") @@ -97,9 +105,10 @@ func repoworld() { reposgrid.NewLabel("user") reposgrid.NewLabel("version") reposgrid.NewLabel("Status") - reposgrid.NewLabel("commit") - reposgrid.NewLabel("Toggle()") - reposgrid.NewLabel("Draw()") + reposgrid.NewLabel("rescan") + reposgrid.NewLabel("Update()") + reposgrid.NewLabel("Hide()") + reposgrid.NewLabel("Show()") repos := myrepolist() for _, line := range repos { diff --git a/scan.go b/scan.go index 2b8ce71..d35dee4 100644 --- a/scan.go +++ b/scan.go @@ -50,7 +50,7 @@ func (r *repo) newScan() bool { if r.status.CheckBranches() { log.Warn("Branches are Perfect") - r.dirtyLabel.SetText("PEFECT") + r.dirtyLabel.SetText("PERFECT") return true } else { log.Warn("Branches are not Perfect")