mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-25 00:46:54 +02:00
Changed pushPassUname name to credentials
This commit is contained in:
@ -137,11 +137,11 @@ func (gui *Gui) handleGitFetch(g *gocui.Gui, v *gocui.View) error {
|
|||||||
}
|
}
|
||||||
_ = gui.createErrorPanel(g, errMessage)
|
_ = gui.createErrorPanel(g, errMessage)
|
||||||
if unamePassOpend {
|
if unamePassOpend {
|
||||||
_ = g.DeleteView("pushPassUname")
|
_ = g.DeleteView("credentials")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if unamePassOpend {
|
if unamePassOpend {
|
||||||
_ = g.DeleteView("pushPassUname")
|
_ = g.DeleteView("credentials")
|
||||||
}
|
}
|
||||||
_ = gui.closeConfirmationPrompt(g)
|
_ = gui.closeConfirmationPrompt(g)
|
||||||
_ = gui.refreshCommits(g)
|
_ = gui.refreshCommits(g)
|
||||||
|
@ -53,23 +53,23 @@ func (gui *Gui) handleCommitFocused(g *gocui.Gui, v *gocui.View) error {
|
|||||||
|
|
||||||
type credentials chan string
|
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 {
|
func (gui *Gui) waitForPassUname(g *gocui.Gui, currentView *gocui.View, passOrUname string) string {
|
||||||
gui.credentials = make(chan string)
|
gui.credentials = make(chan string)
|
||||||
pushPassUnameView, _ := g.View("pushPassUname")
|
credentialsView, _ := g.View("credentials")
|
||||||
if passOrUname == "username" {
|
if passOrUname == "username" {
|
||||||
pushPassUnameView.Title = gui.Tr.SLocalize("PushUsername")
|
credentialsView.Title = gui.Tr.SLocalize("PushUsername")
|
||||||
pushPassUnameView.Mask = 0
|
credentialsView.Mask = 0
|
||||||
} else {
|
} else {
|
||||||
pushPassUnameView.Title = gui.Tr.SLocalize("PushPassword")
|
credentialsView.Title = gui.Tr.SLocalize("PushPassword")
|
||||||
pushPassUnameView.Mask = '*'
|
credentialsView.Mask = '*'
|
||||||
}
|
}
|
||||||
g.Update(func(g *gocui.Gui) error {
|
g.Update(func(g *gocui.Gui) error {
|
||||||
_, err := g.SetViewOnTop("pushPassUname")
|
_, err := g.SetViewOnTop("credentials")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = gui.switchFocus(g, currentView, pushPassUnameView)
|
err = gui.switchFocus(g, currentView, credentialsView)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ func (gui *Gui) handlePushConfirm(g *gocui.Gui, v *gocui.View) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_, err = g.SetViewOnBottom("pushPassUname")
|
_, err = g.SetViewOnBottom("credentials")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
func (gui *Gui) handlePushClose(g *gocui.Gui, v *gocui.View) error {
|
||||||
_, err := g.SetViewOnBottom("pushPassUname")
|
_, err := g.SetViewOnBottom("credentials")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ func (gui *Gui) prepareConfirmationPanel(currentView *gocui.View, title, prompt
|
|||||||
|
|
||||||
func (gui *Gui) onNewPopupPanel() {
|
func (gui *Gui) onNewPopupPanel() {
|
||||||
_, _ = gui.g.SetViewOnBottom("commitMessage")
|
_, _ = 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 {
|
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)
|
_ = gui.createErrorPanel(g, errMessage)
|
||||||
if unamePassOpend {
|
if unamePassOpend {
|
||||||
_ = g.DeleteView("pushPassUname")
|
_ = g.DeleteView("credentials")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if unamePassOpend {
|
if unamePassOpend {
|
||||||
_ = g.DeleteView("pushPassUname")
|
_ = g.DeleteView("credentials")
|
||||||
}
|
}
|
||||||
_ = gui.closeConfirmationPrompt(g)
|
_ = gui.closeConfirmationPrompt(g)
|
||||||
_ = gui.refreshCommits(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)
|
_ = gui.createErrorPanel(g, errMessage)
|
||||||
if unamePassOpend {
|
if unamePassOpend {
|
||||||
_ = g.DeleteView("pushPassUname")
|
_ = g.DeleteView("credentials")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if unamePassOpend {
|
if unamePassOpend {
|
||||||
_ = g.DeleteView("pushPassUname")
|
_ = g.DeleteView("credentials")
|
||||||
}
|
}
|
||||||
_ = gui.closeConfirmationPrompt(g)
|
_ = gui.closeConfirmationPrompt(g)
|
||||||
_ = gui.refreshSidePanels(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
|
// 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 {
|
if err != gocui.ErrUnknownView {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_, err := g.SetViewOnBottom("pushPassUname")
|
_, err := g.SetViewOnBottom("credentials")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
pushPassUnameView.Title = gui.Tr.SLocalize("PushUsername")
|
credentialsView.Title = gui.Tr.SLocalize("PushUsername")
|
||||||
pushPassUnameView.FgColor = gocui.ColorWhite
|
credentialsView.FgColor = gocui.ColorWhite
|
||||||
pushPassUnameView.Editable = true
|
credentialsView.Editable = true
|
||||||
pushPassUnameView.Editor = gocui.EditorFunc(gui.simpleEditor)
|
credentialsView.Editor = gocui.EditorFunc(gui.simpleEditor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,12 +394,12 @@ func (gui *Gui) GetKeybindings() []*Binding {
|
|||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handleCommitClose,
|
Handler: gui.handleCommitClose,
|
||||||
}, {
|
}, {
|
||||||
ViewName: "pushPassUname",
|
ViewName: "credentials",
|
||||||
Key: gocui.KeyEnter,
|
Key: gocui.KeyEnter,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handlePushConfirm,
|
Handler: gui.handlePushConfirm,
|
||||||
}, {
|
}, {
|
||||||
ViewName: "pushPassUname",
|
ViewName: "credentials",
|
||||||
Key: gocui.KeyEsc,
|
Key: gocui.KeyEsc,
|
||||||
Modifier: gocui.ModNone,
|
Modifier: gocui.ModNone,
|
||||||
Handler: gui.handlePushClose,
|
Handler: gui.handlePushClose,
|
||||||
|
@ -101,7 +101,7 @@ func (gui *Gui) newLineFocused(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return nil
|
return nil
|
||||||
case "commitMessage":
|
case "commitMessage":
|
||||||
return gui.handleCommitFocused(g, v)
|
return gui.handleCommitFocused(g, v)
|
||||||
case "pushPassUname":
|
case "credentials":
|
||||||
return gui.handlePushFocused(g, v)
|
return gui.handlePushFocused(g, v)
|
||||||
case "main":
|
case "main":
|
||||||
// TODO: pull this out into a 'view focused' function
|
// 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 {
|
func (gui *Gui) resizeCurrentPopupPanel(g *gocui.Gui) error {
|
||||||
v := g.CurrentView()
|
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 gui.resizePopupPanel(g, v)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Reference in New Issue
Block a user