diff options
author | TokieSan <eltokhy@aucegypt.edu> | 2023-08-05 18:26:55 +0300 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2023-08-26 00:59:48 +0200 |
commit | fb9874231fb242b4a6a7d1ce097e66dd4ed8f32e (patch) | |
tree | fc3b69b97247bcaf5b4f318e6e61a4c6eb4e60ec /xmlsecurity/source/dialogs/certificatechooser.cxx | |
parent | 6e042b1e26bedcc8d8bdcf105ec750b03665c7b0 (diff) |
Caching Certificates in the CertificateChooser dialog session-wise
Added the functionality of caching certificates per session using a
single instance with internal memoization. Added Reload Certificates
button in case of certificate changes in-session. Updated all instances
of certifcate chooser in the codebase to work with the new change.
Change-Id: Icb25a2b2e9787b029fa6189f70bd4ba3b6806f60
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155373
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'xmlsecurity/source/dialogs/certificatechooser.cxx')
-rw-r--r-- | xmlsecurity/source/dialogs/certificatechooser.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index be3e88f9d453..a7ff02f1a583 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -52,6 +52,7 @@ CertificateChooser::CertificateChooser(weld::Window* _pParent, , m_xFTDescription(m_xBuilder->weld_label("description-label")) , m_xDescriptionED(m_xBuilder->weld_entry("description")) , m_xSearchBox(m_xBuilder->weld_entry("searchbox")) + , m_xReloadBtn(m_xBuilder->weld_button("reloadcert")) { auto nControlWidth = m_xCertLB->get_approximate_digit_width() * 105; m_xCertLB->set_size_request(nControlWidth, m_xCertLB->get_height_rows(12)); @@ -61,6 +62,7 @@ CertificateChooser::CertificateChooser(weld::Window* _pParent, m_xCertLB->connect_row_activated( LINK( this, CertificateChooser, CertificateSelectHdl ) ); m_xViewBtn->connect_clicked( LINK( this, CertificateChooser, ViewButtonHdl ) ); m_xSearchBox->connect_changed(LINK(this, CertificateChooser, SearchModifyHdl)); + m_xReloadBtn->connect_clicked( LINK( this, CertificateChooser, ReloadButtonHdl ) ); mxSecurityContexts = std::move(rxSecurityContexts); mbInitialized = false; @@ -313,6 +315,18 @@ OUString CertificateChooser::GetUsageText() UsageInClearText(xCerts[0]->getCertificateUsage()) : OUString(); } +void CertificateChooser::ImplReloadCertificates() +{ + xMemCerts.clear(); +} + +IMPL_LINK_NOARG(CertificateChooser, ReloadButtonHdl, weld::Button&, void) +{ + ImplReloadCertificates(); + mbInitialized = false; + ImplInitialize(); +} + IMPL_LINK_NOARG(CertificateChooser, SearchModifyHdl, weld::Entry&, void) { ImplInitialize(true); |