diff options
author | Timothy <timmot@users.noreply.github.com> | 2021-07-12 01:16:26 +1000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-18 17:21:28 +0200 |
commit | 38594dde7901e8e3cd5d114251df08d12549ee54 (patch) | |
tree | 6427050fc770f8bbf08503949d0655427af1258d /Userland/Services/FileSystemAccessServer/ClientConnection.h | |
parent | ab353fd4e16d2ddae8098b4bc2d71682497eb375 (diff) | |
download | serenity-38594dde7901e8e3cd5d114251df08d12549ee54.zip |
FileSystemAccessServer+TextEditor: Implement cross-process modal prompts
This transitions from synchronous IPC calls to asynchronous IPC calls
provided through a synchronous interface in LibFileSystemAccessClient
which allows the parent Application to stay responsive.
It achieves this with Promise which is pumping the Application event
loop while waiting for the Dialog to respond with the user's action.
LibFileSystemAccessClient provides a lazy singleton which also ensures
that FileSystemAccessServer is running in the event of a crash.
This also transitions TextEditor into using LibFileSystemAccessClient.
Diffstat (limited to 'Userland/Services/FileSystemAccessServer/ClientConnection.h')
-rw-r--r-- | Userland/Services/FileSystemAccessServer/ClientConnection.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Userland/Services/FileSystemAccessServer/ClientConnection.h b/Userland/Services/FileSystemAccessServer/ClientConnection.h index 2f738bb4e7..9261bc029c 100644 --- a/Userland/Services/FileSystemAccessServer/ClientConnection.h +++ b/Userland/Services/FileSystemAccessServer/ClientConnection.h @@ -10,6 +10,7 @@ #include <FileSystemAccessServer/FileSystemAccessClientEndpoint.h> #include <FileSystemAccessServer/FileSystemAccessServerEndpoint.h> #include <LibCore/Forward.h> +#include <LibGUI/Forward.h> #include <LibIPC/ClientConnection.h> namespace FileSystemAccessServer { @@ -25,12 +26,12 @@ public: virtual void die() override; private: - virtual Messages::FileSystemAccessServer::RequestFileResponse request_file(String const&, Core::OpenMode const&) override; - virtual Messages::FileSystemAccessServer::PromptOpenFileResponse prompt_open_file(String const&, Core::OpenMode const&) override; - virtual Messages::FileSystemAccessServer::PromptSaveFileResponse prompt_save_file(String const&, String const&, String const&, Core::OpenMode const&) override; + virtual void request_file(i32, i32, String const&, Core::OpenMode const&) override; + virtual void prompt_open_file(i32, i32, String const&, Core::OpenMode const&) override; + virtual void prompt_save_file(i32, i32, String const&, String const&, String const&, Core::OpenMode const&) override; - template<typename T> - T prompt_helper(Optional<String> const&, Core::OpenMode const&); + void prompt_helper(Optional<String> const&, Core::OpenMode const&); + RefPtr<GUI::Window> create_dummy_child_window(i32, i32); HashMap<String, Core::OpenMode> m_approved_files; }; |