summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go21
1 files changed, 7 insertions, 14 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index fa2b3e256..c11820ec6 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -124,7 +124,7 @@ type Gui struct {
suggestionsAsyncHandler *tasks.AsyncHandler
- PopupHandler popup.IPopupHandler
+ PopupHandler types.IPopupHandler
IsNewRepo bool
@@ -143,7 +143,7 @@ type Gui struct {
PrevLayout PrevLayout
- c *controllers.ControllerCommon
+ c *types.ControllerCommon
refHelper *RefHelper
suggestionsHelper *SuggestionsHelper
fileHelper *FileHelper
@@ -189,7 +189,7 @@ type GuiRepoState struct {
// Suggestions will sometimes appear when typing into a prompt
Suggestions []*types.Suggestion
- MenuItems []*popup.MenuItem
+ MenuItems []*types.MenuItem
BisectInfo *git_commands.BisectInfo
Updating bool
Panels *panelStates
@@ -284,10 +284,6 @@ type remoteBranchesState struct {
listPanelState
}
-type tagsPanelState struct {
- listPanelState
-}
-
type commitPanelState struct {
listPanelState
@@ -336,7 +332,6 @@ type panelStates struct {
Branches *branchPanelState
Remotes *remotePanelState
RemoteBranches *remoteBranchesState
- Tags *tagsPanelState
Commits *commitPanelState
ReflogCommits *reflogCommitPanelState
SubCommits *subCommitPanelState
@@ -453,7 +448,6 @@ func (gui *Gui) resetState(filterPath string, reuseState bool) {
Branches: &branchPanelState{listPanelState{SelectedLineIdx: 0}},
Remotes: &remotePanelState{listPanelState{SelectedLineIdx: 0}},
RemoteBranches: &remoteBranchesState{listPanelState{SelectedLineIdx: -1}},
- Tags: &tagsPanelState{listPanelState{SelectedLineIdx: -1}},
Commits: &commitPanelState{listPanelState: listPanelState{SelectedLineIdx: 0}, LimitCommits: true},
ReflogCommits: &reflogCommitPanelState{listPanelState{SelectedLineIdx: 0}},
SubCommits: &subCommitPanelState{listPanelState: listPanelState{SelectedLineIdx: 0}, refName: ""},
@@ -557,7 +551,7 @@ func NewGui(
)
guiCommon := &guiCommon{gui: gui, IPopupHandler: gui.PopupHandler}
- controllerCommon := &controllers.ControllerCommon{IGuiCommon: guiCommon, Common: cmn}
+ controllerCommon := &types.ControllerCommon{IGuiCommon: guiCommon, Common: cmn}
// storing this stuff on the gui for now to ease refactoring
// TODO: reset these controllers upon changing repos due to state changing
@@ -589,12 +583,11 @@ func (gui *Gui) setControllers() {
tagsController := controllers.NewTagsController(
controllerCommon,
- func() types.IListContext { return gui.State.Contexts.Tags },
+ func() *context.TagsContext { return gui.State.Contexts.Tags },
gui.git,
getContexts,
refHelper,
gui.suggestionsHelper,
- gui.getSelectedTag,
gui.switchToSubCommitsContext,
)
@@ -921,7 +914,7 @@ func (gui *Gui) showIntroPopupMessage(done chan struct{}) error {
return gui.c.SaveAppState()
}
- return gui.c.Ask(popup.AskOpts{
+ return gui.c.Ask(types.AskOpts{
Title: "",
Prompt: gui.c.Tr.IntroPopupMessage,
HandleConfirm: onConfirm,
@@ -956,7 +949,7 @@ func (gui *Gui) startBackgroundFetch() {
}
err := gui.backgroundFetch()
if err != nil && strings.Contains(err.Error(), "exit status 128") && isNew {
- _ = gui.c.Ask(popup.AskOpts{
+ _ = gui.c.Ask(types.AskOpts{
Title: gui.c.Tr.NoAutomaticGitFetchTitle,
Prompt: gui.c.Tr.NoAutomaticGitFetchBody,
})