diff options
| author | Jeff Carr <[email protected]> | 2025-02-24 11:00:08 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-24 11:00:08 -0600 |
| commit | 948c47b7ff5939d53636e28270fab49087ce184d (patch) | |
| tree | 7185eaba0011824917a37edebdf27ff187b8116e | |
| parent | e3d786a79c4d1af8b70dec51f2c563ea951d47c8 (diff) | |
start switching to generic GUI table codev0.22.99
| -rw-r--r-- | doGui.go | 52 |
1 files changed, 49 insertions, 3 deletions
@@ -203,8 +203,16 @@ func drawWindow(win *gadgets.BasicWindow) { }) + var writeWin *GenericWindow me.repoWritableB = grid.NewButton("writable", func() { - me.found = new(gitpb.Repos) + // if the window exists, just toggle it open or closed + if writeWin != nil { + writeWin.Toggle() + return + } + + // make the window for the first time + found := new(gitpb.Repos) all := me.forge.Repos.SortByFullPath() for all.Scan() { repo := all.Next() @@ -212,10 +220,13 @@ func drawWindow(win *gadgets.BasicWindow) { continue } - me.found.AppendByGoPath(repo) + found.AppendByGoPath(repo) } - makeStandardReposWindow("Repos that you have write access to", me.found) + writeWin, _ = makeWritableWindow(found) + writeWin.Win.Custom = func() { + log.Info("closing window. could do somethine here") + } }) me.repoAllB = grid.NewButton("All", func() { @@ -384,6 +395,41 @@ func makeStandardReposWindow(title string, pb *gitpb.Repos) (*gitpb.ReposTable, return t, box } +func makeWritableWindow(pb *gitpb.Repos) (*GenericWindow, *gitpb.ReposTable) { + win := NewGenericWindow("Repos You have write access to", "Configure") + t := pb.NewTable("testForgeRepos") + t.NewUuid() + + grid := win.Group.RawGrid() + grid.NewButton("git pull", func() { + log.Info("todo: run git pull on each repo") + }) + + grid.NewButton("do repos.ReScan()", func() { + t.Update() + }) + + tbox := win.Bottom.Box() + t.SetParent(tbox) + + sf := t.AddStringFunc("repo", func(r *gitpb.Repo) string { + return r.GetGoPath() + }) + sf.Custom = func(r *gitpb.Repo) { + log.Info("do button click on", r.GetGoPath()) + } + t.AddTimeFunc("age", func(repo *gitpb.Repo) time.Time { + return repo.NewestTime() + }) + t.AddMasterVersion() + t.AddDevelVersion() + t.AddUserVersion() + t.AddCurrentBranchName() + t.AddState() + t.ShowTable() + return win, t +} + func findMergeToDevel() *gitpb.Repos { found := gitpb.NewRepos() |
