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.go33
1 files changed, 13 insertions, 20 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 511406e77..061c6e7ec 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -86,7 +86,6 @@ type Gui struct {
Config config.AppConfigurer
Updater *updates.Updater
statusManager *statusManager
- credentials credentials
waitForIntro sync.WaitGroup
fileWatcher *fileWatcher
viewBufferManagerMap map[string]*tasks.ViewBufferManager
@@ -247,7 +246,6 @@ type Views struct {
Options *gocui.View
Confirmation *gocui.View
Menu *gocui.View
- Credentials *gocui.View
CommitMessage *gocui.View
CommitFiles *gocui.View
Information *gocui.View
@@ -403,7 +401,6 @@ func initialViewContextMapping(contextTree *context.ContextTree) map[string]type
"stash": contextTree.Stash,
"menu": contextTree.Menu,
"confirmation": contextTree.Confirmation,
- "credentials": contextTree.Credentials,
"commitMessage": contextTree.CommitMessage,
"main": contextTree.Normal,
"secondary": contextTree.Normal,
@@ -448,17 +445,6 @@ func NewGui(
InitialDir: initialDir,
}
- guiIO := oscommands.NewGuiIO(
- cmn.Log,
- gui.LogCommand,
- gui.getCmdWriter,
- gui.promptUserForCredential,
- )
-
- osCommand := oscommands.NewOSCommand(cmn, oscommands.GetPlatform(), guiIO)
-
- gui.os = osCommand
-
gui.watchFilesForChanges()
gui.PopupHandler = popup.NewPopupHandler(
@@ -475,6 +461,19 @@ func NewGui(
guiCommon := &guiCommon{gui: gui, IPopupHandler: gui.PopupHandler}
helperCommon := &types.HelperCommon{IGuiCommon: guiCommon, Common: cmn}
+ credentialsHelper := helpers.NewCredentialsHelper(helperCommon)
+
+ guiIO := oscommands.NewGuiIO(
+ cmn.Log,
+ gui.LogCommand,
+ gui.getCmdWriter,
+ credentialsHelper.PromptUserForCredential,
+ )
+
+ osCommand := oscommands.NewOSCommand(cmn, oscommands.GetPlatform(), guiIO)
+
+ gui.os = osCommand
+
// storing this stuff on the gui for now to ease refactoring
// TODO: reset these controllers upon changing repos due to state changing
gui.c = helperCommon
@@ -751,7 +750,6 @@ func (gui *Gui) createAllViews() error {
{viewPtr: &gui.Views.Search, name: "search"},
{viewPtr: &gui.Views.SearchPrefix, name: "searchPrefix"},
{viewPtr: &gui.Views.CommitMessage, name: "commitMessage"},
- {viewPtr: &gui.Views.Credentials, name: "credentials"},
{viewPtr: &gui.Views.Menu, name: "menu"},
{viewPtr: &gui.Views.Suggestions, name: "suggestions"},
{viewPtr: &gui.Views.Confirmation, name: "confirmation"},
@@ -825,11 +823,6 @@ func (gui *Gui) createAllViews() error {
gui.Views.Confirmation.Visible = false
- gui.Views.Credentials.Visible = false
- gui.Views.Credentials.Title = gui.c.Tr.CredentialsUsername
- gui.Views.Credentials.FgColor = theme.GocuiDefaultTextColor
- gui.Views.Credentials.Editable = true
-
gui.Views.Suggestions.Visible = false
gui.Views.Menu.Visible = false