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

FileSystemAccessServer: Implement FileTypeFilter to open_file()

This is the same functionality as in FilePicker. It allows the
specification of what file types are allowed.
This commit is contained in:
huttongrabiel 2023-03-17 11:53:43 -07:00 committed by Sam Atkins
parent 106ad6bb13
commit 6a5c561a41
5 changed files with 10 additions and 7 deletions

View file

@ -14,6 +14,7 @@
#include <LibCore/File.h>
#include <LibCore/Promise.h>
#include <LibCore/StandardPaths.h>
#include <LibGUI/FileTypeFilter.h>
#include <LibGUI/Window.h>
#include <LibIPC/ConnectionToServer.h>
@ -47,7 +48,7 @@ class Client final
public:
Result request_file_read_only_approved(GUI::Window* parent_window, DeprecatedString const& path);
Result request_file(GUI::Window* parent_window, DeprecatedString const& path, Core::File::OpenMode requested_access);
Result open_file(GUI::Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::File::OpenMode requested_access = Core::File::OpenMode::Read);
Result open_file(GUI::Window* parent_window, DeprecatedString const& window_title = {}, StringView path = Core::StandardPaths::home_directory(), Core::File::OpenMode requested_access = Core::File::OpenMode::Read, Optional<Vector<GUI::FileTypeFilter>> const& = {});
Result save_file(GUI::Window* parent_window, DeprecatedString const& name, DeprecatedString const ext, Core::File::OpenMode requested_access = Core::File::OpenMode::Write | Core::File::OpenMode::Truncate);
static Client& the();