diff options
| author | Jeff Carr <[email protected]> | 2024-02-16 17:55:53 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-16 17:55:53 -0600 |
| commit | c253a30fb61cdc956e1cefb8296e34bf74ddf90c (patch) | |
| tree | fc4b962a2e768866619acce615deaa99fd56dde9 /globalBuildOptions.go | |
| parent | bdb761714361a3986834b8b50bb34cce45d01e4d (diff) | |
changing branches works
Diffstat (limited to 'globalBuildOptions.go')
| -rw-r--r-- | globalBuildOptions.go | 69 |
1 files changed, 18 insertions, 51 deletions
diff --git a/globalBuildOptions.go b/globalBuildOptions.go index cc71e41..20b3eb4 100644 --- a/globalBuildOptions.go +++ b/globalBuildOptions.go @@ -56,11 +56,13 @@ func quickCmd(fullpath string, cmd []string) bool { func globalBuildOptions(vbox *gui.Node) { group1 := vbox.NewGroup("Global Build Options") - grid := group1.NewGrid("buildOptions", 2, 1) + grid := group1.NewGrid("buildOptions", 0, 0) // me.autoWorkingPwd = gadgets.NewOneLiner(grid, "working directory (pwd)") me.userHomePwd = gadgets.NewOneLiner(grid, "user home") + grid.NextRow() me.goSrcPwd = gadgets.NewOneLiner(grid, "go src home") + grid.NextRow() usr, _ := user.Current() homeDir, err := os.UserHomeDir() @@ -72,61 +74,26 @@ func globalBuildOptions(vbox *gui.Node) { srcDir := filepath.Join(homeDir, "go/src") me.goSrcPwd.SetText(srcDir) - me.mainBranch = gadgets.NewBasicCombobox(grid, "default main branch") - me.mainBranch.AddText("gitea server default") - me.mainBranch.Disable() - - me.develBranch = gadgets.NewBasicCombobox(grid, "default devel branch") - me.develBranch.AddText("devel") - me.develBranch.Disable() - - me.userBranch = gadgets.NewBasicCombobox(grid, "default user branch") - me.userBranch.AddText(usr.Username) - me.userBranch.Disable() - - var newBranch *gui.Node - var setBranchB *gui.Node - - // gadgets.OneLiner(grid, "default user branch") - // select the branch you want to test, build and develop against // 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 - setBranchB = grid.NewButton("set current branch to:", func() { - targetName := newBranch.String() - log.Warn("set current branch to:", targetName) - /* - me.toMoveToBranch = guiBranch.String() - setCurrentBranch.SetLabel("set all branches to " + me.toMoveToBranch) - me.mainBranch.Disable() - */ + me.setBranchB = grid.NewButton("set current branch to:", func() { + targetName := me.newBranch.String() + log.Warn("setting all branches to", targetName) for _, repo := range me.allrepos { - if targetName == "jcarr" { - if repo.status.CheckoutUser() { - log.Warn("set master branch worked", repo.String()) - repo.newScan() - } else { - log.Warn("set master branch failed", repo.String()) - repo.newScan() - } - } else { - if repo.status.CheckoutMaster() { - log.Warn("set master branch worked", repo.String()) - repo.newScan() - } else { - log.Warn("set master branch failed", repo.String()) - repo.newScan() - } - } + repo.status.CheckoutBranch(targetName) + repo.status.UpdateNew() + repo.newScan() } }) - newBranch = grid.NewCombobox() - newBranch.AddText("master") - newBranch.AddText("devel") - newBranch.AddText(usr.Username) - newBranch.SetText(usr.Username) - newBranch.Custom = func() { - setBranchB.SetLabel("set current branches to " + newBranch.String()) - } + me.newBranch = grid.NewCombobox() + me.newBranch.AddText("master") + me.newBranch.AddText("devel") + me.newBranch.AddText(usr.Username) + me.newBranch.SetText(usr.Username) + + // checking this will automatically make the branches off of devel + me.autoCreateBranches = grid.NewCheckbox("create if missing").SetChecked(true) + grid.NextRow() } |
