summaryrefslogtreecommitdiff
path: root/xmlsecurity/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-13 11:49:34 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-02-14 13:06:03 +0100
commit762740f6dbbb3818323dc33f0062cf27ab8fd638 (patch)
treeb7ff003c7157e1fe7479a27b7693c86ddbf419ad /xmlsecurity/inc
parentf7ec0b0ac40045450bd86b73ca59b32a15bc8346 (diff)
weld CertificateChooser
Change-Id: I46087a58d5cff7ea8ac86ef8ee670cc4a59d0120 Reviewed-on: https://gerrit.libreoffice.org/67795 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmlsecurity/inc')
-rw-r--r--xmlsecurity/inc/certificatechooser.hxx42
-rw-r--r--xmlsecurity/inc/certificateviewer.hxx2
-rw-r--r--xmlsecurity/inc/strings.hrc11
3 files changed, 29 insertions, 26 deletions
diff --git a/xmlsecurity/inc/certificatechooser.hxx b/xmlsecurity/inc/certificatechooser.hxx
index d01b95edda24..b98b30fdc6b3 100644
--- a/xmlsecurity/inc/certificatechooser.hxx
+++ b/xmlsecurity/inc/certificatechooser.hxx
@@ -20,16 +20,12 @@
#ifndef INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX
#define INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX
-#include <svtools/simptabl.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
#include <com/sun/star/xml/crypto/XXMLSecurityContext.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <svl/sigstruct.hxx>
-
+#include <vcl/weld.hxx>
namespace com {
namespace sun {
@@ -40,8 +36,6 @@ namespace xml { namespace crypto {
class XSecurityEnvironment; }}
}}}
-class HeaderBar;
-
struct UserData
{
css::uno::Reference<css::security::XCertificate> xCertificate;
@@ -56,45 +50,43 @@ enum class UserAction
Encrypt
};
-class CertificateChooser : public ModalDialog
+class CertificateChooser : public weld::GenericDialogController
{
private:
css::uno::Reference< css::uno::XComponentContext > mxCtx;
std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > mxSecurityContexts;
std::vector<std::shared_ptr<UserData>> mvUserData;
- VclPtr<FixedText> m_pFTSign;
- VclPtr<FixedText> m_pFTEncrypt;
-
- VclPtr<SvSimpleTable> m_pCertLB;
- VclPtr<PushButton> m_pViewBtn;
- VclPtr<OKButton> m_pOKBtn;
- VclPtr<FixedText> m_pFTDescription;
- VclPtr<Edit> m_pDescriptionED;
-
bool mbInitialized;
UserAction const meAction;
OUString msPreferredKey;
css::uno::Reference<css::security::XCertificate> mxEncryptToSelf;
- DECL_LINK(ViewButtonHdl, Button*, void);
- DECL_LINK(CertificateHighlightHdl, SvTreeListBox*, void );
- DECL_LINK(CertificateSelectHdl, SvTreeListBox*, bool );
+ std::unique_ptr<weld::Label> m_xFTSign;
+ std::unique_ptr<weld::Label> m_xFTEncrypt;
+ std::unique_ptr<weld::TreeView> m_xCertLB;
+ std::unique_ptr<weld::Button> m_xViewBtn;
+ std::unique_ptr<weld::Button> m_xOKBtn;
+ std::unique_ptr<weld::Label> m_xFTDescription;
+ std::unique_ptr<weld::Entry> m_xDescriptionED;
+
+ DECL_LINK(ViewButtonHdl, weld::Button&, void);
+ DECL_LINK(CertificateHighlightHdl, weld::TreeView&, void);
+ DECL_LINK(CertificateSelectHdl, weld::TreeView&, void);
void ImplShowCertificateDetails();
void ImplInitialize();
- void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name);
+ static void HandleOneUsageBit(OUString& string, int& bits, int bit, const char *name);
public:
- CertificateChooser(vcl::Window* pParent,
+ CertificateChooser(weld::Window* pParent,
css::uno::Reference< css::uno::XComponentContext> const & rxCtx,
std::vector< css::uno::Reference< css::xml::crypto::XXMLSecurityContext > > const & rxSecurityContexts,
UserAction eAction);
virtual ~CertificateChooser() override;
- virtual void dispose() override;
- short Execute() override;
+ short run() override;
css::uno::Sequence<css::uno::Reference< css::security::XCertificate > > GetSelectedCertificates();
css::uno::Reference< css::xml::crypto::XXMLSecurityContext > GetSelectedSecurityContext();
@@ -104,7 +96,7 @@ public:
/// Returns the usage string of the selected certificate, if any.
OUString GetUsageText();
- OUString UsageInClearText(int bits);
+ static OUString UsageInClearText(int bits);
};
#endif // INCLUDED_XMLSECURITY_INC_CERTIFICATECHOOSER_HXX
diff --git a/xmlsecurity/inc/certificateviewer.hxx b/xmlsecurity/inc/certificateviewer.hxx
index 9f816c9a0671..a117ad39cbb8 100644
--- a/xmlsecurity/inc/certificateviewer.hxx
+++ b/xmlsecurity/inc/certificateviewer.hxx
@@ -53,7 +53,7 @@ private:
css::uno::Reference< css::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
css::uno::Reference< css::security::XCertificate > mxCert;
- VclPtr<CertificateChooser> mpParentChooser;
+ CertificateChooser* mpParentChooser;
std::unique_ptr<weld::Notebook> mxTabCtrl;
diff --git a/xmlsecurity/inc/strings.hrc b/xmlsecurity/inc/strings.hrc
index c44617e10fed..deed17e9e1a2 100644
--- a/xmlsecurity/inc/strings.hrc
+++ b/xmlsecurity/inc/strings.hrc
@@ -51,6 +51,17 @@
#define RID_XMLSECWB_NO_MOZILLA_PROFILE NC_("RID_XMLSECWB_NO_MOZILLA_PROFILE", "Digital signatures functionality could not be used, because no Mozilla user profile was found. Please check the Mozilla installation.")
+#define STR_DIGITAL_SIGNATURE NC_("selectcertificatedialog|STR_DIGITAL_SIGNATURE", "Digital signature")
+#define STR_NON_REPUDIATION NC_("selectcertificatedialog|STR_NON_REPUDIATION", "Non-repudiation")
+#define STR_KEY_ENCIPHERMENT NC_("selectcertificatedialog|STR_KEY_ENCIPHERMENT", "Key encipherment")
+#define STR_DATA_ENCIPHERMENT NC_("selectcertificatedialog|STR_DATA_ENCIPHERMENT", "Data encipherment")
+#define STR_KEY_AGREEMENT NC_("selectcertificatedialog|STR_KEY_AGREEMENT", "Key Agreement")
+#define STR_KEY_CERT_SIGN NC_("selectcertificatedialog|STR_KEY_CERT_SIGN", "Certificate signature verification")
+#define STR_CRL_SIGN NC_("selectcertificatedialog|STR_CRL_SIGN", "CRL signature verification")
+#define STR_ENCIPHER_ONLY NC_("selectcertificatedialog|STR_ENCIPHER_ONLY", "Only for encipherment")
+#define STR_SIGN NC_("selectcertificatedialog|str_sign", "Sign")
+#define STR_SELECTSIGN NC_("selectcertificatedialog|str_selectsign", "Select")
+#define STR_ENCRYPT NC_("selectcertificatedialog|str_encrypt", "Encrypt")
#endif