summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/status_controller.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-23 18:47:29 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commitdb12853bbe825d69686ea71161497d1bbb120b8e (patch)
treeebfb066dfef8eb75acdc1ea2bd5f15ff4f4a6507 /pkg/gui/controllers/status_controller.go
parent711674f6cd68ed3a35e5b0329ff0cf3289fbc7d1 (diff)
lots of changes
Diffstat (limited to 'pkg/gui/controllers/status_controller.go')
-rw-r--r--pkg/gui/controllers/status_controller.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/pkg/gui/controllers/status_controller.go b/pkg/gui/controllers/status_controller.go
index a347fd9d4..f78a83321 100644
--- a/pkg/gui/controllers/status_controller.go
+++ b/pkg/gui/controllers/status_controller.go
@@ -16,17 +16,17 @@ import (
type StatusController struct {
baseController
- *controllerCommon
+ c *ControllerCommon
}
var _ types.IController = &StatusController{}
func NewStatusController(
- common *controllerCommon,
+ common *ControllerCommon,
) *StatusController {
return &StatusController{
- baseController: baseController{},
- controllerCommon: common,
+ baseController: baseController{},
+ c: common,
}
}
@@ -49,7 +49,7 @@ func (self *StatusController) GetKeybindings(opts types.KeybindingsOpts) []*type
},
{
Key: opts.GetKey(opts.Config.Status.RecentRepos),
- Handler: self.helpers.Repos.CreateRecentReposMenu,
+ Handler: self.c.Helpers().Repos.CreateRecentReposMenu,
Description: self.c.Tr.SwitchRepo,
},
{
@@ -96,7 +96,7 @@ func (self *StatusController) Context() types.Context {
func (self *StatusController) onClick() error {
// TODO: move into some abstraction (status is currently not a listViewContext where a lot of this code lives)
- currentBranch := self.helpers.Refs.GetCheckedOutRef()
+ currentBranch := self.c.Helpers().Refs.GetCheckedOutRef()
if currentBranch == nil {
// need to wait for branches to refresh
return nil
@@ -114,14 +114,14 @@ func (self *StatusController) onClick() error {
case enums.REBASE_MODE_REBASING, enums.REBASE_MODE_MERGING:
workingTreeStatus := fmt.Sprintf("(%s)", presentation.FormatWorkingTreeState(workingTreeState))
if cursorInSubstring(cx, upstreamStatus+" ", workingTreeStatus) {
- return self.helpers.MergeAndRebase.CreateRebaseOptionsMenu()
+ return self.c.Helpers().MergeAndRebase.CreateRebaseOptionsMenu()
}
if cursorInSubstring(cx, upstreamStatus+" "+workingTreeStatus+" ", repoName) {
- return self.helpers.Repos.CreateRecentReposMenu()
+ return self.c.Helpers().Repos.CreateRecentReposMenu()
}
default:
if cursorInSubstring(cx, upstreamStatus+" ", repoName) {
- return self.helpers.Repos.CreateRecentReposMenu()
+ return self.c.Helpers().Repos.CreateRecentReposMenu()
}
}
@@ -173,11 +173,11 @@ func (self *StatusController) askForConfigFile(action func(file string) error) e
}
func (self *StatusController) openConfig() error {
- return self.askForConfigFile(self.helpers.Files.OpenFile)
+ return self.askForConfigFile(self.c.Helpers().Files.OpenFile)
}
func (self *StatusController) editConfig() error {
- return self.askForConfigFile(self.helpers.Files.EditFile)
+ return self.askForConfigFile(self.c.Helpers().Files.EditFile)
}
func (self *StatusController) showAllBranchLogs() error {
@@ -194,5 +194,5 @@ func (self *StatusController) showAllBranchLogs() error {
}
func (self *StatusController) handleCheckForUpdate() error {
- return self.helpers.Update.CheckForUpdateInForeground()
+ return self.c.Helpers().Update.CheckForUpdateInForeground()
}