diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-09-30 13:13:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-09-30 14:55:40 +0200 |
commit | ced420ca708eb8df5b20c7d537166bd9ec29a0e5 (patch) | |
tree | 94d06a6265ff15f2be5b2c2aaa37ef66edbd08d0 /xmlsecurity/inc | |
parent | e7c4129a5cc55c52c16af049f74cf67c48a10878 (diff) |
cool#9992 lok doc sign: convert the certificate chooser dialog to async
1) Move the try-catch around assing a signature inside the block that
already got the response from the certificate chooser, it's unlikely
that choosing the certificate (and not yet signing) would fail.
2) Convert the dialog to async and allow it to be a jsdialog.
3) Hide not relevant widgets for LOK: we have a single signing
certificate, so the search entry is not useful.
The refresh button has an unclear purpose, as it was initially added
in commit fb9874231fb242b4a6a7d1ce097e66dd4ed8f32e (Caching
Certificates in the CertificateChooser dialog session-wise, 2023-08-26),
but later commit efe414c4a88fde0e2ee1d4016010f21fbd6d01d7 (Don't reuse
CertificateChooser instances, 2024-02-07) disabled this chaching. In any
case, the certificate won't change during the lifetime of a single LOK
view, so hide that as well.
4) Invoke the inner certificate viewer in an async way, too.
Change-Id: Ibf618ea7632cf801d1d9180b9aa7dd193c45ffda
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174215
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'xmlsecurity/inc')
-rw-r--r-- | xmlsecurity/inc/certificatechooser.hxx | 5 | ||||
-rw-r--r-- | xmlsecurity/inc/digitalsignaturesdialog.hxx | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/xmlsecurity/inc/certificatechooser.hxx b/xmlsecurity/inc/certificatechooser.hxx index dbed2ce5c225..8af33458e7c9 100644 --- a/xmlsecurity/inc/certificatechooser.hxx +++ b/xmlsecurity/inc/certificatechooser.hxx @@ -93,7 +93,7 @@ public: CertificateChooserUserAction eAction); virtual ~CertificateChooser() override; - static std::unique_ptr<CertificateChooser> getInstance(weld::Window* _pParent, + static std::shared_ptr<CertificateChooser> getInstance(weld::Window* _pParent, SfxViewShell* pViewShell, std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > && rxSecurityContexts, CertificateChooserUserAction eAction) { @@ -105,9 +105,10 @@ public: // in the Digital Signatures dialog // 2. File > Save As the document, check the "Encrypt with GPG key" // checkbox, press Encrypt, and crash in Dialog::ImplStartExecute() - return std::make_unique<CertificateChooser>(_pParent, pViewShell, std::move(rxSecurityContexts), eAction); + return std::make_shared<CertificateChooser>(_pParent, pViewShell, std::move(rxSecurityContexts), eAction); } + void BeforeRun(); short run() override; css::uno::Sequence<css::uno::Reference< css::security::XCertificate > > GetSelectedCertificates(); diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index ad0db53720f8..82a27a1c3fe7 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -76,6 +76,7 @@ private: DECL_LINK(ViewButtonHdl, weld::Button&, void); DECL_LINK(AddButtonHdl, weld::Button&, void); + void AddButtonHdlImpl(); DECL_LINK(RemoveButtonHdl, weld::Button&, void); DECL_LINK(SignatureHighlightHdl, weld::TreeView&, void); DECL_LINK(SignatureSelectHdl, weld::TreeView&, bool); |