If find command doesn't return any result show an info dialog and not an empty explorer
This commit is contained in:
parent
4f5d8c9224
commit
9a56ebaa57
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue