better names. think about 'Menu's

This commit is contained in:
Jeff Carr 2024-02-29 17:29:19 -06:00
parent a182d6b423
commit 0c7846d76a
4 changed files with 12 additions and 40 deletions

View File

@ -12,6 +12,9 @@ build:
cp -a ~/go/src/go.wit.com/toolkits/*.so resources/ cp -a ~/go/src/go.wit.com/toolkits/*.so resources/
GO111MODULE=off go build -v -x GO111MODULE=off go build -v -x
vet:
GO111MODULE=off go vet
only-me: build only-me: build
reset reset
./autotypist --only-me ./autotypist --only-me

View File

@ -36,7 +36,7 @@ func globalBuildOptions(vbox *gui.Node) {
grid.NewGroup("git checkout") grid.NewGroup("git checkout")
// checking this will automatically make the branches off of devel // checking this will automatically make the branches off of devel
grid.NextRow() grid.NextRow()
me.autoCreateBranches = grid.NewCheckbox("create if missing").SetChecked(true) me.autoCreateBranches = grid.NewCheckbox("auto-create branches if not upstream").SetChecked(true)
me.autoCreateBranches.Custom = func() { me.autoCreateBranches.Custom = func() {
if me.autoCreateBranches.Checked() { if me.autoCreateBranches.Checked() {
os.Setenv("AUTOTYPIST_CREATE_BRANCHES", "on") os.Setenv("AUTOTYPIST_CREATE_BRANCHES", "on")
@ -49,13 +49,13 @@ func globalBuildOptions(vbox *gui.Node) {
grid.NewButton("git checkout default", func() { grid.NewButton("git checkout default", func() {
me.repos.View.ArgCheckoutMaster() me.repos.View.ArgCheckoutMaster()
}) })
grid.NewLabel("master,main,etc.") // set the order of these in the config file grid.NewLabel("master,main,etc.") // set the order of these in the config file ?
grid.NextRow() grid.NextRow()
grid.NewButton("git checkout devel", func() { grid.NewButton("git checkout devel", func() {
me.repos.View.ArgCheckoutDevel() me.repos.View.ArgCheckoutDevel()
}) })
grid.NewLabel("guidevel,devel") grid.NewLabel("guidevel,devel") // set the order of these in the config file ?
grid.NextRow() grid.NextRow()
grid.NewButton("git checkout user", func() { grid.NewButton("git checkout user", func() {
@ -69,33 +69,7 @@ func globalBuildOptions(vbox *gui.Node) {
// this lets you select your user branch, but, when you are happy // this lets you select your user branch, but, when you are happy
// you can merge everything into the devel branch and make sure it actually // you can merge everything into the devel branch and make sure it actually
// works. Then, when that is good, merge and version everything in master // works. Then, when that is good, merge and version everything in master
grid.NewButton("set working mode:", func() {
me.Disable()
targetMode := me.newMode.String()
log.Warn("setting all branches to", targetMode)
if me.autoCreateBranches.Checked() {
os.Setenv("AUTOTYPIST_CREATE_BRANCHES", "on")
} else {
os.Unsetenv("AUTOTYPIST_CREATE_BRANCHES")
}
switch me.newMode.String() {
case "master":
me.repos.View.ArgCheckoutMaster()
case "devel":
me.repos.View.ArgCheckoutDevel()
case "user":
me.repos.View.ArgCheckoutUser()
}
me.Enable()
/* /*
var count int
for _, repo := range repolist.AllRepos() {
if repo.ReadOnly() {
continue
}
if targetName == repo.Status.GetCurrentBranchName() {
continue
}
if repo.Status.BranchExists(targetName) { if repo.Status.BranchExists(targetName) {
ok := repo.Status.CheckoutBranch(targetName) ok := repo.Status.CheckoutBranch(targetName)
if ok { if ok {
@ -122,17 +96,12 @@ func globalBuildOptions(vbox *gui.Node) {
} }
repo.Scan() repo.Scan()
count += 1 count += 1
}
*/ */
})
me.newMode = grid.NewDropdown()
me.newMode.AddText("git default")
me.newMode.AddText("devel")
me.newMode.AddText("user")
me.newMode.SetText("user")
grid.NextRow() grid.NextRow()
grid.NewButton("git fetch master & devel", func() {
grid.NewGroup("update from upstream")
grid.NewButton("git fetch master & devel branches", func() {
me.Disable() me.Disable()
defer me.Enable() defer me.Enable()
log.Warn("updating all master branches") log.Warn("updating all master branches")

View File

@ -71,7 +71,7 @@ func globalDisplayOptions(vbox *gui.Node) {
}) })
var listallB *gui.Node var listallB *gui.Node
listallB = group1.NewButton("go.wit.com", func() { listallB = group1.NewButton("Download Apps", func() {
listallB.Disable() listallB.Disable()
if me.lw == nil { if me.lw == nil {
me.lw = gowit.ListWindow(me.repos.View) me.lw = gowit.ListWindow(me.repos.View)

View File

@ -54,7 +54,7 @@ func makeRepoView() *repoWindow {
log.Warn("Should I do something special here?") log.Warn("Should I do something special here?")
} }
r.topbox = r.repoAllButtons() r.topbox = r.repoMenu()
r.View = repolist.AutotypistView(r.box) r.View = repolist.AutotypistView(r.box)
@ -82,7 +82,7 @@ func (r *repoWindow) showApps() {
} }
} }
func (r *repoWindow) repoAllButtons() *gui.Node { func (r *repoWindow) repoMenu() *gui.Node {
// reposbox.SetExpand(false) // reposbox.SetExpand(false)
group1 := r.box.NewGroup("Run on all repos:") group1 := r.box.NewGroup("Run on all repos:")