diff options
author | qkzk <qu3nt1n@gmail.com> | 2024-02-13 21:16:20 +0100 |
---|---|---|
committer | qkzk <qu3nt1n@gmail.com> | 2024-02-13 21:16:20 +0100 |
commit | ae492e6cb8bc3f6aec8040c72948b3530c750ff6 (patch) | |
tree | 95d8652c89601f22da9be1cb765579fa5d9cead7 | |
parent | 4240d098bbaf6495725093c92b1be287cc4ac586 (diff) |
go to mount point after mounting an encrypted device
-rw-r--r-- | development.md | 2 | ||||
-rw-r--r-- | src/app/status.rs | 7 | ||||
-rw-r--r-- | src/modes/edit/cryptsetup.rs | 5 |
3 files changed, 9 insertions, 5 deletions
diff --git a/development.md b/development.md index 4d4be07..f2eda36 100644 --- a/development.md +++ b/development.md @@ -917,7 +917,7 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally. - [x] FIX win second use 1 more line - [x] FIX: entering sort doesn't set focus - [x] update config from build file by removing references to removed binds. -- [ ] ??? +- [x] move to encrypted drive when mounting is successful ## TODO diff --git a/src/app/status.rs b/src/app/status.rs index eac4409..b29ac07 100644 --- a/src/app/status.rs +++ b/src/app/status.rs @@ -842,9 +842,14 @@ impl Status { PasswordUsage::CRYPTSETUP(PasswordKind::CRYPTSETUP), ) } else { - self.menu + if let Ok(true) = self + .menu .encrypted_devices .mount_selected(&mut self.menu.password_holder) + { + self.go_to_encrypted_drive()?; + } + Ok(()) } } diff --git a/src/modes/edit/cryptsetup.rs b/src/modes/edit/cryptsetup.rs index a6d5278..9008366 100644 --- a/src/modes/edit/cryptsetup.rs +++ b/src/modes/edit/cryptsetup.rs @@ -297,7 +297,7 @@ impl CryptoDeviceOpener { } /// Open and mount the selected device. - pub fn mount_selected(&mut self, password_holder: &mut PasswordHolder) -> Result<()> { + pub fn mount_selected(&mut self, password_holder: &mut PasswordHolder) -> Result<bool> { let username = current_username()?; let success = self.content[self.index].open_mount(&username, password_holder)?; if !success { @@ -305,7 +305,7 @@ impl CryptoDeviceOpener { } password_holder.reset(); drop_sudo_privileges()?; - Ok(()) + Ok(success) } /// Unmount and close the selected device. @@ -321,6 +321,5 @@ impl CryptoDeviceOpener { } } -// impl_selectable_content!(CryptoDevice, CryptoDeviceOpener); impl_selectable!(CryptoDeviceOpener); impl_content!(CryptoDevice, CryptoDeviceOpener); |