summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-30 10:17:55 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-17 19:13:40 +1100
commit77d0732fa81baad97dff7d2e5abd3fa6f6c9cda1 (patch)
tree9745a9e9deffc380247214e1eac7f4693e685088 /pkg/gui/gui.go
parent51547e38227b2443de955f4d17d46429039cf9f1 (diff)
add actions abstraction
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go25
1 files changed, 12 insertions, 13 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index c11820ec6..6796d16de 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -581,15 +581,7 @@ func (gui *Gui) setControllers() {
gui.fileHelper = NewFileHelper(controllerCommon, gui.git, osCommand)
gui.workingTreeHelper = NewWorkingTreeHelper(func() *filetree.FileTreeViewModel { return gui.State.FileTreeViewModel })
- tagsController := controllers.NewTagsController(
- controllerCommon,
- func() *context.TagsContext { return gui.State.Contexts.Tags },
- gui.git,
- getContexts,
- refHelper,
- gui.suggestionsHelper,
- gui.switchToSubCommitsContext,
- )
+ tagActions := controllers.NewTagActions(controllerCommon, gui.git)
syncController := controllers.NewSyncController(
controllerCommon,
@@ -629,20 +621,28 @@ func (gui *Gui) setControllers() {
gui.fileHelper,
gui.workingTreeHelper,
),
- Tags: tagsController,
-
+ Tags: controllers.NewTagsController(
+ controllerCommon,
+ func() *context.TagsContext { return gui.State.Contexts.Tags },
+ gui.git,
+ getContexts,
+ tagActions,
+ refHelper,
+ gui.suggestionsHelper,
+ gui.switchToSubCommitsContext,
+ ),
LocalCommits: controllers.NewLocalCommitsController(
controllerCommon,
func() types.IListContext { return gui.State.Contexts.BranchCommits },
osCommand,
gui.git,
+ tagActions,
refHelper,
gui.getSelectedLocalCommit,
func() []*models.Commit { return gui.State.Commits },
func() int { return gui.State.Panels.Commits.SelectedLineIdx },
gui.checkMergeOrRebase,
syncController.HandlePull,
- tagsController.CreateTagMenu,
gui.getHostingServiceMgr,
gui.SwitchToCommitFilesContext,
gui.handleOpenSearch,
@@ -651,7 +651,6 @@ func (gui *Gui) setControllers() {
func() bool { return gui.ShowWholeGitGraph },
func(value bool) { gui.ShowWholeGitGraph = value },
),
-
Remotes: controllers.NewRemotesController(
controllerCommon,
func() types.IListContext { return gui.State.Contexts.Remotes },