diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-04-13 13:08:03 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-05-22 10:27:37 +0200 |
commit | 203d967c045c4bf4e83d18bdcb96e11f899e1056 (patch) | |
tree | 7aa17706509106c6693b8c9d4336e3ceec7a0672 /xmlsecurity | |
parent | 066abd6163a1b12e3bdcaf0385a4842c7bc7d119 (diff) |
Related tdf#83877 Select certificate ok button label doesn't match
Change the button to "Select" instead of sign when we only want to
select a certificate.
Change-Id: Ifa896e502c8680497d71912ddd1058ab0b71542b
Reviewed-on: https://gerrit.libreoffice.org/52823
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/inc/certificatechooser.hxx | 1 | ||||
-rw-r--r-- | xmlsecurity/source/component/documentdigitalsignatures.cxx | 10 | ||||
-rw-r--r-- | xmlsecurity/source/dialogs/certificatechooser.cxx | 10 | ||||
-rw-r--r-- | xmlsecurity/uiconfig/ui/selectcertificatedialog.ui | 5 |
4 files changed, 24 insertions, 2 deletions
diff --git a/xmlsecurity/inc/certificatechooser.hxx b/xmlsecurity/inc/certificatechooser.hxx index 6049eb4a3869..9e2406c4fd63 100644 --- a/xmlsecurity/inc/certificatechooser.hxx +++ b/xmlsecurity/inc/certificatechooser.hxx @@ -52,6 +52,7 @@ struct UserData enum class UserAction { Sign, + SelectSign, // Select signing certificate Encrypt }; diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 7b708b0c99aa..e814d681dd91 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -155,6 +155,8 @@ public: SAL_CALL chooseCertificate(OUString& rDescription) override; css::uno::Reference<css::security::XCertificate> SAL_CALL chooseSigningCertificate(OUString& rDescription) override; + css::uno::Reference<css::security::XCertificate> + SAL_CALL selectSigningCertificate(OUString& rDescription) override; css::uno::Sequence<css::uno::Reference<css::security::XCertificate>> SAL_CALL chooseEncryptionCertificate() override; css::uno::Reference<css::security::XCertificate> SAL_CALL chooseCertificateWithProps( @@ -651,6 +653,14 @@ Reference< css::security::XCertificate > DocumentDigitalSignatures::chooseSignin return xCert; } +Reference< css::security::XCertificate > DocumentDigitalSignatures::selectSigningCertificate(OUString& rDescription) +{ + std::map<OUString, OUString> aProperties; + Reference< css::security::XCertificate > xCert = chooseCertificatesImpl( aProperties, UserAction::SelectSign )[0]; + rDescription = aProperties["Description"]; + return xCert; +} + css::uno::Sequence< Reference< css::security::XCertificate > > DocumentDigitalSignatures::chooseEncryptionCertificate() { std::map<OUString, OUString> aProperties; diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index 2defc8e6a406..4900a8710d1f 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -168,6 +168,12 @@ void CertificateChooser::ImplInitialize() msPreferredKey = aUserOpts.GetSigningKey(); break; + case UserAction::SelectSign: + m_pFTSign->Show(); + m_pOKBtn->SetText( get<FixedText>("str_selectsign")->GetText() ); + msPreferredKey = aUserOpts.GetSigningKey(); + break; + case UserAction::Encrypt: m_pFTEncrypt->Show(); m_pFTDescription->Hide(); @@ -190,7 +196,7 @@ void CertificateChooser::ImplInitialize() uno::Sequence< uno::Reference< security::XCertificate > > xCerts; try { - if ( meAction == UserAction::Sign ) + if ( meAction == UserAction::Sign || meAction == UserAction::SelectSign) xCerts = secEnvironment->getPersonalCertificates(); else xCerts = secEnvironment->getAllCertificates(); @@ -235,7 +241,7 @@ void CertificateChooser::ImplInitialize() // only GPG has preferred keys if ( sIssuer == msPreferredKey ) { - if ( meAction == UserAction::Sign ) + if ( meAction == UserAction::Sign || meAction == UserAction::SelectSign ) m_pCertLB->Select( pEntry ); else if ( meAction == UserAction::Encrypt && aUserOpts.GetEncryptToSelf() ) diff --git a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui index cb2079263315..6bbc37546af4 100644 --- a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui +++ b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui @@ -188,6 +188,11 @@ <property name="hexpand">True</property> <property name="label" translatable="yes" context="selectcertificatedialog|str_sign">Sign</property> </object> + <object class="GtkLabel" id="str_selectsign"> + <property name="can_focus">False</property> + <property name="hexpand">True</property> + <property name="label" translatable="yes" context="selectcertificatedialog|str_selectsign">Select</property> + </object> <object class="GtkLabel" id="str_encrypt"> <property name="can_focus">False</property> <property name="hexpand">True</property> |