diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-25 12:03:26 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-02-14 11:25:39 +0100 |
commit | ddb7b7d3ba0bcd815a8deb226b47fba025d5597e (patch) | |
tree | 2d0b958b16116a7b8f4977403f0df01d0a34cf30 /xmlsecurity | |
parent | 359cb79b0f8fd0aba87709e1b6f873c3eace27e1 (diff) |
Make View Certificate sub-dialog async
Change-Id: I0e1a6a59d856ab266511fc3d6be87fe04c5afdfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124143
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128840
Tested-by: Jenkins
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/inc/certificateviewer.hxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/certificateviewer.cxx | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/xmlsecurity/inc/certificateviewer.hxx b/xmlsecurity/inc/certificateviewer.hxx index 1d0ec5f72e2d..ea47c41029a8 100644 --- a/xmlsecurity/inc/certificateviewer.hxx +++ b/xmlsecurity/inc/certificateviewer.hxx @@ -134,6 +134,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::TreeIter> mxScratchIter; @@ -150,6 +151,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 c252024ed954..3e0480b9317b 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -271,6 +271,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 ) @@ -322,10 +328,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; }); } } |