mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
Userland: Filter out unsupported file types in open dialogs in more apps
This commit is contained in:
parent
27011cf55d
commit
8bd68198d6
10 changed files with 69 additions and 16 deletions
|
@ -378,7 +378,10 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto& file_menu = window->add_menu("&File"_short_string);
|
||||
|
||||
file_menu.add_action(GUI::CommonActions::make_open_action([&](auto&) {
|
||||
auto response = FileSystemAccessClient::Client::the().open_file(window);
|
||||
FileSystemAccessClient::OpenFileOptions options {
|
||||
.allowed_file_types = { { GUI::FileTypeFilter { "Object Files", { { "obj" } } }, GUI::FileTypeFilter::all_files() } },
|
||||
};
|
||||
auto response = FileSystemAccessClient::Client::the().open_file(window, options);
|
||||
if (response.is_error())
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue