ready to check for valid repos
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
3094c6283c
commit
c401c60399
|
@ -51,44 +51,6 @@ func globalDisplayOptions(box *gui.Node) {
|
|||
globalDisplaySetRepoState()
|
||||
reposwin.Toggle()
|
||||
})
|
||||
/*
|
||||
group1.NewButton("Create Release Window", func() {
|
||||
if release.win == nil {
|
||||
log.Info("Creating the Release Window")
|
||||
createReleaseWindow()
|
||||
log.Info("Toggling the Release Window")
|
||||
release.win.Toggle()
|
||||
}
|
||||
log.Info("Toggling the Release Window")
|
||||
release.openrepo.Disable()
|
||||
for _, repo := range me.allrepos {
|
||||
repo.newScan()
|
||||
}
|
||||
reposwin.Toggle()
|
||||
release.win.Toggle()
|
||||
})
|
||||
group1.NewButton("Create Release Window (fullscan)", func() {
|
||||
if release.win == nil {
|
||||
log.Info("Creating the Release Window")
|
||||
createReleaseWindow()
|
||||
for _, repo := range me.allrepos {
|
||||
repo.status.Update()
|
||||
repo.newScan()
|
||||
}
|
||||
globalDisplaySetRepoState()
|
||||
// open the repo window
|
||||
reposwin.Toggle()
|
||||
log.Info("Toggling the Release Window")
|
||||
release.win.Toggle()
|
||||
}
|
||||
log.Info("Toggling the Release Window")
|
||||
release.win.Toggle()
|
||||
release.openrepo.Disable()
|
||||
for _, repo := range me.allrepos {
|
||||
repo.newScan()
|
||||
}
|
||||
})
|
||||
*/
|
||||
|
||||
me.autoHideReadOnly = group1.NewCheckbox("Hide read-only repos").SetChecked(true)
|
||||
me.autoHideReadOnly.Custom = func() {
|
||||
|
|
19
main.go
19
main.go
|
@ -20,11 +20,8 @@ func main() {
|
|||
|
||||
me.myGui = gui.New()
|
||||
me.myGui.InitEmbed(resToolkit)
|
||||
// me.myGui.LoadToolkit("nocui")
|
||||
me.myGui.Default()
|
||||
|
||||
// autotypistWindow()
|
||||
|
||||
me.mainWindow = me.myGui.NewWindow("GUI release manager")
|
||||
me.mainBox = me.mainWindow.NewBox("bw hbox", true)
|
||||
|
||||
|
@ -36,17 +33,11 @@ func main() {
|
|||
repo.status.Update()
|
||||
repo.newScan()
|
||||
}
|
||||
if release.win == nil {
|
||||
log.Info("Creating the Release Window")
|
||||
createReleaseWindow(me.mainBox)
|
||||
globalDisplaySetRepoState()
|
||||
// open the repo window
|
||||
reposwin.Toggle()
|
||||
log.Info("Toggling the Release Window")
|
||||
release.win.Toggle()
|
||||
}
|
||||
log.Info("Toggling the Release Window")
|
||||
release.win.Toggle()
|
||||
log.Info("Creating the Release Window")
|
||||
|
||||
createReleaseBox(me.mainBox)
|
||||
globalDisplaySetRepoState()
|
||||
|
||||
release.openrepo.Disable()
|
||||
|
||||
// scan repos every 30 seconds
|
||||
|
|
|
@ -18,7 +18,7 @@ var release releaseStruct
|
|||
type releaseStruct struct {
|
||||
current *repo
|
||||
|
||||
win *gadgets.BasicWindow
|
||||
// win *gadgets.BasicWindow
|
||||
box *gui.Node
|
||||
group *gui.Node
|
||||
grid *gui.Node
|
||||
|
@ -39,28 +39,19 @@ type releaseStruct struct {
|
|||
checkSafeB *gui.Node
|
||||
}
|
||||
|
||||
func createReleaseWindow(box *gui.Node) {
|
||||
/*
|
||||
if release.win != nil {
|
||||
release.win.Toggle()
|
||||
return
|
||||
}
|
||||
*/
|
||||
func (w *autoType) Disable() {
|
||||
w.mainWindow.Disable()
|
||||
}
|
||||
|
||||
func (w *autoType) Enable() {
|
||||
w.mainWindow.Enable()
|
||||
}
|
||||
|
||||
func createReleaseBox(box *gui.Node) {
|
||||
versionS := "0.17.0"
|
||||
reasonS := "gocui"
|
||||
partS := strings.Split(versionS, ".")
|
||||
|
||||
/*
|
||||
release.win = gadgets.NewBasicWindow(me.myGui, "Make a new release")
|
||||
release.win.Custom = func() {
|
||||
log.Info("Release Window close")
|
||||
}
|
||||
|
||||
release.win.Make()
|
||||
release.win.StandardClose()
|
||||
release.win.Draw()
|
||||
*/
|
||||
release.box = box
|
||||
release.group = release.box.NewGroup("things")
|
||||
release.grid = release.group.NewGrid("buildOptions", 2, 1)
|
||||
|
@ -68,18 +59,29 @@ func createReleaseWindow(box *gui.Node) {
|
|||
// do an initial scan of all the repos
|
||||
scanGoSum()
|
||||
|
||||
release.grid.NewButton("findNextDirty()", func() {
|
||||
release.win.Disable()
|
||||
if findNextDirty() {
|
||||
log.Info("findNextDirty() found a repo")
|
||||
release.win.Enable()
|
||||
release.grid.NewButton("findNextBad()", func() {
|
||||
me.Disable()
|
||||
if findNextBad() {
|
||||
log.Info("findNextBad() found a repo")
|
||||
me.Enable()
|
||||
return
|
||||
}
|
||||
release.win.Enable()
|
||||
me.Enable()
|
||||
})
|
||||
release.grid.NewButton("find next Bad", func() {
|
||||
me.Disable()
|
||||
if findNextDirty() {
|
||||
log.Info("findNextDirty() found a repo")
|
||||
me.Enable()
|
||||
return
|
||||
}
|
||||
me.Enable()
|
||||
})
|
||||
/*
|
||||
release.grid.NewButton("nil", func() {
|
||||
log.Info("just filling the grid")
|
||||
})
|
||||
*/
|
||||
release.grid.NewButton("next repo", func() {
|
||||
buttonDisable()
|
||||
defer buttonEnable()
|
||||
|
@ -279,33 +281,11 @@ func createReleaseWindow(box *gui.Node) {
|
|||
}
|
||||
|
||||
func buttonDisable() {
|
||||
release.win.Disable()
|
||||
/*
|
||||
release.nextRepoB.Disable()
|
||||
release.openRepoB.Disable()
|
||||
release.goGetB.Disable()
|
||||
release.makeRedomodB.Disable()
|
||||
release.checkGoSumB.Disable()
|
||||
release.openrepo.Disable()
|
||||
release.checkDirtyB.Disable()
|
||||
release.sendVersionB.Disable()
|
||||
release.checkSafeB.Disable()
|
||||
*/
|
||||
me.Disable()
|
||||
}
|
||||
|
||||
func buttonEnable() {
|
||||
release.win.Enable()
|
||||
/*
|
||||
release.nextRepoB.Enable()
|
||||
release.openRepoB.Enable()
|
||||
release.goGetB.Enable()
|
||||
release.makeRedomodB.Enable()
|
||||
release.checkGoSumB.Enable()
|
||||
release.openrepo.Enable()
|
||||
release.checkDirtyB.Enable()
|
||||
release.sendVersionB.Enable()
|
||||
release.checkSafeB.Enable()
|
||||
*/
|
||||
me.Enable()
|
||||
}
|
||||
|
||||
func findDirty2() bool {
|
||||
|
@ -351,6 +331,21 @@ func setCurrentRepo(newcur *repo, s string, note string) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
func findNextBad() bool {
|
||||
for _, repo := range me.allrepos {
|
||||
goSumS := repo.getGoSumStatus()
|
||||
dirtyS := repo.dirtyLabel.String()
|
||||
|
||||
log.Info("findNextDirty()", repo.String(), goSumS, dirtyS)
|
||||
if goSumS == "BAD" {
|
||||
if setCurrentRepo(repo, "primative not committed", "release new version") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func findNextDirty() bool {
|
||||
for _, repo := range me.allrepos {
|
||||
goSumS := repo.getGoSumStatus()
|
||||
|
|
|
@ -19,7 +19,7 @@ type autoType struct {
|
|||
allrepos map[string]*repo
|
||||
myGui *gui.Node
|
||||
|
||||
autotypistWindow *gadgets.BasicWindow
|
||||
// autotypistWindow *gadgets.BasicWindow
|
||||
mainWindow *gui.Node
|
||||
mainBox *gui.Node
|
||||
|
||||
|
|
Loading…
Reference in New Issue