diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-28 15:52:37 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-28 15:52:37 +0800 |
commit | 1dc76861d81c012c80871738ae6d18ed4fc881fe (patch) | |
tree | 0370aa975a8c377549f53d9bb99fc6b6d1fbcc70 /smime/gui/ca-trust-dialog.c | |
parent | 80b2ded553a96ab787d327a928d4db11fb0264b2 (diff) | |
download | gsoc2013-evolution-1dc76861d81c012c80871738ae6d18ed4fc881fe.tar.gz gsoc2013-evolution-1dc76861d81c012c80871738ae6d18ed4fc881fe.tar.zst gsoc2013-evolution-1dc76861d81c012c80871738ae6d18ed4fc881fe.zip |
** See bugs #52061 & #52669.
2004-05-28 Not Zed <NotZed@Ximian.com>
** See bugs #52061 & #52669.
* gui/smime-ui.glade: added cert-trust-dialog and tweaked the
ca-trust-dialog.
* gui/ca-trust-dialog.c (ca_trust_dialog_show): Fix the %s in the
label. Slack.
(ca_trust_dialog_show): slight rearrangement.
* gui/certificate-manager.c (add_contact_cert): fill out fields.
* lib/e-cert.c (e_cert_get_usage): helper to get the usage of a
cert.
* gui/certificate-manager.c (edit_ca): use the right certdb, not
the e-one.
(add_user_cert): fill out missing columns.
* lib/e-cert.c (e_cert_get_ca_cert): new method to find the ca
cert of a cert.
* gui/cert-trust-dialog.[ch]: peer cert trust editor.
* gui/certificate-manager.c (edit_contact): implement.
svn path=/trunk/; revision=26119
Diffstat (limited to 'smime/gui/ca-trust-dialog.c')
-rw-r--r-- | smime/gui/ca-trust-dialog.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/smime/gui/ca-trust-dialog.c b/smime/gui/ca-trust-dialog.c index b59e189b9e..b0dc07001e 100644 --- a/smime/gui/ca-trust-dialog.c +++ b/smime/gui/ca-trust-dialog.c @@ -41,13 +41,12 @@ typedef struct { GtkWidget *ssl_checkbutton; GtkWidget *email_checkbutton; GtkWidget *objsign_checkbutton; - GtkWidget *view_cert_button; ECert *cert; } CATrustDialogData; static void -free_data (gpointer data, GObject *where_the_object_was) +free_data (gpointer data) { CATrustDialogData *ctd = data; @@ -57,21 +56,26 @@ free_data (gpointer data, GObject *where_the_object_was) } static void -view_cert (GtkWidget *button, CATrustDialogData *data) +catd_response(GtkWidget *w, guint id, CATrustDialogData *data) { - GtkWidget *dialog = certificate_viewer_show (data->cert); - - gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->dialog)); - - gtk_dialog_run (GTK_DIALOG (dialog)); - - gtk_widget_destroy (dialog); + switch (id) { + case GTK_RESPONSE_ACCEPT: { + GtkWidget *dialog = certificate_viewer_show (data->cert); + + g_signal_stop_emission_by_name(w, "response"); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->dialog)); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + break; } + } } GtkWidget* ca_trust_dialog_show (ECert *cert, gboolean importing) { CATrustDialogData *ctd_data; + GtkWidget *w; + char *txt; ctd_data = g_new0 (CATrustDialogData, 1); ctd_data->gui = glade_xml_new (EVOLUTION_GLADEDIR "/" GLADE_FILE_NAME, NULL, NULL); @@ -82,18 +86,15 @@ ca_trust_dialog_show (ECert *cert, gboolean importing) ctd_data->ssl_checkbutton = glade_xml_get_widget (ctd_data->gui, "ssl_trust_checkbutton"); ctd_data->email_checkbutton = glade_xml_get_widget (ctd_data->gui, "email_trust_checkbutton"); ctd_data->objsign_checkbutton = glade_xml_get_widget (ctd_data->gui, "objsign_trust_checkbutton"); - ctd_data->view_cert_button = glade_xml_get_widget (ctd_data->gui, "view_certificate_button"); - - g_signal_connect (ctd_data->view_cert_button, - "clicked", G_CALLBACK (view_cert), - ctd_data); - gtk_widget_realize (ctd_data->dialog); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (ctd_data->dialog)->action_area), 12); + w = glade_xml_get_widget(ctd_data->gui, "ca-trust-label"); + txt = g_strdup_printf(_("Certificate '%s' is a CA certificate.\n\nEdit trust settings:"), e_cert_get_cn(cert)); + gtk_label_set_text((GtkLabel *)w, txt); + g_free(txt); - g_object_weak_ref (G_OBJECT (ctd_data->dialog), free_data, ctd_data); + g_signal_connect (ctd_data->dialog, "response", G_CALLBACK (catd_response), ctd_data); - g_object_set_data (G_OBJECT (ctd_data->dialog), "CATrustDialogData", ctd_data); + g_object_set_data_full (G_OBJECT (ctd_data->dialog), "CATrustDialogData", ctd_data, free_data); return ctd_data->dialog; } |