parent
de78a20295
commit
62e1f8389c
66
main.go
66
main.go
|
@ -4,13 +4,11 @@ package main
|
||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gui/repostatus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed resources/*
|
//go:embed resources/*
|
||||||
|
@ -63,73 +61,9 @@ func main() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func addRepo(grid *gui.Node, path string, master string, devel string, user string) {
|
|
||||||
_, ok := me.allrepos[path]
|
|
||||||
if ok {
|
|
||||||
log.Info("addRepo() already had path", path)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
newRepo := new(repo)
|
|
||||||
|
|
||||||
path = strings.Trim(path, "/") // trim any extranous '/' chars put in the config file by the user
|
|
||||||
if path == "" {
|
|
||||||
log.Warn("addRepo() got empty path", path, master, devel, user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if repostatus.VerifyLocalGoRepo(path) {
|
|
||||||
log.Verbose("newRepo actually exists", newRepo.getPath())
|
|
||||||
} else {
|
|
||||||
log.Warn("repostatus.VerifyLocalGoRepo() failed for for", path, master, devel, user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
newRepo.path = path
|
|
||||||
newRepo.pLabel = grid.NewLabel(path).SetProgName("path")
|
|
||||||
|
|
||||||
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
|
|
||||||
|
|
||||||
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
|
|
||||||
newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion")
|
|
||||||
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
|
|
||||||
|
|
||||||
newRepo.dirtyLabel = grid.NewLabel("")
|
|
||||||
newRepo.goSumStatus = grid.NewLabel("?")
|
|
||||||
|
|
||||||
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
|
|
||||||
|
|
||||||
newRepo.statusButton = grid.NewButton("Configure", func() {
|
|
||||||
if newRepo.status == nil {
|
|
||||||
log.Warn("status window doesn't exist")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
log.Warn("status window exists. trying TestDraw() here")
|
|
||||||
newRepo.status.Toggle()
|
|
||||||
/// newRepo.status.Update()
|
|
||||||
})
|
|
||||||
|
|
||||||
// newRepo.status = repostatus.New(me.myGui, newRepo.path)
|
|
||||||
newRepo.status = repostatus.NewRepoStatusWindow(newRepo.path)
|
|
||||||
newRepo.hidden = false
|
|
||||||
newRepo.status.SetMainWorkingName(master)
|
|
||||||
newRepo.status.SetDevelWorkingName(devel)
|
|
||||||
newRepo.status.SetUserWorkingName(user)
|
|
||||||
/*
|
|
||||||
newRepo.status.SetDevelBranchName(devel)
|
|
||||||
newRepo.status.SetUserBranchName(user)
|
|
||||||
newRepo.status.Update()
|
|
||||||
newRepo.newScan()
|
|
||||||
*/
|
|
||||||
me.allrepos[path] = newRepo
|
|
||||||
}
|
|
||||||
|
|
||||||
func autotypistWindow() {
|
func autotypistWindow() {
|
||||||
win := me.myGui.NewWindow("autotypist for GO & git. it types faster than you can.")
|
win := me.myGui.NewWindow("autotypist for GO & git. it types faster than you can.")
|
||||||
box := win.NewBox("bw hbox", true)
|
box := win.NewBox("bw hbox", true)
|
||||||
|
|
||||||
globalDisplayOptions(box)
|
globalDisplayOptions(box)
|
||||||
// globalBuildOptions(box)
|
|
||||||
// globalTestingOptions(box)
|
|
||||||
// globalResetOptions(box)
|
|
||||||
}
|
}
|
||||||
|
|
62
repolist.go
62
repolist.go
|
@ -6,6 +6,7 @@ import (
|
||||||
"os/user"
|
"os/user"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/lib/gui/repostatus"
|
"go.wit.com/lib/gui/repostatus"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -132,3 +133,64 @@ func repoworld() {
|
||||||
|
|
||||||
reposwin.Toggle()
|
reposwin.Toggle()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func addRepo(grid *gui.Node, path string, master string, devel string, user string) {
|
||||||
|
_, ok := me.allrepos[path]
|
||||||
|
if ok {
|
||||||
|
log.Info("addRepo() already had path", path)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
newRepo := new(repo)
|
||||||
|
|
||||||
|
path = strings.Trim(path, "/") // trim any extranous '/' chars put in the config file by the user
|
||||||
|
if path == "" {
|
||||||
|
log.Warn("addRepo() got empty path", path, master, devel, user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if repostatus.VerifyLocalGoRepo(path) {
|
||||||
|
log.Verbose("newRepo actually exists", newRepo.getPath())
|
||||||
|
} else {
|
||||||
|
log.Warn("repostatus.VerifyLocalGoRepo() failed for for", path, master, devel, user)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
newRepo.path = path
|
||||||
|
newRepo.pLabel = grid.NewLabel(path).SetProgName("path")
|
||||||
|
|
||||||
|
newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag")
|
||||||
|
|
||||||
|
newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion")
|
||||||
|
newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion")
|
||||||
|
newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion")
|
||||||
|
|
||||||
|
newRepo.dirtyLabel = grid.NewLabel("")
|
||||||
|
newRepo.goSumStatus = grid.NewLabel("?")
|
||||||
|
|
||||||
|
newRepo.vLabel = grid.NewLabel("").SetProgName("current")
|
||||||
|
|
||||||
|
newRepo.statusButton = grid.NewButton("Configure", func() {
|
||||||
|
if newRepo.status == nil {
|
||||||
|
log.Warn("status window doesn't exist")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.Warn("status window exists. trying TestDraw() here")
|
||||||
|
newRepo.status.Toggle()
|
||||||
|
/// newRepo.status.Update()
|
||||||
|
})
|
||||||
|
|
||||||
|
// newRepo.status = repostatus.New(me.myGui, newRepo.path)
|
||||||
|
newRepo.status = repostatus.NewRepoStatusWindow(newRepo.path)
|
||||||
|
newRepo.hidden = false
|
||||||
|
newRepo.status.SetMainWorkingName(master)
|
||||||
|
newRepo.status.SetDevelWorkingName(devel)
|
||||||
|
newRepo.status.SetUserWorkingName(user)
|
||||||
|
/*
|
||||||
|
newRepo.status.SetDevelBranchName(devel)
|
||||||
|
newRepo.status.SetUserBranchName(user)
|
||||||
|
newRepo.status.Update()
|
||||||
|
newRepo.newScan()
|
||||||
|
*/
|
||||||
|
me.allrepos[path] = newRepo
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue