vcl/jsdialog/enabled.cxx | 4 +++- xmlsecurity/inc/certificateviewer.hxx | 2 ++ xmlsecurity/inc/digitalsignaturesdialog.hxx | 3 +++ xmlsecurity/source/dialogs/certificateviewer.cxx | 13 +++++++++++-- xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 9 +++++++-- 5 files changed, 26 insertions(+), 5 deletions(-)
New commits: commit dcbfeb51cd35f00e6f4c5ffeb925e03f51753917 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Oct 25 12:03:26 2021 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri Oct 29 10:24:26 2021 +0200 Make View Certificate sub-dialog async Change-Id: I0e1a6a59d856ab266511fc3d6be87fe04c5afdfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124255 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 5c23ecb8bd43..ab1cc9852d74 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -52,7 +52,8 @@ bool isBuilderEnabled(const OUString& rUIFile, bool bMobile) || rUIFile == "cui/ui/macroselectordialog.ui" || rUIFile == "uui/ui/macrowarnmedium.ui" || rUIFile == "modules/scalc/ui/textimportcsv.ui" || rUIFile == "xmlsec/ui/digitalsignaturesdialog.ui" - || rUIFile == "xmlsec/ui/viewcertdialog.ui") + || rUIFile == "xmlsec/ui/viewcertdialog.ui" || rUIFile == "xmlsec/ui/certgeneral.ui" + || rUIFile == "xmlsec/ui/viewcertdialog.ui" || rUIFile == "xmlsec/ui/certpage.ui") { return true; } diff --git a/xmlsecurity/inc/certificateviewer.hxx b/xmlsecurity/inc/certificateviewer.hxx index d531dd1fc205..ccb2278f6972 100644 --- a/xmlsecurity/inc/certificateviewer.hxx +++ b/xmlsecurity/inc/certificateviewer.hxx @@ -139,6 +139,7 @@ private: bool mbFirstActivateDone; std::vector<std::unique_ptr<CertPath_UserData>> maUserData; + std::shared_ptr<CertificateViewer> mxCertificateViewer; std::unique_ptr<weld::TreeView> mxCertPathLB; std::unique_ptr<weld::Button> mxViewCertPB; @@ -154,6 +155,7 @@ private: public: CertificateViewerCertPathTP(weld::Container* pParent, CertificateViewer* pDlg); + ~CertificateViewerCertPathTP(); void ActivatePage(); }; diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 3807300e7b49..228cbfdc8a54 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -268,6 +268,12 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP(weld::Container* pParen mxViewCertPB->connect_clicked( LINK( this, CertificateViewerCertPathTP, ViewCertHdl ) ); } +CertificateViewerCertPathTP::~CertificateViewerCertPathTP() +{ + if (mxCertificateViewer) + mxCertificateViewer->response(RET_OK); +} + void CertificateViewerCertPathTP::ActivatePage() { if ( !mbFirstActivateDone ) @@ -319,10 +325,13 @@ IMPL_LINK_NOARG(CertificateViewerCertPathTP, ViewCertHdl, weld::Button&, void) std::unique_ptr<weld::TreeIter> xIter = mxCertPathLB->make_iterator(); if (mxCertPathLB->get_selected(xIter.get())) { + if (mxCertificateViewer) + mxCertificateViewer->response(RET_OK); + CertPath_UserData* pData = reinterpret_cast<CertPath_UserData*>(mxCertPathLB->get_id(*xIter).toInt64()); - CertificateViewer aViewer(mpDlg->getDialog(), mpDlg->mxSecurityEnvironment, + mxCertificateViewer = std::make_shared<CertificateViewer>(mpDlg->getDialog(), mpDlg->mxSecurityEnvironment, pData->mxCert, false, nullptr); - aViewer.run(); + weld::DialogController::runAsync(mxCertificateViewer, [this] (sal_Int32) { mxCertificateViewer = nullptr; }); } } commit de4e67a330d4cf244b2703ed88884cf126b4d4e9 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 10:24:09 2021 +0200 Make View Certificate dialog async Change-Id: Id93145ecf6be3cb558f0ce8d3cc340bbc67095e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124254 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 99df1bf6fc3f..5c23ecb8bd43 100644 --- a/vcl/jsdialog/enabled.cxx +++ b/vcl/jsdialog/enabled.cxx @@ -51,7 +51,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 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 {