remove the 'mode' concept
This commit is contained in:
parent
ee52199402
commit
4fd06bc159
54
doGui.go
54
doGui.go
|
@ -185,7 +185,7 @@ func drawWindow(win *gadgets.GenericWindow) {
|
||||||
gridM := groupM.RawGrid()
|
gridM := groupM.RawGrid()
|
||||||
|
|
||||||
var releaseWin *gadgets.GenericWindow
|
var releaseWin *gadgets.GenericWindow
|
||||||
me.modeReleaseW = gridM.NewButton("Release Window", func() {
|
gridM.NewButton("Release Window", func() {
|
||||||
log.Info("todo: move releaser here")
|
log.Info("todo: move releaser here")
|
||||||
log.Info("for now, run guireleaser")
|
log.Info("for now, run guireleaser")
|
||||||
if releaseWin != nil {
|
if releaseWin != nil {
|
||||||
|
@ -194,24 +194,32 @@ func drawWindow(win *gadgets.GenericWindow) {
|
||||||
}
|
}
|
||||||
releaseWin = makeModeMasterWin()
|
releaseWin = makeModeMasterWin()
|
||||||
})
|
})
|
||||||
me.modeReleaseW.Disable()
|
|
||||||
|
|
||||||
// the Devel / Patch mode window
|
/*
|
||||||
var patchWin *patchesWindow
|
// the Devel / Patch mode window
|
||||||
me.modePatchW = gridM.NewButton("Patch Window", func() {
|
var patchWin *patchesWindow
|
||||||
if patchWin != nil {
|
gridM.NewButton("Patch Window", func() {
|
||||||
patchWin.Toggle()
|
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
|
return
|
||||||
}
|
}
|
||||||
patchWin = new(patchesWindow)
|
patches = makePatchsetsWin()
|
||||||
patchWin.initWindow()
|
|
||||||
patchWin.Show()
|
|
||||||
})
|
})
|
||||||
me.modePatchW.Disable()
|
|
||||||
|
|
||||||
// the user mode "hack Window"
|
// the user mode "hack Window"
|
||||||
var hackWin *gadgets.GenericWindow
|
var hackWin *gadgets.GenericWindow
|
||||||
me.modeUserW = gridM.NewButton("Hack Window", func() {
|
gridM.NewButton("Hack Window", func() {
|
||||||
if hackWin != nil {
|
if hackWin != nil {
|
||||||
hackWin.Toggle()
|
hackWin.Toggle()
|
||||||
return
|
return
|
||||||
|
@ -228,15 +236,6 @@ func drawWindow(win *gadgets.GenericWindow) {
|
||||||
reposWin = makeReposWin()
|
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
|
// set the initial button state based on the last
|
||||||
// forge mode the user saved in the config file
|
// forge mode the user saved in the config file
|
||||||
switch me.forge.Config.Mode {
|
switch me.forge.Config.Mode {
|
||||||
|
@ -261,27 +260,19 @@ func forgeVerifyGuiState() {
|
||||||
me.argvCheckoutDevel = false
|
me.argvCheckoutDevel = false
|
||||||
me.argvCheckoutMaster = false
|
me.argvCheckoutMaster = false
|
||||||
|
|
||||||
me.modeReleaseW.Disable()
|
|
||||||
me.modePatchW.Disable()
|
|
||||||
me.modeUserW.Disable()
|
|
||||||
|
|
||||||
switch me.forge.Config.Mode {
|
switch me.forge.Config.Mode {
|
||||||
case forgepb.ForgeMode_MASTER:
|
case forgepb.ForgeMode_MASTER:
|
||||||
me.argvCheckoutMaster = true
|
me.argvCheckoutMaster = true
|
||||||
me.newBranch.SetText("master")
|
me.newBranch.SetText("master")
|
||||||
me.modeReleaseW.Enable()
|
|
||||||
case forgepb.ForgeMode_DEVEL:
|
case forgepb.ForgeMode_DEVEL:
|
||||||
me.argvCheckoutDevel = true
|
me.argvCheckoutDevel = true
|
||||||
me.newBranch.SetText("devel")
|
me.newBranch.SetText("devel")
|
||||||
me.modePatchW.Enable()
|
|
||||||
case forgepb.ForgeMode_USER:
|
case forgepb.ForgeMode_USER:
|
||||||
me.newBranch.SetText(me.forge.Config.GetUsername())
|
me.newBranch.SetText(me.forge.Config.GetUsername())
|
||||||
me.argvCheckoutUser = true
|
me.argvCheckoutUser = true
|
||||||
me.modeUserW.Enable()
|
|
||||||
default:
|
default:
|
||||||
me.newBranch.SetText(me.forge.Config.GetUsername())
|
me.newBranch.SetText(me.forge.Config.GetUsername())
|
||||||
me.argvCheckoutUser = true
|
me.argvCheckoutUser = true
|
||||||
me.modeUserW.Enable()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,9 +291,9 @@ func forgeSwitchMode(newMode forgepb.ForgeMode) {
|
||||||
me.forge.Config.ConfigSave()
|
me.forge.Config.ConfigSave()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func doDisableUserW() {
|
func doDisableUserW() {
|
||||||
me.argvCheckoutUser = false
|
me.argvCheckoutUser = false
|
||||||
me.modeUserW.Disable()
|
|
||||||
|
|
||||||
var count int
|
var count int
|
||||||
all := me.forge.Repos.SortByFullPath()
|
all := me.forge.Repos.SortByFullPath()
|
||||||
|
@ -317,11 +308,10 @@ func doDisableUserW() {
|
||||||
|
|
||||||
if count > 0 {
|
if count > 0 {
|
||||||
s := fmt.Sprintf("git delete %d user branches", count)
|
s := fmt.Sprintf("git delete %d user branches", count)
|
||||||
me.modeUserW.SetLabel(s)
|
|
||||||
me.modeUserW.Enable()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// this is the magic that generates a window directly from the protocol buffer
|
// this is the magic that generates a window directly from the protocol buffer
|
||||||
func makeStandardReposGrid(pb *gitpb.Repos) *gitpb.ReposTable {
|
func makeStandardReposGrid(pb *gitpb.Repos) *gitpb.ReposTable {
|
||||||
|
|
|
@ -67,9 +67,9 @@ type mainType struct {
|
||||||
repoDevelMergeB *gui.Node // "merge to devel" repos button
|
repoDevelMergeB *gui.Node // "merge to devel" repos button
|
||||||
repoWritableB *gui.Node // "what repos are writable" repos button
|
repoWritableB *gui.Node // "what repos are writable" repos button
|
||||||
demoB *gui.Node // opens the demo
|
demoB *gui.Node // opens the demo
|
||||||
modeReleaseW *gui.Node // opens the release window
|
// modeReleaseW *gui.Node // opens the release window
|
||||||
modePatchW *gui.Node // opens the patch window
|
// modePatchW *gui.Node // opens the patch window
|
||||||
modeUserW *gui.Node // opens the user/hack window
|
// modeUserW *gui.Node // opens the user/hack window
|
||||||
|
|
||||||
argvCheckoutUser bool // shared between the GUI and the command line tools
|
argvCheckoutUser bool // shared between the GUI and the command line tools
|
||||||
argvCheckoutDevel bool // shared between the GUI and the command line tools
|
argvCheckoutDevel bool // shared between the GUI and the command line tools
|
||||||
|
|
Loading…
Reference in New Issue