diff options
| author | Jeff Carr <[email protected]> | 2025-03-12 07:53:44 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-12 07:53:44 -0500 |
| commit | 4fd06bc1592abf1311de7bba631d857cc2bd1178 (patch) | |
| tree | effbfd231a79ef9767ca128d5566116720a3ea9e /doGui.go | |
| parent | ee521994021d7d09c0f90a4f479185cb888b6388 (diff) | |
remove the 'mode' concept
Diffstat (limited to 'doGui.go')
| -rw-r--r-- | doGui.go | 54 |
1 files changed, 22 insertions, 32 deletions
@@ -185,7 +185,7 @@ func drawWindow(win *gadgets.GenericWindow) { gridM := groupM.RawGrid() var releaseWin *gadgets.GenericWindow - me.modeReleaseW = gridM.NewButton("Release Window", func() { + gridM.NewButton("Release Window", func() { log.Info("todo: move releaser here") log.Info("for now, run guireleaser") if releaseWin != nil { @@ -194,24 +194,32 @@ func drawWindow(win *gadgets.GenericWindow) { } releaseWin = makeModeMasterWin() }) - me.modeReleaseW.Disable() - // the Devel / Patch mode window - var patchWin *patchesWindow - me.modePatchW = gridM.NewButton("Patch Window", func() { - if patchWin != nil { - patchWin.Toggle() + /* + // the Devel / Patch mode window + var patchWin *patchesWindow + gridM.NewButton("Patch Window", func() { + if patchWin != nil { + patchWin.Toggle() + return + } + patchWin = new(patchesWindow) + patchWin.initWindow() + patchWin.Show() + }) + */ + var patches *stdPatchsetTableWin + gridM.NewButton("Patch Window", func() { + if patches != nil { + patches.Toggle() return } - patchWin = new(patchesWindow) - patchWin.initWindow() - patchWin.Show() + patches = makePatchsetsWin() }) - me.modePatchW.Disable() // the user mode "hack Window" var hackWin *gadgets.GenericWindow - me.modeUserW = gridM.NewButton("Hack Window", func() { + gridM.NewButton("Hack Window", func() { if hackWin != nil { hackWin.Toggle() return @@ -228,15 +236,6 @@ func drawWindow(win *gadgets.GenericWindow) { reposWin = makeReposWin() }) - var patches *stdPatchsetTableWin - gridM.NewButton("New Patch Window", func() { - if patches != nil { - patches.Toggle() - return - } - patches = makePatchsetsWin() - }) - // set the initial button state based on the last // forge mode the user saved in the config file switch me.forge.Config.Mode { @@ -261,27 +260,19 @@ func forgeVerifyGuiState() { me.argvCheckoutDevel = false me.argvCheckoutMaster = false - me.modeReleaseW.Disable() - me.modePatchW.Disable() - me.modeUserW.Disable() - switch me.forge.Config.Mode { case forgepb.ForgeMode_MASTER: me.argvCheckoutMaster = true me.newBranch.SetText("master") - me.modeReleaseW.Enable() case forgepb.ForgeMode_DEVEL: me.argvCheckoutDevel = true me.newBranch.SetText("devel") - me.modePatchW.Enable() case forgepb.ForgeMode_USER: me.newBranch.SetText(me.forge.Config.GetUsername()) me.argvCheckoutUser = true - me.modeUserW.Enable() default: me.newBranch.SetText(me.forge.Config.GetUsername()) me.argvCheckoutUser = true - me.modeUserW.Enable() } } @@ -300,9 +291,9 @@ func forgeSwitchMode(newMode forgepb.ForgeMode) { me.forge.Config.ConfigSave() } +/* func doDisableUserW() { me.argvCheckoutUser = false - me.modeUserW.Disable() var count int all := me.forge.Repos.SortByFullPath() @@ -317,11 +308,10 @@ func doDisableUserW() { if count > 0 { s := fmt.Sprintf("git delete %d user branches", count) - me.modeUserW.SetLabel(s) - me.modeUserW.Enable() return } } +*/ // this is the magic that generates a window directly from the protocol buffer func makeStandardReposGrid(pb *gitpb.Repos) *gitpb.ReposTable { |
