diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-22 13:08:46 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-29 10:24:09 +0200 |
commit | de4e67a330d4cf244b2703ed88884cf126b4d4e9 (patch) | |
tree | bd9e721c0eb580bdac8b6498d2dc15f072a2f574 /xmlsecurity | |
parent | 0a298aab1296c65c7b362ec9c34cff9960e5a6cc (diff) |
Make View Certificate dialog async
Change-Id: Id93145ecf6be3cb558f0ce8d3cc340bbc67095e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124254
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/inc/digitalsignaturesdialog.hxx | 3 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index f6991bcb61b5..64fd26bae169 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -44,6 +44,7 @@ namespace xml { namespace dom { class HeaderBar; +class CertificateViewer; class DigitalSignaturesDialog : public weld::GenericDialogController { @@ -79,6 +80,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 dfd40c2efbd3..9c8a48c0df48 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -200,6 +200,8 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( DigitalSignaturesDialog::~DigitalSignaturesDialog() { + if (m_xViewer) + m_xViewer->response(RET_OK); } bool DigitalSignaturesDialog::Init() @@ -767,9 +769,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 { |