summaryrefslogtreecommitdiffstats
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-06 09:07:46 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-06 09:43:27 +0100
commitef16f72de9e7abf563239b2ff4083a73430f839f (patch)
tree41d7c9641c1944969520619b0fbdbf3ce41db08e /xmlsecurity
parenttdf#92045 DOCX import: <w:effect w:val="none"/> doesn't mean blinking (diff)
downloadcore-ef16f72de9e7abf563239b2ff4083a73430f839f.tar.gz
core-ef16f72de9e7abf563239b2ff4083a73430f839f.zip
xmlsecurity: add UI to provide a description when signing
Change-Id: I6fdbcb342d06e05b4965ccf7f593ac130426828a
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/xmlsecurity/certificatechooser.hxx3
-rw-r--r--xmlsecurity/source/dialogs/certificatechooser.cxx7
-rw-r--r--xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx1
-rw-r--r--xmlsecurity/uiconfig/ui/selectcertificatedialog.ui34
4 files changed, 45 insertions, 0 deletions
diff --git a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx
index 25f0c60032d8..24b86372a9fa 100644
--- a/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx
+++ b/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx
@@ -51,6 +51,7 @@ private:
VclPtr<SvSimpleTable> m_pCertLB;
VclPtr<PushButton> m_pViewBtn;
VclPtr<OKButton> m_pOKBtn;
+ VclPtr<Edit> m_pDescriptionED;
bool mbInitialized;
@@ -71,6 +72,8 @@ public:
short Execute() override;
css::uno::Reference< css::security::XCertificate > GetSelectedCertificate();
+ /// Gets the description string provided when selecting the certificate.
+ OUString GetDescription();
};
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 8728c6f3a2da..fcffef660cb0 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -54,6 +54,7 @@ CertificateChooser::CertificateChooser( vcl::Window* _pParent, uno::Reference< u
{
get(m_pOKBtn, "ok");
get(m_pViewBtn, "viewcert");
+ get(m_pDescriptionED, "description");
Size aControlSize(275, 122);
const long nControlWidth = aControlSize.Width();
@@ -199,11 +200,17 @@ uno::Reference< css::security::XCertificate > CertificateChooser::GetSelectedCer
return xCert;
}
+OUString CertificateChooser::GetDescription()
+{
+ return m_pDescriptionED->GetText();
+}
+
IMPL_LINK_NOARG_TYPED(CertificateChooser, CertificateHighlightHdl, SvTreeListBox*, void)
{
bool bEnable = GetSelectedCertificate().is();
m_pViewBtn->Enable( bEnable );
m_pOKBtn->Enable( bEnable );
+ m_pDescriptionED->Enable(bEnable);
}
IMPL_LINK_NOARG_TYPED(CertificateChooser, CertificateSelectHdl, SvTreeListBox*, bool)
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index 872cd903668a..70d1d9b5d9a6 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -469,6 +469,7 @@ IMPL_LINK_NOARG_TYPED(DigitalSignaturesDialog, AddButtonHdl, Button*, void)
}
maSignatureHelper.SetDateTime( nSecurityId, Date( Date::SYSTEM ), tools::Time( tools::Time::SYSTEM ) );
+ maSignatureHelper.SetDescription(nSecurityId, aChooser->GetDescription());
// We open a signature stream in which the existing and the new
//signature is written. ImplGetSignatureInformation (later in this function) will
diff --git a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
index adda450c6d76..1869bb874080 100644
--- a/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
+++ b/xmlsecurity/uiconfig/ui/selectcertificatedialog.ui
@@ -165,6 +165,40 @@
<property name="top_attach">3</property>
</packing>
</child>
+ <child>
+ <object class="GtkBox" id="dialog-hbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Description:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="description">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">4</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">True</property>