guireleaser/repoview.go

74 lines
1.3 KiB
Go
Raw Normal View History

2024-02-18 15:09:04 -06:00
package main
import (
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
2024-02-18 15:09:04 -06:00
"go.wit.com/log"
"go.wit.com/gui"
)
type repoWindow struct {
win *gadgets.BasicWindow
box *gui.Node
View *repolist.RepoList
}
func (r *repoWindow) Hidden() bool {
return r.win.Hidden()
}
func (r *repoWindow) Show() {
r.win.Show()
}
func (r *repoWindow) Hide() {
r.win.Hide()
}
func (r *repoWindow) Disable() {
r.box.Disable()
}
func (r *repoWindow) Enable() {
r.box.Enable()
}
// you can only have one of these
func makeRepoView() *repoWindow {
if me.repos != nil {
return me.repos
}
r := new(repoWindow)
2024-02-20 10:59:24 -06:00
r.win = gadgets.RawBasicWindow("GUI repositories in ~/go/src/")
2024-02-18 15:09:04 -06:00
r.win.Make()
r.box = r.win.Box().NewBox("bw vbox", false)
r.win.Custom = func() {
log.Warn("GOT HERE: main() gadgets.NewBasicWindow() close")
log.Warn("Should I do something special here?")
}
// reposbox.SetExpand(false)
group1 := r.box.NewGroup("Run on all repos:")
hbox := group1.Box()
// hbox.Horizontal()
hbox.Vertical()
2024-11-29 22:38:13 -06:00
r.View = repolist.InitBox(me.forge, r.box)
2024-11-29 22:32:25 -06:00
r.View.Enable()
r.View.ScanRepositories()
/*
2024-12-01 10:42:49 -06:00
r.View = repolist.GuireleaserView(r.box)
2024-12-01 10:42:49 -06:00
showncount := r.View.MirrorShownCount()
box2.Append(showncount)
duration := r.View.MirrorScanDuration()
box2.Append(duration)
2024-11-29 22:32:25 -06:00
*/
return r
2024-02-18 15:09:04 -06:00
}