diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 26b42aba2..ebb31e17f 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -137,11 +137,11 @@ func (gui *Gui) handleGitFetch(g *gocui.Gui, v *gocui.View) error { } _ = gui.createErrorPanel(g, errMessage) if unamePassOpend { - _ = g.DeleteView("pushPassUname") + _ = g.DeleteView("credentials") } } else { if unamePassOpend { - _ = g.DeleteView("pushPassUname") + _ = g.DeleteView("credentials") } _ = gui.closeConfirmationPrompt(g) _ = gui.refreshCommits(g) diff --git a/pkg/gui/commit_message_panel.go b/pkg/gui/commit_message_panel.go index 85497ef87..7468ec941 100644 --- a/pkg/gui/commit_message_panel.go +++ b/pkg/gui/commit_message_panel.go @@ -53,23 +53,23 @@ func (gui *Gui) handleCommitFocused(g *gocui.Gui, v *gocui.View) error { type credentials chan string -// waitForPassUname wait for a username or password input from the pushPassUname popup +// waitForPassUname wait for a username or password input from the credentials popup func (gui *Gui) waitForPassUname(g *gocui.Gui, currentView *gocui.View, passOrUname string) string { gui.credentials = make(chan string) - pushPassUnameView, _ := g.View("pushPassUname") + credentialsView, _ := g.View("credentials") if passOrUname == "username" { - pushPassUnameView.Title = gui.Tr.SLocalize("PushUsername") - pushPassUnameView.Mask = 0 + credentialsView.Title = gui.Tr.SLocalize("PushUsername") + credentialsView.Mask = 0 } else { - pushPassUnameView.Title = gui.Tr.SLocalize("PushPassword") - pushPassUnameView.Mask = '*' + credentialsView.Title = gui.Tr.SLocalize("PushPassword") + credentialsView.Mask = '*' } g.Update(func(g *gocui.Gui) error { - _, err := g.SetViewOnTop("pushPassUname") + _, err := g.SetViewOnTop("credentials") if err != nil { return err } - err = gui.switchFocus(g, currentView, pushPassUnameView) + err = gui.switchFocus(g, currentView, credentialsView) if err != nil { return err } @@ -99,7 +99,7 @@ func (gui *Gui) handlePushConfirm(g *gocui.Gui, v *gocui.View) error { if err != nil { return err } - _, err = g.SetViewOnBottom("pushPassUname") + _, err = g.SetViewOnBottom("credentials") if err != nil { return err } @@ -111,7 +111,7 @@ func (gui *Gui) handlePushConfirm(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handlePushClose(g *gocui.Gui, v *gocui.View) error { - _, err := g.SetViewOnBottom("pushPassUname") + _, err := g.SetViewOnBottom("credentials") if err != nil { return err } @@ -120,7 +120,7 @@ func (gui *Gui) handlePushClose(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handlePushFocused(g *gocui.Gui, v *gocui.View) error { - if _, err := g.SetViewOnTop("pushPassUname"); err != nil { + if _, err := g.SetViewOnTop("credentials"); err != nil { return err } diff --git a/pkg/gui/confirmation_panel.go b/pkg/gui/confirmation_panel.go index 521bd827d..99455a30c 100644 --- a/pkg/gui/confirmation_panel.go +++ b/pkg/gui/confirmation_panel.go @@ -86,7 +86,7 @@ func (gui *Gui) prepareConfirmationPanel(currentView *gocui.View, title, prompt func (gui *Gui) onNewPopupPanel() { _, _ = gui.g.SetViewOnBottom("commitMessage") - _, _ = gui.g.SetViewOnBottom("pushPassUname") + _, _ = gui.g.SetViewOnBottom("credentials") } func (gui *Gui) createConfirmationPanel(g *gocui.Gui, currentView *gocui.View, title, prompt string, handleConfirm, handleClose func(*gocui.Gui, *gocui.View) error) error { diff --git a/pkg/gui/files_panel.go b/pkg/gui/files_panel.go index 127a0d96a..6e525e006 100644 --- a/pkg/gui/files_panel.go +++ b/pkg/gui/files_panel.go @@ -395,11 +395,11 @@ func (gui *Gui) pullFiles(g *gocui.Gui, v *gocui.View) error { } _ = gui.createErrorPanel(g, errMessage) if unamePassOpend { - _ = g.DeleteView("pushPassUname") + _ = g.DeleteView("credentials") } } else { if unamePassOpend { - _ = g.DeleteView("pushPassUname") + _ = g.DeleteView("credentials") } _ = gui.closeConfirmationPrompt(g) _ = gui.refreshCommits(g) @@ -428,11 +428,11 @@ func (gui *Gui) pushWithForceFlag(g *gocui.Gui, v *gocui.View, force bool) error } _ = gui.createErrorPanel(g, errMessage) if unamePassOpend { - _ = g.DeleteView("pushPassUname") + _ = g.DeleteView("credentials") } } else { if unamePassOpend { - _ = g.DeleteView("pushPassUname") + _ = g.DeleteView("credentials") } _ = gui.closeConfirmationPrompt(g) _ = gui.refreshSidePanels(g) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index f9cf16475..33a8cdc43 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -341,20 +341,20 @@ func (gui *Gui) layout(g *gocui.Gui) error { } } - if check, _ := g.View("pushPassUname"); check == nil { + if check, _ := g.View("credentials"); check == nil { // doesn't matter where this view starts because it will be hidden - if pushPassUnameView, err := g.SetView("pushPassUname", 0, 0, width/2, height/2, 0); err != nil { + if credentialsView, err := g.SetView("credentials", 0, 0, width/2, height/2, 0); err != nil { if err != gocui.ErrUnknownView { return err } - _, err := g.SetViewOnBottom("pushPassUname") + _, err := g.SetViewOnBottom("credentials") if err != nil { return err } - pushPassUnameView.Title = gui.Tr.SLocalize("PushUsername") - pushPassUnameView.FgColor = gocui.ColorWhite - pushPassUnameView.Editable = true - pushPassUnameView.Editor = gocui.EditorFunc(gui.simpleEditor) + credentialsView.Title = gui.Tr.SLocalize("PushUsername") + credentialsView.FgColor = gocui.ColorWhite + credentialsView.Editable = true + credentialsView.Editor = gocui.EditorFunc(gui.simpleEditor) } } diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 978f6dcdf..1823c2955 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -394,12 +394,12 @@ func (gui *Gui) GetKeybindings() []*Binding { Modifier: gocui.ModNone, Handler: gui.handleCommitClose, }, { - ViewName: "pushPassUname", + ViewName: "credentials", Key: gocui.KeyEnter, Modifier: gocui.ModNone, Handler: gui.handlePushConfirm, }, { - ViewName: "pushPassUname", + ViewName: "credentials", Key: gocui.KeyEsc, Modifier: gocui.ModNone, Handler: gui.handlePushClose, diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 8ed764c6f..1046fb32e 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -101,7 +101,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error { return nil case "commitMessage": return gui.handleCommitFocused(g, v) - case "pushPassUname": + case "credentials": return gui.handlePushFocused(g, v) case "main": // TODO: pull this out into a 'view focused' function @@ -303,7 +303,7 @@ func (gui *Gui) currentViewName(g *gocui.Gui) string { func (gui *Gui) resizeCurrentPopupPanel(g *gocui.Gui) error { v := g.CurrentView() - if v.Name() == "commitMessage" || v.Name() == "pushPassUname" || v.Name() == "confirmation" { + if v.Name() == "commitMessage" || v.Name() == "credentials" || v.Name() == "confirmation" { return gui.resizePopupPanel(g, v) } return nil