diff options
author | Christian Schaarschmidt <schaarsc@gmx.de> | 2014-06-30 17:44:24 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-06-30 17:44:24 +0800 |
commit | d252985f6fa1448283ab0f8be6508aff654af402 (patch) | |
tree | d8bd088d4ce3f29bc5be3d930ed94f7fb36c867b | |
parent | 4859c1a0835040b6d54eba276f51e161bdca38b2 (diff) | |
download | gsoc2013-evolution-d252985f6fa1448283ab0f8be6508aff654af402.tar gsoc2013-evolution-d252985f6fa1448283ab0f8be6508aff654af402.tar.gz gsoc2013-evolution-d252985f6fa1448283ab0f8be6508aff654af402.tar.bz2 gsoc2013-evolution-d252985f6fa1448283ab0f8be6508aff654af402.tar.lz gsoc2013-evolution-d252985f6fa1448283ab0f8be6508aff654af402.tar.xz gsoc2013-evolution-d252985f6fa1448283ab0f8be6508aff654af402.tar.zst gsoc2013-evolution-d252985f6fa1448283ab0f8be6508aff654af402.zip |
Bug 543572 - Display more information in a certificate selector
-rw-r--r-- | smime/gui/e-cert-selector.c | 29 | ||||
-rw-r--r-- | smime/gui/smime-ui.ui | 31 |
2 files changed, 17 insertions, 43 deletions
diff --git a/smime/gui/e-cert-selector.c b/smime/gui/e-cert-selector.c index a3d4d988d8..f18abd264f 100644 --- a/smime/gui/e-cert-selector.c +++ b/smime/gui/e-cert-selector.c @@ -36,6 +36,15 @@ #include "e-util/e-util.h" #include "e-util/e-util-private.h" +/* XXX Hack to disable p11-kit's pkcs11.h header, since + * NSS headers supply the same PKCS #11 definitions. */ +#define PKCS11_H 1 + +#define GCR_API_SUBJECT_TO_CHANGE +#include "gcr/gcr.h" + +#include "smime/lib/e-cert.h" + #define E_CERT_SELECTOR_GET_PRIVATE(obj) \ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_CERT_SELECTOR, ECertSelectorPrivate)) @@ -43,7 +52,8 @@ struct _ECertSelectorPrivate { CERTCertList *certlist; - GtkWidget *combobox, *description; + GtkWidget *combobox; + GcrCertificateWidget *cert_widget; }; enum { @@ -111,20 +121,13 @@ ecs_cert_changed (GtkWidget *w, { struct _ECertSelectorPrivate *p = ecs->priv; CERTCertListNode *node; - GtkTextBuffer *buffer; - GString *text; - text = g_string_new (""); node = ecs_find_current (ecs); if (node) { - /* FIXME: add serial no, validity date, uses */ - g_string_append_printf (text, _("Issued to:\n Subject: %s\n"), node->cert->subjectName); - g_string_append_printf (text, _("Issued by:\n Subject: %s\n"), node->cert->issuerName); + ECert *ecert = e_cert_new (CERT_DupCertificate ((CERTCertificate *) node->cert)); + gcr_certificate_widget_set_certificate (p->cert_widget, GCR_CERTIFICATE (ecert)); + g_object_unref (ecert); } - - buffer = gtk_text_view_get_buffer ((GtkTextView *) p->description); - gtk_text_buffer_set_text (buffer, text->str, text->len); - g_string_free (text, TRUE); } /** @@ -167,10 +170,12 @@ e_cert_selector_new (gint type, e_load_ui_builder_definition (builder, "smime-ui.ui"); p->combobox = e_builder_get_widget (builder, "cert_combobox"); - p->description = e_builder_get_widget (builder, "cert_description"); + p->cert_widget = gcr_certificate_widget_new (NULL); w = e_builder_get_widget (builder, "cert_selector_vbox"); content_area = gtk_dialog_get_content_area (GTK_DIALOG (ecs)); + gtk_container_add (GTK_CONTAINER (w), GTK_WIDGET (p->cert_widget)); + gtk_widget_show (GTK_WIDGET (p->cert_widget)); gtk_box_pack_start (GTK_BOX (content_area), w, TRUE, TRUE, 3); gtk_window_set_title (GTK_WINDOW (ecs), _("Select certificate")); diff --git a/smime/gui/smime-ui.ui b/smime/gui/smime-ui.ui index 021408705f..1473b95829 100644 --- a/smime/gui/smime-ui.ui +++ b/smime/gui/smime-ui.ui @@ -654,37 +654,6 @@ <property name="position">0</property> </packing> </child> - <child> - <object class="GtkFrame" id="frame7"> - <property name="visible">True</property> - <property name="label_xalign">0</property> - <child> - <object class="GtkScrolledWindow" id="scrolledwindow7"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="border_width">6</property> - <property name="hscrollbar_policy">automatic</property> - <property name="vscrollbar_policy">automatic</property> - <property name="shadow_type">in</property> - <child> - <object class="GtkTextView" id="cert_description"> - <property name="visible">True</property> - <property name="can_focus">True</property> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label68"> - <property name="visible">True</property> - <property name="label" translatable="yes">Certificate details</property> - </object> - </child> - </object> - <packing> - <property name="position">1</property> - </packing> - </child> </object> <object class="GtkDialog" id="cert-trust-dialog"> <property name="title" translatable="yes">Email Certificate Trust Settings</property> |