vcl/jsdialog/enabled.cxx | 3 ++- xmlsecurity/inc/digitalsignaturesdialog.hxx | 3 +++ xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 9 +++++++-- 3 files changed, 12 insertions(+), 3 deletions(-)
New commits: commit 7f2aea30f18b0c76dbbb58d3498cb68778040ef3 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Fri Oct 22 13:08:46 2021 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri Oct 29 14:47:49 2021 +0200 Make View Certificate dialog async Change-Id: Id93145ecf6be3cb558f0ce8d3cc340bbc67095e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124061 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx index c071cda333c5..30fa14deffa0 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -53,7 +53,8 @@ bool isBuilderEnabled(const OUString& rUIFile, bool bMobile) || rUIFile == "svx/ui/fontworkgallerydialog.ui" || rUIFile == "cui/ui/macroselectordialog.ui" || rUIFile == "uui/ui/macrowarnmedium.ui" || rUIFile == "modules/scalc/ui/textimportcsv.ui" - || rUIFile == "xmlsec/ui/digitalsignaturesdialog.ui") + || rUIFile == "xmlsec/ui/digitalsignaturesdialog.ui" + || rUIFile == "xmlsec/ui/viewcertdialog.ui") { return true; } diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index f49af516ba00..7ba84d2a677f 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -37,6 +37,7 @@ namespace com::sun::star { class HeaderBar; +class CertificateViewer; class DigitalSignaturesDialog final : public weld::GenericDialogController { @@ -72,6 +73,8 @@ private: std::unique_ptr<weld::Button> m_xStartCertMgrBtn; std::unique_ptr<weld::Button> m_xCloseBtn; + std::shared_ptr<CertificateViewer> m_xViewer; + DECL_LINK(AdESCompliantCheckBoxHdl, weld::ToggleButton&, void); DECL_LINK(ViewButtonHdl, weld::Button&, void); DECL_LINK(AddButtonHdl, weld::Button&, void); diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index ac31d5ba3875..3179a5c09b20 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -205,6 +205,8 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( DigitalSignaturesDialog::~DigitalSignaturesDialog() { + if (m_xViewer) + m_xViewer->response(RET_OK); } bool DigitalSignaturesDialog::Init() @@ -773,9 +775,12 @@ void DigitalSignaturesDialog::ImplShowSignaturesDetails() if ( xCert.is() ) { + if (m_xViewer) + m_xViewer->response(RET_OK); + uno::Reference<xml::crypto::XSecurityEnvironment> xSecEnv = getSecurityEnvironmentForCertificate(xCert); - CertificateViewer aViewer(m_xDialog.get(), xSecEnv, xCert, false, nullptr); - aViewer.run(); + m_xViewer = std::make_shared<CertificateViewer>(m_xDialog.get(), xSecEnv, xCert, false, nullptr); + weld::DialogController::runAsync(m_xViewer, [this] (sal_Int32) { m_xViewer = nullptr; }); } else {