summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2018-03-01 20:15:58 +0530
committerpranavk <pranavk@collabora.co.uk>2018-03-09 05:43:44 +0100
commit0b573eac85b3100eb8d40dcaf25c510f50cfd62f (patch)
tree650b9e43b041696f9d4e5f043623a445e453817e /vcl/source/app
parentb48dc80c770a3ce3296caed24987d2e451a6278c (diff)
lokdialog: run async for weld dialogs
Change-Id: Ieb06beada435bc47a39295acb5ea2dcef10ca454 Reviewed-on: https://gerrit.libreoffice.org/50874 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index bb304d2dc811..3f95a7589849 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/lok.hxx>
#include <salframe.hxx>
#include <salinst.hxx>
#include <salvd.hxx>
@@ -430,6 +431,14 @@ public:
{
}
+ virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner, const std::function<void(sal_Int32)> &rEndDialogFn) override
+ {
+ VclAbstractDialog::AsyncContext aCtx;
+ aCtx.mxOwnerDialog = aOwner;
+ aCtx.maEndDialogFn = rEndDialogFn;
+ return m_xDialog->StartExecuteAsync(aCtx);
+ }
+
virtual int run() override
{
VclButtonBox* pActionArea = m_xDialog->get_action_area();
@@ -1458,4 +1467,18 @@ weld::Window* SalFrame::GetFrameWeld() const
return m_xFrameWeld.get();
}
+namespace weld
+{
+ bool DialogController::runAsync(const std::shared_ptr<DialogController>& rController, const std::function<void(sal_Int32)>& func)
+ {
+ return rController->getDialog()->runAsync(rController, func);
+ }
+
+ GenericDialogController::GenericDialogController(weld::Widget* pParent, const OUString &rUIFile, const OString& rDialogId)
+ : m_xBuilder(Application::CreateBuilder(pParent, rUIFile))
+ , m_xDialog(m_xBuilder->weld_dialog(rDialogId))
+ {
+ }
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */