aboutsummaryrefslogtreecommitdiffstats
path: root/smime/gui
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2004-05-01 05:04:15 +0800
committerChris Toshok <toshok@src.gnome.org>2004-05-01 05:04:15 +0800
commit343d0d815a4b59c13316e7125ef392be7ccdefcb (patch)
tree118be876a19402602d108772a0324c869a9efe56 /smime/gui
parent5135f65c83b0256b275a4166c3dbfbe4315509b7 (diff)
downloadgsoc2013-evolution-343d0d815a4b59c13316e7125ef392be7ccdefcb.tar
gsoc2013-evolution-343d0d815a4b59c13316e7125ef392be7ccdefcb.tar.gz
gsoc2013-evolution-343d0d815a4b59c13316e7125ef392be7ccdefcb.tar.bz2
gsoc2013-evolution-343d0d815a4b59c13316e7125ef392be7ccdefcb.tar.lz
gsoc2013-evolution-343d0d815a4b59c13316e7125ef392be7ccdefcb.tar.xz
gsoc2013-evolution-343d0d815a4b59c13316e7125ef392be7ccdefcb.tar.zst
gsoc2013-evolution-343d0d815a4b59c13316e7125ef392be7ccdefcb.zip
[ fixes bug #52724 ]
2004-04-30 Chris Toshok <toshok@ximian.com> [ fixes bug #52724 ] * gui/ca-trust-dialog.c (ca_trust_dialog_set_trust): new function, set the toggle buttons' states. * gui/ca-trust-dialog.h (ca_trust_dialog_set_trust): add prototype. * gui/certificate-manager.c (edit_ca): flesh out the rest of the editing here. set the existing trust levels and get them back from the dialog when OK is clicked (and store them to the cert db.) svn path=/trunk/; revision=25726
Diffstat (limited to 'smime/gui')
-rw-r--r--smime/gui/ca-trust-dialog.c14
-rw-r--r--smime/gui/ca-trust-dialog.h1
-rw-r--r--smime/gui/certificate-manager.c27
3 files changed, 38 insertions, 4 deletions
diff --git a/smime/gui/ca-trust-dialog.c b/smime/gui/ca-trust-dialog.c
index 2e97653601..b59e189b9e 100644
--- a/smime/gui/ca-trust-dialog.c
+++ b/smime/gui/ca-trust-dialog.c
@@ -99,6 +99,20 @@ ca_trust_dialog_show (ECert *cert, gboolean importing)
}
void
+ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign)
+{
+ CATrustDialogData *ctd_data;
+
+ ctd_data = g_object_get_data (G_OBJECT (widget), "CATrustDialogData");
+ if (!ctd_data)
+ return;
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctd_data->ssl_checkbutton), ssl);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctd_data->email_checkbutton), email);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ctd_data->objsign_checkbutton), objsign);
+}
+
+void
ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign)
{
CATrustDialogData *ctd_data;
diff --git a/smime/gui/ca-trust-dialog.h b/smime/gui/ca-trust-dialog.h
index e15d98170a..8345da2901 100644
--- a/smime/gui/ca-trust-dialog.h
+++ b/smime/gui/ca-trust-dialog.h
@@ -28,6 +28,7 @@
GtkWidget* ca_trust_dialog_show (ECert *cert, gboolean importing);
+void ca_trust_dialog_set_trust (GtkWidget *widget, gboolean ssl, gboolean email, gboolean objsign);
void ca_trust_dialog_get_trust (GtkWidget *widget, gboolean *ssl, gboolean *email, gboolean *objsign);
#endif /* _CA_TRUST_DIALOG_H_ */
diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c
index a59f8a0d96..f291fffea4 100644
--- a/smime/gui/certificate-manager.c
+++ b/smime/gui/certificate-manager.c
@@ -487,10 +487,29 @@ edit_ca (GtkWidget *widget, CertificateManagerData *cfm)
if (cert) {
GtkWidget *dialog = ca_trust_dialog_show (cert, FALSE);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
-
- /* XXX more stuff here surely */
+ CERTCertificate *icert = e_cert_get_internal_cert (cert);
+
+ ca_trust_dialog_set_trust (dialog,
+ e_cert_trust_has_trusted_ca (icert->trust, TRUE, FALSE, FALSE),
+ e_cert_trust_has_trusted_ca (icert->trust, FALSE, TRUE, FALSE),
+ e_cert_trust_has_trusted_ca (icert->trust, FALSE, FALSE, TRUE));
+
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
+ gboolean trust_ssl, trust_email, trust_objsign;
+ CERTCertTrust trust;
+
+ ca_trust_dialog_get_trust (dialog,
+ &trust_ssl, &trust_email, &trust_objsign);
+
+ e_cert_trust_init (&trust);
+ e_cert_trust_set_valid_ca (&trust);
+ e_cert_trust_add_ca_trust (&trust,
+ trust_ssl,
+ trust_email,
+ trust_objsign);
+
+ CERT_ChangeCertTrust (e_cert_db_peek (), icert, &trust);
+ }
gtk_widget_destroy (dialog);
}