make the buttons work
This commit is contained in:
parent
4484b0b84d
commit
d568d5dbe4
|
@ -16,13 +16,10 @@ type repoMergeWindow struct {
|
|||
mainBranchVersion *gadgets.OneLiner // the primary branch version
|
||||
develBranchVersion *gadgets.OneLiner // the devel branch version
|
||||
userBranchVersion *gadgets.OneLiner // the user branch version
|
||||
|
||||
currentVersion *gadgets.OneLiner // the devel branch version
|
||||
currentBranch *gadgets.OneLiner // the user branch version
|
||||
|
||||
//shelf *gui.Node // the first box in the stack, set as horizontal
|
||||
//grid *gui.Node // the list of available patches
|
||||
//setgrid *gui.Node // the list of each patchset
|
||||
mergeD *gui.Node // the merge button
|
||||
mergeM *gui.Node // the merge button
|
||||
}
|
||||
|
||||
// todo: autogenerate these or make them standared 'gui' package functions
|
||||
|
@ -70,6 +67,18 @@ func (w *repoMergeWindow) Update() {
|
|||
|
||||
w.currentBranch.SetText(w.repo.GetCurrentBranchName())
|
||||
w.currentVersion.SetText(w.repo.GetCurrentVersion())
|
||||
|
||||
if w.repo.GetCurrentBranchName() == w.repo.GetDevelBranchName() {
|
||||
w.mergeD.Enable()
|
||||
} else {
|
||||
w.mergeD.Disable()
|
||||
}
|
||||
|
||||
if w.repo.GetCurrentBranchName() == w.repo.GetMasterBranchName() {
|
||||
w.mergeM.Enable()
|
||||
} else {
|
||||
w.mergeM.Disable()
|
||||
}
|
||||
}
|
||||
|
||||
func (rs *RepoStatus) MakeRepoMergeWindow(repo *gitpb.Repo) *repoMergeWindow {
|
||||
|
@ -106,7 +115,7 @@ func (rs *RepoStatus) MakeRepoMergeWindow(repo *gitpb.Repo) *repoMergeWindow {
|
|||
w.repo.Reload()
|
||||
w.Update()
|
||||
})
|
||||
grid.NewButton("merge to devel", func() {
|
||||
w.mergeD = grid.NewButton("merge to devel", func() {
|
||||
log.Info("repo:", repo.GetGoPath())
|
||||
if result, err := repo.MergeToDevel(); err == nil {
|
||||
log.Warn("THINGS SEEM OK", repo.GetFullPath())
|
||||
|
@ -135,7 +144,7 @@ func (rs *RepoStatus) MakeRepoMergeWindow(repo *gitpb.Repo) *repoMergeWindow {
|
|||
w.repo.Reload()
|
||||
w.Update()
|
||||
})
|
||||
grid.NewButton("merge to master", func() {
|
||||
w.mergeM = grid.NewButton("merge to master", func() {
|
||||
log.Info("repo:", repo.GetGoPath())
|
||||
if result, err := repo.MergeToMaster(); err == nil {
|
||||
log.Warn("THINGS SEEM OK", repo.GetFullPath())
|
||||
|
|
Loading…
Reference in New Issue