diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-25 09:09:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-26 07:41:06 +0100 |
commit | bf359d01ac8b1e0292e8a92c38e58c03e6c17d8b (patch) | |
tree | 5d246936936143e36ba76542f5ba7b5954405ea5 /include/vcl | |
parent | 8968e648113820308f5201da723d52d3fbbb09af (diff) |
add a Dialog::runAsync for the non-controller case
.. and use it to make the solver warning dialogs async
Change-Id: I3589a1d3ae58190bf545bac1e2a95f81a114d44f
Reviewed-on: https://gerrit.libreoffice.org/66896
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/abstdlg.hxx | 7 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/vcl/abstdlg.hxx b/include/vcl/abstdlg.hxx index f000d92c26e5..71369c92057b 100644 --- a/include/vcl/abstdlg.hxx +++ b/include/vcl/abstdlg.hxx @@ -37,6 +37,7 @@ class Dialog; class BitmapEx; namespace weld { + class Dialog; class DialogController; class Window; } @@ -54,8 +55,12 @@ public: virtual short Execute() = 0; struct AsyncContext { + // for the case where the owner is the dialog itself, and the dialog is an unwelded VclPtr based dialog VclPtr<VclReferenceBase> mxOwner; - std::shared_ptr<weld::DialogController> mxOwnerDialog; + // for the case where the dialog is welded, and owned by a DialogController + std::shared_ptr<weld::DialogController> mxOwnerDialogController; + // for the case where the dialog is welded, and is running async without a DialogController + std::shared_ptr<weld::Dialog> mxOwnerSelf; std::function<void(sal_Int32)> maEndDialogFn; bool isSet() { return !!maEndDialogFn; } }; diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 91e77ce216a4..ea5576c35ce8 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -305,6 +305,8 @@ private: public: virtual int run() = 0; + // Run async without a controller + virtual bool runAsync(const std::function<void(sal_Int32)>& func) = 0; virtual void response(int response) = 0; virtual void add_button(const OUString& rText, int response, const OString& rHelpId = OString()) = 0; |