From 0c7846d76af0b1ce901a35a8042f2a891b654c74 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 29 Feb 2024 17:29:19 -0600 Subject: [PATCH] better names. think about 'Menu's --- Makefile | 3 +++ globalBuildOptions.go | 43 ++++++----------------------------------- globalDisplayOptions.go | 2 +- repoview.go | 4 ++-- 4 files changed, 12 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index 9eecce1..a23dbf5 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,9 @@ build: cp -a ~/go/src/go.wit.com/toolkits/*.so resources/ GO111MODULE=off go build -v -x +vet: + GO111MODULE=off go vet + only-me: build reset ./autotypist --only-me diff --git a/globalBuildOptions.go b/globalBuildOptions.go index 3d89174..68b105c 100644 --- a/globalBuildOptions.go +++ b/globalBuildOptions.go @@ -36,7 +36,7 @@ func globalBuildOptions(vbox *gui.Node) { grid.NewGroup("git checkout") // checking this will automatically make the branches off of devel 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() { if me.autoCreateBranches.Checked() { os.Setenv("AUTOTYPIST_CREATE_BRANCHES", "on") @@ -49,13 +49,13 @@ func globalBuildOptions(vbox *gui.Node) { grid.NewButton("git checkout default", func() { 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.NewButton("git checkout devel", func() { me.repos.View.ArgCheckoutDevel() }) - grid.NewLabel("guidevel,devel") + grid.NewLabel("guidevel,devel") // set the order of these in the config file ? grid.NextRow() 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 // 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 - 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) { ok := repo.Status.CheckoutBranch(targetName) if ok { @@ -122,17 +96,12 @@ func globalBuildOptions(vbox *gui.Node) { } repo.Scan() 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.NewButton("git fetch master & devel", func() { + + grid.NewGroup("update from upstream") + grid.NewButton("git fetch master & devel branches", func() { me.Disable() defer me.Enable() log.Warn("updating all master branches") diff --git a/globalDisplayOptions.go b/globalDisplayOptions.go index 56a3d8c..38d6431 100644 --- a/globalDisplayOptions.go +++ b/globalDisplayOptions.go @@ -71,7 +71,7 @@ func globalDisplayOptions(vbox *gui.Node) { }) var listallB *gui.Node - listallB = group1.NewButton("go.wit.com", func() { + listallB = group1.NewButton("Download Apps", func() { listallB.Disable() if me.lw == nil { me.lw = gowit.ListWindow(me.repos.View) diff --git a/repoview.go b/repoview.go index a9e7a19..e56c537 100644 --- a/repoview.go +++ b/repoview.go @@ -54,7 +54,7 @@ func makeRepoView() *repoWindow { log.Warn("Should I do something special here?") } - r.topbox = r.repoAllButtons() + r.topbox = r.repoMenu() 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) group1 := r.box.NewGroup("Run on all repos:")