diff options
author | qkzk <qu3nt1n@gmail.com> | 2023-11-12 16:26:08 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2023-11-12 16:26:08 +0100 |
commit | 67c873fd3b1c62c1ca101f35516f62718e1318a8 (patch) | |
tree | 37dd07cd540865bc0d315ce5905e58504c1c7920 | |
parent | 8342a6c13f08d0c0f3d21594456391c7171f3cd5 (diff) |
better messages when asking a password
-rw-r--r-- | development.md | 1 | ||||
-rw-r--r-- | src/constant_strings_paths.rs | 10 | ||||
-rw-r--r-- | src/mode.rs | 8 |
3 files changed, 14 insertions, 5 deletions
diff --git a/development.md b/development.md index 474b7d1..eb9542c 100644 --- a/development.md +++ b/development.md @@ -630,6 +630,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally. - [ ] refactor term manager. Separate content construction from drawing. - [ ] struct for every drawable element - [ ] Draw trait +- [x] better messages when asking a password ## TODO diff --git a/src/constant_strings_paths.rs b/src/constant_strings_paths.rs index b8469ac..91909d3 100644 --- a/src/constant_strings_paths.rs +++ b/src/constant_strings_paths.rs @@ -111,8 +111,14 @@ pub const FILTER_LINES: [&str; 6] = [ "a: reset", ]; /// Password input presentation for the second window -pub const PASSWORD_LINES: [&str; 1] = - ["Type your password. It will be forgotten immediatly after use."]; +pub const PASSWORD_LINES_SUDO: [&str; 2] = [ + "Type your sudo password.", + "It will be forgotten immediatly after use.", +]; +pub const PASSWORD_LINES_DEVICE: [&str; 2] = [ + "Type the device passkey.", + "It will be forgotten immediatly after use.", +]; /// Shell presentation for the second window pub const SHELL_LINES: [&str; 11] = [ "Type a shell command", diff --git a/src/mode.rs b/src/mode.rs index e302f1f..e7076c2 100644 --- a/src/mode.rs +++ b/src/mode.rs @@ -2,8 +2,9 @@ use std::fmt; use crate::completion::InputCompleted; use crate::constant_strings_paths::{ - CHMOD_LINES, FILTER_LINES, NEWDIR_LINES, NEWFILE_LINES, NVIM_ADDRESS_LINES, PASSWORD_LINES, - REGEX_LINES, REMOTE_LINES, RENAME_LINES, SHELL_LINES, SORT_LINES, + CHMOD_LINES, FILTER_LINES, NEWDIR_LINES, NEWFILE_LINES, NVIM_ADDRESS_LINES, + PASSWORD_LINES_DEVICE, PASSWORD_LINES_SUDO, REGEX_LINES, REMOTE_LINES, RENAME_LINES, + SHELL_LINES, SORT_LINES, }; use crate::cryptsetup::BlockDeviceAction; use crate::password::{PasswordKind, PasswordUsage}; @@ -109,7 +110,8 @@ impl InputSimple { Self::Filter => &FILTER_LINES, Self::Newdir => &NEWDIR_LINES, Self::Newfile => &NEWFILE_LINES, - Self::Password(_, _, _) => &PASSWORD_LINES, + Self::Password(PasswordKind::SUDO, _, _) => &PASSWORD_LINES_SUDO, + Self::Password(PasswordKind::CRYPTSETUP, _, _) => &PASSWORD_LINES_DEVICE, Self::RegexMatch => ®EX_LINES, Self::Rename => &RENAME_LINES, Self::SetNvimAddr => &NVIM_ADDRESS_LINES, |