mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 22:22:21 -04:00
Display error message when trying to delete non-empty directory (#1321)
* Non-empty directory check * Non-empty directory check * Display error when attempting to delete non-empty directory * Clang Delete white-space that the friggin editor added * is_empty_directory * is_empty_directory * is_empty_directory * Now need to check if it's a directory first
This commit is contained in:
parent
411f6c0a34
commit
91c6e3fc30
3 changed files with 17 additions and 0 deletions
|
@ -440,6 +440,11 @@ void FileManagerView::on_rename(std::string_view hint) {
|
|||
}
|
||||
|
||||
void FileManagerView::on_delete() {
|
||||
if (is_directory(get_selected_full_path()) && !is_empty_directory(get_selected_full_path())) {
|
||||
nav_.display_modal("Delete", "Directory not empty!");
|
||||
return;
|
||||
}
|
||||
|
||||
auto name = get_selected_entry().path.filename().string();
|
||||
nav_.push<ModalMessageView>(
|
||||
"Delete", "Delete " + name + "\nAre you sure?", YESNO,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue