1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:38:11 +00:00

FileManager: Show an inline error message for inaccessible directories

Instead of popping up a message box whenever we can't read an opened
directory, show the error message inside the DirectoryView (as a label)
instead.

This fixes a visual inconsistency where an inaccessible directory would
be selected in the left-side treeview while the previous directory's
contents were still showing on the right.

This also makes keyboard navigation a bit more pleasant since you're
not suddenly interrupted by a message box.
This commit is contained in:
Andreas Kling 2020-09-18 18:02:57 +02:00
parent 9b89303767
commit 8075db683b
3 changed files with 16 additions and 12 deletions

View file

@ -540,14 +540,6 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
open_parent_directory_action->set_enabled(new_path != "/");
};
directory_view.on_error = [&](int, const char* error_string, bool quit) {
auto error_message = String::format("Could not read directory: %s", error_string);
GUI::MessageBox::show(window, error_message, "File Manager", GUI::MessageBox::Type::Error);
if (quit)
exit(1);
};
directory_view.on_status_message = [&](const StringView& message) {
statusbar.set_text(message);
};