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 c13ec26f6a20bc9a0e3e4fd8f03d8f4e1d46c7d1
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: Mon Jan 24 09:44:19 2022 +0100

    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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128839
    Tested-by: Jenkins

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
     {

Reply via email to