remove lots of old code. breaks a lot too.
This commit is contained in:
parent
71d4cf3c2d
commit
33a6037982
55
doGui.go
55
doGui.go
|
@ -8,20 +8,18 @@ import (
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/debugger"
|
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func debug() {
|
func debug() {
|
||||||
log.Info("cmd line --debugger == true")
|
log.Info("cmd line --debugger == true")
|
||||||
go func() {
|
func() {
|
||||||
log.Sleep(3)
|
for {
|
||||||
log.Info("cmd line --debugger == true")
|
log.Sleep(30)
|
||||||
log.Info("cmd line --debugger == true")
|
log.Info("cmd line --debugger == true")
|
||||||
log.Info("cmd line --debugger == true")
|
// debugger.DebugWindow()
|
||||||
log.Info("cmd line --debugger == true")
|
}
|
||||||
debugger.DebugWindow()
|
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,10 +33,6 @@ func doGui() {
|
||||||
me.myGui.SetAppDefaultPlugin(me.forge.Config.DefaultGui) // sets the default GUI plugin to use
|
me.myGui.SetAppDefaultPlugin(me.forge.Config.DefaultGui) // sets the default GUI plugin to use
|
||||||
me.myGui.Default()
|
me.myGui.Default()
|
||||||
|
|
||||||
// debug()
|
|
||||||
|
|
||||||
me.patchWin = new(patchesWindow)
|
|
||||||
|
|
||||||
me.mainWindow = gadgets.RawBasicWindow("Forge: (this kinda works sometimes)")
|
me.mainWindow = gadgets.RawBasicWindow("Forge: (this kinda works sometimes)")
|
||||||
me.mainWindow.Make()
|
me.mainWindow.Make()
|
||||||
me.mainWindow.Show()
|
me.mainWindow.Show()
|
||||||
|
@ -60,16 +54,10 @@ func doGui() {
|
||||||
vbox2 := me.mainbox.NewVerticalBox("BOX2")
|
vbox2 := me.mainbox.NewVerticalBox("BOX2")
|
||||||
globalBuildOptions(vbox2)
|
globalBuildOptions(vbox2)
|
||||||
|
|
||||||
me.repos = makeRepoView()
|
|
||||||
|
|
||||||
me.Enable()
|
me.Enable()
|
||||||
|
// sits here forever
|
||||||
|
debug()
|
||||||
|
|
||||||
// intermittently scans the status indefinitly
|
|
||||||
me.repos.View.Watchdog(func() {
|
|
||||||
log.Info("Watchdog in doGui()")
|
|
||||||
// processing is done. update the repo summary box
|
|
||||||
// me.summary.Update()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func globalBuildOptions(vbox *gui.Node) {
|
func globalBuildOptions(vbox *gui.Node) {
|
||||||
|
@ -138,15 +126,30 @@ func globalBuildOptions(vbox *gui.Node) {
|
||||||
me.autoCreateBranches = grid.NewCheckbox("create if missing").SetChecked(true)
|
me.autoCreateBranches = grid.NewCheckbox("create if missing").SetChecked(true)
|
||||||
grid.NextRow()
|
grid.NextRow()
|
||||||
|
|
||||||
|
var reposWin *repoWindow
|
||||||
|
|
||||||
grid.NewButton("Repo Window", func() {
|
grid.NewButton("Repo Window", func() {
|
||||||
if me.repos.Hidden() {
|
if reposWin != nil {
|
||||||
me.repos.Show()
|
if reposWin.Hidden() {
|
||||||
} else {
|
reposWin.Show()
|
||||||
me.repos.Hide()
|
} else {
|
||||||
|
reposWin.Hide()
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
reposWin = makeRepoView()
|
||||||
|
reposWin.Show()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
var patchWin *patchesWindow
|
||||||
|
|
||||||
grid.NewButton("Patches Window", func() {
|
grid.NewButton("Patches Window", func() {
|
||||||
me.patchWin.once.Do(me.patchWin.initWindow)
|
if patchWin != nil {
|
||||||
me.patchWin.Toggle()
|
patchWin.Toggle()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
patchWin = new(patchesWindow)
|
||||||
|
patchWin.initWindow()
|
||||||
|
patchWin.Show()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,8 @@ type mainType struct {
|
||||||
urlbase string // base URL
|
urlbase string // base URL
|
||||||
|
|
||||||
// our view of the repositories
|
// our view of the repositories
|
||||||
repos *repoWindow
|
// repos *repoWindow
|
||||||
patchWin *patchesWindow
|
// patchWin *patchesWindow
|
||||||
|
|
||||||
mainWindow *gadgets.BasicWindow
|
mainWindow *gadgets.BasicWindow
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ func (r *patchesWindow) submitPatchesBox(box *gui.Node) *patchSummary {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// line := "somedate " + s.reason.String() + " Author: me" + pset.GitAuthorEmail
|
// line := "somedate " + s.reason.String() + " Author: me" + pset.GitAuthorEmail
|
||||||
me.patchWin.addPatchsetNew(pset)
|
r.addPatchsetNew(pset)
|
||||||
})
|
})
|
||||||
s.grid.NewButton("Get Patchsets", func() {
|
s.grid.NewButton("Get Patchsets", func() {
|
||||||
if psets, err := me.forge.GetPatchesets(); err != nil {
|
if psets, err := me.forge.GetPatchesets(); err != nil {
|
||||||
|
|
102
windowRepos.go
102
windowRepos.go
|
@ -1,11 +1,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
|
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/lib/gui/repolist"
|
"go.wit.com/lib/gui/repolist"
|
||||||
"go.wit.com/lib/protobuf/gitpb"
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
|
@ -43,9 +40,6 @@ func (r *repoWindow) Enable() {
|
||||||
|
|
||||||
// you can only have one of these
|
// you can only have one of these
|
||||||
func makeRepoView() *repoWindow {
|
func makeRepoView() *repoWindow {
|
||||||
if me.repos != nil {
|
|
||||||
return me.repos
|
|
||||||
}
|
|
||||||
r := new(repoWindow)
|
r := new(repoWindow)
|
||||||
r.win = gadgets.RawBasicWindow("All git repositories in ~/go/src/")
|
r.win = gadgets.RawBasicWindow("All git repositories in ~/go/src/")
|
||||||
r.win.Make()
|
r.win.Make()
|
||||||
|
@ -76,8 +70,6 @@ func (r *repoWindow) repoMenu() *gui.Node {
|
||||||
hbox.Vertical()
|
hbox.Vertical()
|
||||||
|
|
||||||
box2 := hbox.Box().Horizontal()
|
box2 := hbox.Box().Horizontal()
|
||||||
/*
|
|
||||||
*/
|
|
||||||
|
|
||||||
dirty := box2.NewCheckbox("dirty")
|
dirty := box2.NewCheckbox("dirty")
|
||||||
dirty.Custom = func() {
|
dirty.Custom = func() {
|
||||||
|
@ -92,65 +84,72 @@ func (r *repoWindow) repoMenu() *gui.Node {
|
||||||
me.forge.PrintHumanTable(me.found)
|
me.forge.PrintHumanTable(me.found)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !r.mergeAllUserToDevel() {
|
/*
|
||||||
return
|
if !r.mergeAllUserToDevel() {
|
||||||
}
|
return
|
||||||
|
}
|
||||||
|
*/
|
||||||
})
|
})
|
||||||
|
|
||||||
box2.NewButton("test master merge", func() {
|
box2.NewButton("test master merge", func() {
|
||||||
r.Disable()
|
r.Disable()
|
||||||
r.mergeAllDevelToMain()
|
// r.mergeAllDevelToMain()
|
||||||
r.Enable()
|
r.Enable()
|
||||||
})
|
})
|
||||||
|
|
||||||
box2.NewButton("show apps", func() {
|
/*
|
||||||
loop := me.repos.View.ReposSortByName()
|
box2.NewButton("show apps", func() {
|
||||||
for loop.Scan() {
|
loop := me.repos.View.ReposSortByName()
|
||||||
var repo *repolist.RepoRow
|
for loop.Scan() {
|
||||||
repo = loop.Repo()
|
var repo *repolist.RepoRow
|
||||||
if repo.IsBinary() {
|
repo = loop.Repo()
|
||||||
// log.Info(repo.Status.Path(), "compile here. Show()")
|
if repo.IsBinary() {
|
||||||
repo.Show()
|
// log.Info(repo.Status.Path(), "compile here. Show()")
|
||||||
} else {
|
repo.Show()
|
||||||
// log.Info(repo.Status.Path(), "library here. Hide()")
|
} else {
|
||||||
repo.Hide()
|
// log.Info(repo.Status.Path(), "library here. Hide()")
|
||||||
|
repo.Hide()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
*/
|
||||||
box2.NewButton("ConfigSave()", func() {
|
box2.NewButton("forge ConfigSave()", func() {
|
||||||
me.forge.ConfigSave()
|
me.forge.ConfigSave()
|
||||||
})
|
})
|
||||||
box2.NewButton("Table()", func() {
|
/*
|
||||||
me.found = new(gitpb.Repos)
|
box2.NewButton("Table()", func() {
|
||||||
loop := me.forge.Repos.All()
|
me.found = new(gitpb.Repos)
|
||||||
for loop.Scan() {
|
loop := me.forge.Repos.All()
|
||||||
repo := loop.Next()
|
for loop.Scan() {
|
||||||
me.found.AppendByGoPath(repo)
|
repo := loop.Next()
|
||||||
}
|
me.found.AppendByGoPath(repo)
|
||||||
me.forge.PrintHumanTable(me.found)
|
}
|
||||||
})
|
|
||||||
box2.NewButton("Prep for release()", func() {
|
|
||||||
r.Disable()
|
|
||||||
defer r.Enable()
|
|
||||||
if IsAnythingDirty() {
|
|
||||||
log.Info("You can't apply patches when repos are dirty")
|
|
||||||
me.forge.PrintHumanTable(me.found)
|
me.forge.PrintHumanTable(me.found)
|
||||||
return
|
})
|
||||||
}
|
box2.NewButton("Prep for release()", func() {
|
||||||
if !r.mergeAllUserToDevel() {
|
r.Disable()
|
||||||
return
|
defer r.Enable()
|
||||||
}
|
if IsAnythingDirty() {
|
||||||
if !r.mergeAllDevelToMain() {
|
log.Info("You can't apply patches when repos are dirty")
|
||||||
return
|
me.forge.PrintHumanTable(me.found)
|
||||||
}
|
return
|
||||||
doAllCheckoutMaster()
|
}
|
||||||
os.Exit(0)
|
if !r.mergeAllUserToDevel() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !r.mergeAllDevelToMain() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
doAllCheckoutMaster()
|
||||||
|
os.Exit(0)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
*/
|
||||||
|
|
||||||
return box2
|
return box2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func (r *repoWindow) mergeAllDevelToMain() bool {
|
func (r *repoWindow) mergeAllDevelToMain() bool {
|
||||||
var count int
|
var count int
|
||||||
log.Info("merge all here")
|
log.Info("merge all here")
|
||||||
|
@ -247,3 +246,4 @@ func (r *repoWindow) mergeAllUserToDevel() bool {
|
||||||
log.Warn("EVERYTHING WORKED")
|
log.Warn("EVERYTHING WORKED")
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
Loading…
Reference in New Issue