AuthActivity: enter setup with <CTRL+C>

This commit is contained in:
ChristianVisintin
2020-12-24 18:27:38 +01:00
parent 6bf503331e
commit 39e8d1f704
3 changed files with 24 additions and 0 deletions

View File

@@ -159,6 +159,10 @@ impl AuthActivity {
// Show help
self.input_mode = InputMode::Popup(PopupType::Help);
}
'C' | 'c' => {
// Show setup
self.setup = true;
}
'S' | 's' => {
// Default choice option to no
self.choice_opt = DialogYesNoOption::No;
@@ -268,6 +272,10 @@ impl AuthActivity {
self.selected_field = InputField::Password;
}
KeyCode::Char(ch) => match ch {
'C' | 'c' => {
// Show setup
self.setup = true;
}
'E' | 'e' => {
// Ask if user wants to delete bookmark; NOTE: same as <DEL>
self.input_mode = InputMode::Popup(PopupType::YesNo(
@@ -348,6 +356,10 @@ impl AuthActivity {
self.selected_field = InputField::Password;
}
KeyCode::Char(ch) => match ch {
'C' | 'c' => {
// Show setup
self.setup = true;
}
'E' | 'e' => {
// Ask if user wants to delete bookmark; NOTE: same as <DEL>
self.input_mode = InputMode::Popup(PopupType::YesNo(

View File

@@ -581,6 +581,16 @@ impl AuthActivity {
Span::raw(" "),
Span::raw("Delete selected bookmark"),
])),
ListItem::new(Spans::from(vec![
Span::styled(
"<CTRL+C>",
Style::default()
.fg(Color::Cyan)
.add_modifier(Modifier::BOLD),
),
Span::raw(" "),
Span::raw("Enter setup"),
])),
ListItem::new(Spans::from(vec![
Span::styled(
"<CTRL+H>",

View File

@@ -109,6 +109,7 @@ pub struct AuthActivity {
pub password: String,
pub submit: bool, // becomes true after user has submitted fields
pub quit: bool, // Becomes true if user has pressed esc
pub setup: bool, // Becomes true if user has requested setup
context: Option<Context>,
bookmarks_client: Option<BookmarksClient>,
selected_field: InputField, // Selected field in AuthCredentials Form
@@ -141,6 +142,7 @@ impl AuthActivity {
password: String::new(),
submit: false,
quit: false,
setup: false,
context: None,
bookmarks_client: None,
selected_field: InputField::Address,