diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2023-03-24 09:52:28 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2023-04-01 16:43:27 +0200 |
commit | 5a563abb2c8d1d6c981ebfaa7247395a86a7ec84 (patch) | |
tree | 96b5bb6879eedf8546465e3b72a93eba5da008f1 | |
parent | 2480f572e05bc1c15696cb955187491778a6bded (diff) |
jsdialog: send full update when shown not when created
Change-Id: I02cb63b57960c1d7425fe97c341eaf24f216c3a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149496
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | vcl/inc/jsdialog/jsdialogbuilder.hxx | 10 | ||||
-rw-r--r-- | vcl/jsdialog/jsdialogbuilder.cxx | 48 |
2 files changed, 56 insertions, 2 deletions
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index ac638e70eae5..75ea450ec4c8 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -507,6 +507,11 @@ public: virtual void undo_collapse() override; virtual void response(int response) override; virtual weld::Button* weld_widget_for_response(int response) override; + virtual int run() override; + virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner, + const std::function<void(sal_Int32)>& rEndDialogFn) override; + virtual bool runAsync(std::shared_ptr<Dialog> const& rxSelf, + const std::function<void(sal_Int32)>& func) override; }; class JSAssistant final : public JSWidget<SalInstanceAssistant, vcl::RoadmapWizard> @@ -519,6 +524,11 @@ public: virtual void set_current_page(const OString& rIdent) override; virtual void response(int response) override; virtual weld::Button* weld_widget_for_response(int response) override; + virtual int run() override; + virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner, + const std::function<void(sal_Int32)>& rEndDialogFn) override; + virtual bool runAsync(std::shared_ptr<Dialog> const& rxSelf, + const std::function<void(sal_Int32)>& func) override; }; class JSContainer final : public JSWidget<SalInstanceContainer, vcl::Window> diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index c33107c34570..ef59d1eb1e8f 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -853,7 +853,6 @@ std::unique_ptr<weld::Dialog> JSInstanceBuilder::weld_dialog(const OString& id) RememberWidget("__DIALOG__", pRet.get()); initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON()); - sendFullUpdate(); m_bSentInitialUpdate = true; } @@ -882,7 +881,6 @@ std::unique_ptr<weld::Assistant> JSInstanceBuilder::weld_assistant(const OString RememberWidget("__DIALOG__", pRet.get()); initializeSender(GetNotifierWindow(), GetContentWindow(), GetTypeOfJSON()); - sendFullUpdate(); m_bSentInitialUpdate = true; } @@ -1337,6 +1335,52 @@ void JSAssistant::response(int response) SalInstanceAssistant::response(response); } +int JSDialog::run() +{ + sendFullUpdate(true); + int ret = SalInstanceDialog::run(); + return ret; +} + +bool JSDialog::runAsync(std::shared_ptr<weld::DialogController> aOwner, + const std::function<void(sal_Int32)>& rEndDialogFn) +{ + bool ret = SalInstanceDialog::runAsync(aOwner, rEndDialogFn); + sendFullUpdate(); + return ret; +} + +bool JSDialog::runAsync(std::shared_ptr<Dialog> const& rxSelf, + const std::function<void(sal_Int32)>& func) +{ + bool ret = SalInstanceDialog::runAsync(rxSelf, func); + sendFullUpdate(); + return ret; +} + +int JSAssistant::run() +{ + sendFullUpdate(true); + int ret = SalInstanceDialog::run(); + return ret; +} + +bool JSAssistant::runAsync(std::shared_ptr<weld::DialogController> aOwner, + const std::function<void(sal_Int32)>& rEndDialogFn) +{ + bool ret = SalInstanceDialog::runAsync(aOwner, rEndDialogFn); + sendFullUpdate(); + return ret; +} + +bool JSAssistant::runAsync(std::shared_ptr<Dialog> const& rxSelf, + const std::function<void(sal_Int32)>& func) +{ + bool ret = SalInstanceDialog::runAsync(rxSelf, func); + sendFullUpdate(); + return ret; +} + weld::Button* JSDialog::weld_widget_for_response(int nResponse) { PushButton* pButton |