mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
If find command doesn't return any result show an info dialog and not an empty explorer
This commit is contained in:
committed by
Christian Visintin
parent
88b29d3183
commit
cb583f305c
@@ -31,6 +31,7 @@ Released on FIXME:
|
|||||||
- **Enhancements**:
|
- **Enhancements**:
|
||||||
- Find feature:
|
- Find feature:
|
||||||
- A "wait popup" will now be displayed while searching files
|
- 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
|
## 0.7.0
|
||||||
|
|
||||||
|
|||||||
@@ -449,6 +449,12 @@ impl Update for FileTransferActivity {
|
|||||||
// Mount error
|
// Mount error
|
||||||
self.mount_error(err.as_str());
|
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) => {
|
Ok(files) => {
|
||||||
// Create explorer and load files
|
// Create explorer and load files
|
||||||
self.browser.set_found(files);
|
self.browser.set_found(files);
|
||||||
|
|||||||
@@ -400,6 +400,15 @@ impl FileTransferActivity {
|
|||||||
|
|
||||||
// -- partials
|
// -- 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
|
||||||
///
|
///
|
||||||
/// Mount error box
|
/// Mount error box
|
||||||
|
|||||||
Reference in New Issue
Block a user