If find command doesn't return any result show an info dialog and not an empty explorer

This commit is contained in:
veeso 2021-11-09 12:36:57 +01:00
parent 4f5d8c9224
commit 9a56ebaa57
3 changed files with 16 additions and 0 deletions

View file

@ -31,6 +31,7 @@ Released on FIXME:
- **Enhancements**:
- Find feature:
- A "wait popup" will now be displayed while searching files
- If find command doesn't return any result show an info dialog and not an empty explorer
## 0.7.0

View file

@ -449,6 +449,12 @@ impl Update for FileTransferActivity {
// Mount error
self.mount_error(err.as_str());
}
Ok(files) if files.is_empty() => {
// If no file has been found notify user
self.mount_info(
format!(r#"Could not find any file matching "{}""#, input).as_str(),
);
}
Ok(files) => {
// Create explorer and load files
self.browser.set_found(files);

View file

@ -400,6 +400,15 @@ impl FileTransferActivity {
// -- partials
/// ### mount_info
///
/// Mount info box
pub(super) fn mount_info(&mut self, text: &str) {
// Mount
let info_color = self.theme().misc_info_dialog;
self.mount_text_dialog(super::COMPONENT_TEXT_ERROR, text, info_color);
}
/// ### mount_error
///
/// Mount error box