mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-09 13:47:11 +02:00
Changed pushPassUname name to credentials
This commit is contained in:
parent
3c17bf761a
commit
61c2778de1
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user