From d3d4fbbe25bccb73bfadef4f5b60a5c9f44aae2b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 14 Jul 2010 10:38:47 -0400 Subject: Bug 624237 - Fails to start when smartcard is inserted --- smime/gui/certificate-manager.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'smime') diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 9c28945c42..e35bb1d5fd 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -1069,9 +1069,11 @@ load_certs (CertificateManagerData *cfm, CERT_DestroyCertList (certList); } -static void +static gboolean populate_ui (CertificateManagerData *cfm) { + /* This is an idle callback. */ + unload_certs (cfm, E_CERT_USER); load_certs (cfm, E_CERT_USER, add_user_cert); @@ -1084,6 +1086,8 @@ populate_ui (CertificateManagerData *cfm) /* expand all three trees */ gtk_tree_view_expand_all (GTK_TREE_VIEW (cfm->yourcerts_treeview)); gtk_tree_view_expand_all (GTK_TREE_VIEW (cfm->contactcerts_treeview)); + + return FALSE; } void @@ -1128,7 +1132,11 @@ certificate_manager_config_init (EShell *shell) initialize_contactcerts_ui(cfm_data); initialize_authoritycerts_ui(cfm_data); - populate_ui (cfm_data); + /* Run this in an idle callback so Evolution has a chance to + * fully initialize itself and start its main loop before we + * load certificates, since doing so may trigger a password + * dialog, and dialogs require a main loop. */ + g_idle_add ((GSourceFunc) populate_ui, cfm_data); widget = e_builder_get_widget (cfm_data->builder, "cert-manager-notebook"); g_object_ref (widget); -- cgit v1.2.3