mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
Userland: Filter out unsupported file types in open dialogs in more apps
This commit is contained in:
parent
27011cf55d
commit
8bd68198d6
Notes:
sideshowbarker
2024-07-16 23:57:20 +09:00
Author: https://github.com/krkk
Commit: 8bd68198d6
Pull-request: https://github.com/SerenityOS/serenity/pull/19262
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/LucasChollet
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