diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-25 12:03:26 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-01-24 13:46:42 +0100 |
commit | 98d2c965aca67f59a27c0a9a7a3bc6e4fdb90950 (patch) | |
tree | 1b492ea456ee6cc118c8d1f92b1715d8deedc005 /xmlsecurity | |
parent | 6ff04de38652d639694489f9dc8e58c7039e067d (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; }); } } |