aboutsummaryrefslogtreecommitdiffstats
path: root/smime
diff options
context:
space:
mode:
Diffstat (limited to 'smime')
-rw-r--r--smime/ChangeLog9
-rw-r--r--smime/gui/certificate-viewer.c8
-rw-r--r--smime/lib/e-cert.c18
-rw-r--r--smime/lib/e-cert.h1
4 files changed, 30 insertions, 6 deletions
diff --git a/smime/ChangeLog b/smime/ChangeLog
index c5b644d9a2..b82a4c6fa0 100644
--- a/smime/ChangeLog
+++ b/smime/ChangeLog
@@ -1,5 +1,14 @@
2003-12-04 Chris Toshok <toshok@ximian.com>
+ * gui/certificate-viewer.c (certificate_viewer_show): set the
+ window title based on e_cert_get_window_title.
+
+ * lib/e-cert.c (e_cert_get_window_title): new function, for use
+ with the certificate viewer.
+ (create_asn1_struct): call e_cert_get_window_title.
+
+2003-12-04 Chris Toshok <toshok@ximian.com>
+
* lib/e-cert.h: add prototype for e_cert_get_asn1_struct.
* lib/e-cert.c (e_cert_dispose): unref the asn1 object.
diff --git a/smime/gui/certificate-viewer.c b/smime/gui/certificate-viewer.c
index e897597319..792ccab01a 100644
--- a/smime/gui/certificate-viewer.c
+++ b/smime/gui/certificate-viewer.c
@@ -271,12 +271,20 @@ GtkWidget*
certificate_viewer_show (ECert *cert)
{
CertificateViewerData *cvm_data;
+ char *title;
cvm_data = g_new0 (CertificateViewerData, 1);
cvm_data->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL);
cvm_data->dialog = glade_xml_get_widget (cvm_data->gui, "certificate-viewer-dialog");
+ title = g_strdup_printf (_("Certificate Viewer: %s"), e_cert_get_window_title (cert));
+
+ gtk_window_set_title (GTK_WINDOW (cvm_data->dialog),
+ title);
+
+ g_free (title);
+
fill_in_general (cvm_data, cert);
fill_in_details (cvm_data, cert);
diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c
index 173f445c22..b2f4c71769 100644
--- a/smime/lib/e-cert.c
+++ b/smime/lib/e-cert.c
@@ -313,6 +313,17 @@ e_cert_get_raw_der (ECert *cert, char **data, guint32 *len)
}
const char*
+e_cert_get_window_title (ECert *cert)
+{
+ if (cert->priv->cert->nickname)
+ return cert->priv->cert->nickname;
+ else if (cert->priv->cn)
+ return cert->priv->cn;
+ else
+ return cert->priv->cert->subjectName;
+}
+
+const char*
e_cert_get_nickname (ECert *cert)
{
return cert->priv->cert->nickname;
@@ -1128,12 +1139,7 @@ create_asn1_struct (ECert *cert)
cert->priv->asn1 = e_asn1_object_new ();
- if (cert->priv->cert->nickname)
- e_asn1_object_set_display_name (cert->priv->asn1, cert->priv->cert->nickname);
- else if (cert->priv->cn)
- e_asn1_object_set_display_name (cert->priv->asn1, cert->priv->cn);
- else
- e_asn1_object_set_display_name (cert->priv->asn1, cert->priv->cert->subjectName);
+ e_asn1_object_set_display_name (cert->priv->asn1, e_cert_get_window_title (cert));
/* This sequence will be contain the tbsCertificate, signatureAlgorithm,
and signatureValue. */
diff --git a/smime/lib/e-cert.h b/smime/lib/e-cert.h
index d18e0a9486..243ce1539b 100644
--- a/smime/lib/e-cert.h
+++ b/smime/lib/e-cert.h
@@ -71,6 +71,7 @@ ECert* e_cert_new_from_der (char *data, guint32 len);
CERTCertificate* e_cert_get_internal_cert (ECert *cert);
gboolean e_cert_get_raw_der (ECert *cert, char **data, guint32 *len);
+const char* e_cert_get_window_title (ECert *cert);
const char* e_cert_get_nickname (ECert *cert);
const char* e_cert_get_email (ECert *cert);
const char* e_cert_get_org (ECert *cert);