diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2019-04-17 17:33:10 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-05-18 20:45:26 +0200 |
commit | 77445e201c45e5593761e8399c32f80eea2178a4 (patch) | |
tree | db0010bc4842b224382e6cdca5b18aa89185068b /chart2/source/controller/inc | |
parent | 835bced249e95ccbf0a88266f8c1ba166cf5efcb (diff) |
Make Chart Creation Wizard async
* FuInsertChart as a memeber in ScTabViewShell
stores instance is needed to react on the dialog's result
* CreationWizardUnoDlg converted to XAsynchronousExecutableDialog
added dialog close handler which notifies listeners
In the Online dialog become dead after closing, additional
PostUserEvent was needed to kill the dialog after real close
(without it user needed to select any cell to close dialog)
* Reuse in Writer
Change-Id: Ib09b5d83af9e1aa67218e093aa161419e8ddb922
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90380
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'chart2/source/controller/inc')
-rw-r--r-- | chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx index 33d1dfbf1a69..2e27418de27d 100644 --- a/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx +++ b/chart2/source/controller/inc/dlg_CreationWizard_UNO.hxx @@ -26,9 +26,13 @@ #include <com/sun/star/frame/XTerminateListener.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp> #include "dlg_CreationWizard.hxx" +#include <tools/link.hxx> +#include <vcl/vclptr.hxx> +#include <vcl/vclevent.hxx> namespace com::sun::star::awt { class XWindow; } namespace com::sun::star::frame { class XModel; } @@ -41,7 +45,7 @@ namespace chart class CreationWizardUnoDlg : public MutexContainer , public ::cppu::OComponentHelper - , public css::ui::dialogs::XExecutableDialog + , public css::ui::dialogs::XAsynchronousExecutableDialog , public css::lang::XServiceInfo , public css::lang::XInitialization , public css::frame::XTerminateListener @@ -68,9 +72,9 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - // XExecutableDialog - virtual void SAL_CALL setTitle( const OUString& aTitle ) override; - virtual sal_Int16 SAL_CALL execute( ) override; + // XAsynchronousExecutableDialog + virtual void SAL_CALL setDialogTitle( const OUString& aTitle ) override; + virtual void SAL_CALL startExecuteModal( const css::uno::Reference<css::ui::dialogs::XDialogClosedListener>& xListener ) override; // XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; @@ -97,13 +101,14 @@ protected: private: void createDialogOnDemand(); + DECL_STATIC_LINK(CreationWizardUnoDlg, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*); private: css::uno::Reference< css::frame::XModel > m_xChartModel; css::uno::Reference< css::uno::XComponentContext> m_xCC; css::uno::Reference< css::awt::XWindow > m_xParentWindow; - std::unique_ptr<CreationWizard> m_xDialog; + std::shared_ptr<CreationWizard> m_xDialog; bool m_bUnlockControllersOnExecute; }; |