summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2021-10-22 13:08:46 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2022-01-24 09:44:19 +0100
commitc13ec26f6a20bc9a0e3e4fd8f03d8f4e1d46c7d1 (patch)
tree733b1a27d275a9f3e21de4fa53c6e7ec7ea78e64
parent71a8bad4b96627fd965b23288dea14aae3f0f468 (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128839 Tested-by: Jenkins
-rw-r--r--vcl/jsdialog/enabled.cxx3
-rw-r--r--xmlsecurity/inc/digitalsignaturesdialog.hxx3
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx9
3 files changed, 12 insertions, 3 deletions
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index e60e31db382c..dc5857afda61 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -51,7 +51,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool bMobile)
|| rUIFile == u"svx/ui/fontworkgallerydialog.ui"
|| rUIFile == u"cui/ui/macroselectordialog.ui" || rUIFile == u"uui/ui/macrowarnmedium.ui"
|| rUIFile == u"modules/scalc/ui/textimportcsv.ui"
- || rUIFile == u"xmlsec/ui/digitalsignaturesdialog.ui")
+ || rUIFile == u"xmlsec/ui/digitalsignaturesdialog.ui"
+ || rUIFile == u"xmlsec/ui/viewcertdialog.ui")
{
return true;
}
diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx
index f8a59adaf9b5..f8ace3d976a6 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::Toggleable&, 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 621ea4170649..fc7cf6b2a534 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -204,6 +204,8 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
DigitalSignaturesDialog::~DigitalSignaturesDialog()
{
+ if (m_xViewer)
+ m_xViewer->response(RET_OK);
}
bool DigitalSignaturesDialog::Init()
@@ -774,9 +776,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
{