Skip to content

Commit 99d46ca

Browse files
Karol Kosekgunnarbeutner
authored andcommitted
LibGUI: Disable changing the view on error in the FilePicker
Prior to this change, changing the view would hide the error label and show an empty directory.
1 parent 80e3cf3 commit 99d46ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Userland/Libraries/LibGUI/FilePicker.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,19 @@ FilePicker::FilePicker(Window* parent_window, Mode mode, const StringView& filen
219219
m_model->on_directory_change_error = [&](int, char const* error_string) {
220220
m_error_label->set_text(String::formatted("Could not open {}:\n{}", m_model->root_path(), error_string));
221221
m_view->set_active_widget(m_error_label);
222+
223+
m_view->view_as_icons_action().set_enabled(false);
224+
m_view->view_as_table_action().set_enabled(false);
225+
m_view->view_as_columns_action().set_enabled(false);
222226
};
223227
m_model->on_complete = [&] {
224228
m_view->set_active_widget(&m_view->current_view());
225229
for (auto location_button : m_common_location_buttons)
226230
location_button.button.set_checked(m_model->root_path() == location_button.path);
231+
232+
m_view->view_as_icons_action().set_enabled(true);
233+
m_view->view_as_table_action().set_enabled(true);
234+
m_view->view_as_columns_action().set_enabled(true);
227235
};
228236

229237
for (auto& location : CommonLocationsProvider::common_locations()) {

0 commit comments

Comments
 (0)