summaryrefslogtreecommitdiff
path: root/doGui.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-07-07 19:58:34 -0500
committerJeff Carr <[email protected]>2025-07-07 19:58:34 -0500
commitd3938adf63247cb7393be427f7f5f67d90b4c3b2 (patch)
tree346440760fa7d702f7fcb014af50260e1df6bd02 /doGui.go
parent08b7f2406ccfc5c249c5fb59e9229e37d40fdb4d (diff)
deprecate the "forge mode" concept
unfortunately, this was a bad idea. boo I wasted lots of time on this. live and learn
Diffstat (limited to 'doGui.go')
-rw-r--r--doGui.go104
1 files changed, 0 insertions, 104 deletions
diff --git a/doGui.go b/doGui.go
index d380f6c..fc92115 100644
--- a/doGui.go
+++ b/doGui.go
@@ -209,109 +209,6 @@ func drawWindow(win *gadgets.GenericWindow) {
gridM.NextRow()
gridM.NewLabel("")
-
- group1 := win.Stack.NewGroup("Forge Mode (deprecated)")
- grid = group1.RawGrid()
- me.forgeMode = grid.NewLabel("")
- me.forgeMode.SetText(me.forge.GetMode())
-
- me.newBranch = grid.NewDropdown()
- me.newBranch.AddText("master")
- me.newBranch.AddText("devel")
- me.newBranch.AddText(me.forge.Config.GetUsername())
- me.newBranch.Custom = func() {
- me.setBranchB.Disable()
- // toggle global values shared by the command line and the gui for doCheckout()
- switch me.newBranch.String() {
- case "master":
- if me.forge.Config.Mode != forgepb.ForgeMode_MASTER {
- me.setBranchB.Enable()
- }
- case "devel":
- if me.forge.Config.Mode != forgepb.ForgeMode_DEVEL {
- me.setBranchB.Enable()
- }
- default:
- if me.forge.Config.Mode != forgepb.ForgeMode_USER {
- me.setBranchB.Enable()
- }
- }
- }
-
- // 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
- me.setBranchB = grid.NewButton("Switch mode", func() {
- win.Disable()
- defer win.Enable()
-
- switch me.newBranch.String() {
- case "master":
- forgeSwitchMode(forgepb.ForgeMode_MASTER)
- case "devel":
- forgeSwitchMode(forgepb.ForgeMode_DEVEL)
- default:
- forgeSwitchMode(forgepb.ForgeMode_USER)
- }
-
- me.setBranchB.Disable()
- })
- me.setBranchB.Disable()
-
- // set the initial button state based on the last
- // forge mode the user saved in the config file
- switch me.forge.Config.Mode {
- case forgepb.ForgeMode_MASTER:
- me.newBranch.SetText("master")
- case forgepb.ForgeMode_DEVEL:
- me.newBranch.SetText("devel")
- case forgepb.ForgeMode_USER:
- me.newBranch.SetText(me.forge.Config.GetUsername())
- default:
- me.newBranch.SetText(me.forge.Config.GetUsername())
- }
-
- forgeSwitchMode(me.forge.Config.Mode)
-}
-
-// verify the GUI button disable/enable settings
-func forgeVerifyGuiState() {
- me.forgeMode.SetText(me.forge.GetMode())
-
- me.argvCheckoutUser = false
- me.argvCheckoutDevel = false
- me.argvCheckoutMaster = false
-
- switch me.forge.Config.Mode {
- case forgepb.ForgeMode_MASTER:
- me.argvCheckoutMaster = true
- me.newBranch.SetText("master")
- case forgepb.ForgeMode_DEVEL:
- me.argvCheckoutDevel = true
- me.newBranch.SetText("devel")
- case forgepb.ForgeMode_USER:
- me.newBranch.SetText(me.forge.Config.GetUsername())
- me.argvCheckoutUser = true
- default:
- me.newBranch.SetText(me.forge.Config.GetUsername())
- me.argvCheckoutUser = true
- }
-}
-
-// sets the text in the labels in the window
-// and hides and shows the buttons
-func forgeSwitchMode(newMode forgepb.ForgeMode) {
- if newMode == me.forge.Config.Mode {
- log.Info("you are already on", newMode.String())
- forgeVerifyGuiState() // doing this here initializes the button state
- return
- }
-
- me.forge.Config.Mode = newMode
- forgeVerifyGuiState() // update the button states
-
- me.forge.Config.ConfigSave()
}
// this is the magic that generates a window directly from the protocol buffer
@@ -359,7 +256,6 @@ func findMergeToDevel() *gitpb.Repos {
found := gitpb.NewRepos()
for repo := range me.forge.Repos.IterByFullPath() {
-
// this sees if user has patches for devel. If it does, add it to found
if repo.CountDiffObjects(repo.GetUserBranchName(), repo.GetDevelBranchName()) > 0 {
found.AppendByGoPath(repo)