mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +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
|
@ -121,7 +121,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
// Actions
|
||||
auto open_action = GUI::CommonActions::make_open_action(
|
||||
[&](auto&) {
|
||||
auto result = FileSystemAccessClient::Client::the().open_file(window, { .window_title = "Open Image"sv });
|
||||
FileSystemAccessClient::OpenFileOptions options {
|
||||
.window_title = "Open Image"sv,
|
||||
.allowed_file_types = Vector { GUI::FileTypeFilter::image_files(), GUI::FileTypeFilter::all_files() },
|
||||
};
|
||||
auto result = FileSystemAccessClient::Client::the().open_file(window, options);
|
||||
if (result.is_error())
|
||||
return;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue