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 14:47:49 +0200 |
commit | 7f2aea30f18b0c76dbbb58d3498cb68778040ef3 (patch) | |
tree | d02f91008d91847a55d9556e8020aa026094e4e7 | |
parent | f5e65834c77162ac12d8bbcec82972e055aa3084 (diff) |
Make View Certificate dialog async
Change-Id: Id93145ecf6be3cb558f0ce8d3cc340bbc67095e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124061
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r-- | vcl/jsdialog/enabled.cxx | 3 | ||||
-rw-r--r-- | xmlsecurity/inc/digitalsignaturesdialog.hxx | 3 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 9 |
3 files changed, 12 insertions, 3 deletions
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 { |