fix "patchable" repos button

This commit is contained in:
Jeff Carr 2025-05-31 21:53:14 -05:00
parent 1282c17e81
commit 391d47318b
5 changed files with 36 additions and 36 deletions

View File

@ -197,8 +197,9 @@ func drawWindow(win *gadgets.GenericWindow) {
patchesWin = makePatchesWin(notdone) patchesWin = makePatchesWin(notdone)
}) })
gridM.NextRow()
var howtoWin *gadgets.GenericWindow var howtoWin *gadgets.GenericWindow
gridM.NewButton("Howto", func() { gridM.NewButton("Tutorial", func() {
if howtoWin != nil { if howtoWin != nil {
howtoWin.Toggle() howtoWin.Toggle()
return return
@ -206,6 +207,9 @@ func drawWindow(win *gadgets.GenericWindow) {
howtoWin = makeHowtoWin() howtoWin = makeHowtoWin()
}) })
gridM.NextRow()
gridM.NewLabel("")
group1 := win.Stack.NewGroup("Forge Mode (deprecated)") group1 := win.Stack.NewGroup("Forge Mode (deprecated)")
grid = group1.RawGrid() grid = group1.RawGrid()
me.forgeMode = grid.NewLabel("") me.forgeMode = grid.NewLabel("")

View File

@ -117,7 +117,7 @@ func findPublishable() {
} }
} }
func findReposWithPatches() { func findReposWithPatches() *gitpb.Repos {
for repo := range me.forge.Repos.IterByFullPath() { for repo := range me.forge.Repos.IterByFullPath() {
if repo.GetTargetVersion() != "" { if repo.GetTargetVersion() != "" {
// add everything that has a target version set // add everything that has a target version set
@ -148,4 +148,5 @@ func findReposWithPatches() {
continue continue
} }
} }
return me.found
} }

View File

@ -41,14 +41,15 @@ func makeHowtoWin() *gadgets.GenericWindow {
grid.NewLabel("") // a stupid way to add padding grid.NewLabel("") // a stupid way to add padding
grid.NextRow() grid.NextRow()
howtoWin.Group.NewLabel("Working dir: " + me.forge.GetGoSrc()) // howtoWin.Group.NewLabel("Working dir: " + me.forge.GetGoSrc())
grid = howtoWin.Group.RawGrid() grid = howtoWin.Group.RawGrid()
grid.NewButton("Download", func() { grid.NewButton("Download into "+me.forge.GetGoSrc(), func() {
howtoWin.Disable() howtoWin.Disable()
defer howtoWin.Enable() defer howtoWin.Enable()
downloadForge() downloadForge()
}) })
grid.NewButton("Build", func() { grid.NewButton("Build forge & GUI GO plugins", func() {
howtoWin.Disable() howtoWin.Disable()
defer howtoWin.Enable() defer howtoWin.Enable()
buildForge() buildForge()

View File

@ -112,12 +112,6 @@ func makeReposWin() *stdReposTableWin {
rwin.boxTB = win.Bottom.Box() rwin.boxTB = win.Bottom.Box()
grid.NewButton("dirty on bottom", func() {
log.Info("try to show dirty repos on bottom")
found := findDirty()
rwin.doReposTable(found)
})
grid.NextRow() grid.NextRow()
found = develRemoteProblem() found = develRemoteProblem()
@ -135,7 +129,7 @@ func makeReposWin() *stdReposTableWin {
}) })
grid.NextRow() grid.NextRow()
makeHackModeWindow(win) makeHackModeWindow(rwin)
return rwin return rwin
} }
@ -175,8 +169,8 @@ func (rwin *stdReposTableWin) doReposTable(pb *gitpb.Repos) {
rwin.TB = t rwin.TB = t
} }
func makeHackModeWindow(win *gadgets.GenericWindow) { func makeHackModeWindow(stdwin *stdReposTableWin) {
group := win.Top.NewGroup("This is a work in progress") group := stdwin.win.Top.NewGroup("This is a work in progress")
grid := group.RawGrid() grid := group.RawGrid()
grid.NewButton("git pull", func() { grid.NewButton("git pull", func() {
log.Info("todo: run git pull on each repo") log.Info("todo: run git pull on each repo")
@ -187,8 +181,8 @@ func makeHackModeWindow(win *gadgets.GenericWindow) {
_, box := makeStandardReposWindow("repos to merge from user to devel", found) _, box := makeStandardReposWindow("repos to merge from user to devel", found)
hbox := box.Box().Horizontal() hbox := box.Box().Horizontal()
hbox.NewButton("merge all", func() { hbox.NewButton("merge all", func() {
win.Disable() stdwin.win.Disable()
defer win.Enable() defer stdwin.win.Enable()
all := found.SortByFullPath() all := found.SortByFullPath()
for all.Scan() { for all.Scan() {
repo := all.Next() repo := all.Next()
@ -221,26 +215,26 @@ func makeHackModeWindow(win *gadgets.GenericWindow) {
}) })
grid.NextRow() grid.NextRow()
group2 := win.Top.NewGroup("Merge") group2 := stdwin.win.Top.NewGroup("Merge")
grid = group2.RawGrid() grid = group2.RawGrid()
grid.NewButton("merge to devel", func() { grid.NewButton("merge to devel", func() {
win.Disable() stdwin.win.Disable()
defer win.Enable() defer stdwin.win.Enable()
mergeUserToDevel(true) mergeUserToDevel(true)
}) })
grid.NewButton("merge to master", func() { grid.NewButton("merge to master", func() {
win.Disable() stdwin.win.Disable()
defer win.Enable() defer stdwin.win.Enable()
mergeDevelToMaster(true) mergeDevelToMaster(true)
}) })
grid.NewButton("merge all", func() { grid.NewButton("merge all", func() {
win.Disable() stdwin.win.Disable()
defer win.Enable() defer stdwin.win.Enable()
me.argvCheckoutUser = false me.argvCheckoutUser = false
me.argvCheckoutDevel = true me.argvCheckoutDevel = true
@ -265,7 +259,13 @@ func makeHackModeWindow(win *gadgets.GenericWindow) {
mergeDevelToMaster(true) mergeDevelToMaster(true)
}) })
group3 := win.Top.NewGroup("work in progress") grid.NewButton("show dirty repos on win.Bottom", func() {
log.Info("try to show dirty repos on bottom")
found := findDirty()
stdwin.doReposTable(found)
})
group3 := stdwin.win.Top.NewGroup("work in progress")
grid = group3.RawGrid() grid = group3.RawGrid()
grid.NewButton("forge ConfigSave()", func() { grid.NewButton("forge ConfigSave()", func() {

View File

@ -35,7 +35,7 @@ func (w *stdReposTableWin) Toggle() {
} }
func makeWindowForPB() *gadgets.GenericWindow { func makeWindowForPB() *gadgets.GenericWindow {
win := gadgets.NewGenericWindow("Forge Repos Raw Protobuf View", "Filter Git Repositories") win := gadgets.NewGenericWindow("Forge Repos Protobuf View", "Display Git Repositories")
return win return win
} }
@ -64,23 +64,17 @@ func makeReposWinNew() *gadgets.GenericWindow {
log.Info("table has uuid", t.GetUuid()) log.Info("table has uuid", t.GetUuid())
}) })
grid.NewButton("with patches", func() { grid.NewButton("to publish", func() {
if t != nil { if t != nil {
t.Delete() t.Delete()
t = nil t = nil
} }
found := new(gitpb.Repos) me.found = new(gitpb.Repos)
all := me.forge.Repos.SortByFullPath() findReposWithPatches()
for all.Scan() { me.forge.PrintHumanTable(me.found)
repo := all.Next()
if me.forge.Config.IsReadOnly(repo.GetGoPath()) {
continue
}
found.AppendByGoPath(repo)
}
// make the window for the first time // make the window for the first time
t = addWindowPB(insertWin, found) t = addWindowPB(insertWin, me.found)
f := func(repo *gitpb.Repo) { f := func(repo *gitpb.Repo) {
log.Info("got to ReposTable.Custom() id =", repo.GetGoPath(), repo.GetCurrentVersion()) log.Info("got to ReposTable.Custom() id =", repo.GetGoPath(), repo.GetCurrentVersion())
} }