diff options
Diffstat (limited to 'windowRepos.go')
| -rw-r--r-- | windowRepos.go | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/windowRepos.go b/windowRepos.go new file mode 100644 index 0000000..95787de --- /dev/null +++ b/windowRepos.go @@ -0,0 +1,86 @@ +// Copyright 2017-2025 WIT.COM Inc. All rights reserved. +// Use of this source code is governed by the GPL 3.0 + +package main + +// An app to submit patches for the 30 GO GUI repos + +import ( + "go.wit.com/lib/gadgets" + "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/log" +) + +func makeReposWin() *gadgets.GenericWindow { + win := gadgets.NewGenericWindow("git repos", "All about git repos") + grid := win.Group.RawGrid() + + me.repoDirtyB = grid.NewButton("dirty", func() { + doCheckDirtyAndConfigSave() + found := findDirty() + tb, box := makeStandardReposWindow("dirty repos", found) + hbox := box.Box().Horizontal() + hbox.NewButton("commit all", func() { + all := found.SortByFullPath() + for all.Scan() { + repo := all.Next() + log.Info("do commit here on", repo.GetGoPath()) + } + log.Info("TODO: fix this") + log.Info("run 'forge commit --all'") + }) + hbox.NewButton("update table", func() { + me.forge.PrintHumanTable(found) + found2 := findDirty() + me.forge.PrintHumanTable(found2) + tb.Update() + tb.UpdateTable(found2) + }) + hbox.NewButton("delete table", func() { + tb.Delete() + }) + }) + + var writeWin *gadgets.GenericWindow + me.repoWritableB = grid.NewButton("writable", func() { + // 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() + if me.forge.Config.IsReadOnly(repo.GetGoPath()) { + continue + } + + found.AppendByGoPath(repo) + + } + writeWin, _ = makeWritableWindow(found) + writeWin.Win.Custom = func() { + log.Info("closing window. could do somethine here") + } + }) + + me.repoAllB = grid.NewButton("All", func() { + me.found = new(gitpb.Repos) + all := me.forge.Repos.SortByFullPath() + for all.Scan() { + repo := all.Next() + me.found.AppendByGoPath(repo) + + } + makeStandardReposWindow("All repos", me.found) + }) + + grid.NewButton("Configure", func() { + log.Info("add a forge config window here") + }) + + return win +} |
