diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-16 14:46:53 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | 1dd7307fde033dae5fececac15810a99e26c3d91 (patch) | |
tree | 4e851c9e3229a6fe3b4191f6311d05d7a9142960 /pkg/gui/credentials_panel.go | |
parent | a90b6efded49abcfa2516db794d7875b0396f558 (diff) |
start moving commit panel handlers into controller
more
and more
move rebase commit refreshing into existing abstraction
and more
and more
WIP
and more
handling clicks
properly fix merge conflicts
update cheatsheet
lots more preparation to start moving things into controllers
WIP
better typing
expand on remotes controller
moving more code into controllers
Diffstat (limited to 'pkg/gui/credentials_panel.go')
-rw-r--r-- | pkg/gui/credentials_panel.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/pkg/gui/credentials_panel.go b/pkg/gui/credentials_panel.go index b7981338d..796aa70c6 100644 --- a/pkg/gui/credentials_panel.go +++ b/pkg/gui/credentials_panel.go @@ -17,21 +17,20 @@ func (gui *Gui) promptUserForCredential(passOrUname oscommands.CredentialType) s credentialsView := gui.Views.Credentials switch passOrUname { case oscommands.Username: - credentialsView.Title = gui.Tr.CredentialsUsername + credentialsView.Title = gui.c.Tr.CredentialsUsername credentialsView.Mask = 0 case oscommands.Password: - credentialsView.Title = gui.Tr.CredentialsPassword + credentialsView.Title = gui.c.Tr.CredentialsPassword credentialsView.Mask = '*' case oscommands.Passphrase: - credentialsView.Title = gui.Tr.CredentialsPassphrase + credentialsView.Title = gui.c.Tr.CredentialsPassphrase credentialsView.Mask = '*' } - if err := gui.pushContext(gui.State.Contexts.Credentials); err != nil { + if err := gui.c.PushContext(gui.State.Contexts.Credentials); err != nil { return err } - gui.RenderCommitLength() return nil }) @@ -49,7 +48,7 @@ func (gui *Gui) handleSubmitCredential() error { return err } - return gui.refreshSidePanels(types.RefreshOptions{Mode: types.ASYNC}) + return gui.c.Refresh(types.RefreshOptions{Mode: types.ASYNC}) } func (gui *Gui) handleCloseCredentialsView() error { @@ -59,10 +58,10 @@ func (gui *Gui) handleCloseCredentialsView() error { } func (gui *Gui) handleAskFocused() error { - keybindingConfig := gui.UserConfig.Keybinding + keybindingConfig := gui.c.UserConfig.Keybinding message := utils.ResolvePlaceholderString( - gui.Tr.CloseConfirm, + gui.c.Tr.CloseConfirm, map[string]string{ "keyBindClose": gui.getKeyDisplay(keybindingConfig.Universal.Return), "keyBindConfirm": gui.getKeyDisplay(keybindingConfig.Universal.Confirm), |