From 6c721ffaebd623d08ab1d11f7778779ad3c14486 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 25 Feb 2009 11:28:08 +0000 Subject: ** Fix for bug #572975 2009-02-25 Milan Crha ** Fix for bug #572975 * gui/smime-ui.glade: Center dialogs. * gui/certificate-manager.c: (import_your), (import_contact), (import_ca): Destroy file chooser dialog early enough to not have hidden any other windows below it. svn path=/trunk/; revision=37333 --- smime/gui/certificate-manager.c | 33 +++++++++++++++++++++------------ smime/gui/smime-ui.glade | 6 +++--- 2 files changed, 24 insertions(+), 15 deletions(-) (limited to 'smime/gui') diff --git a/smime/gui/certificate-manager.c b/smime/gui/certificate-manager.c index 546745199f..2bfeec3ed3 100644 --- a/smime/gui/certificate-manager.c +++ b/smime/gui/certificate-manager.c @@ -130,7 +130,6 @@ static void import_your (GtkWidget *widget, CertificateManagerData *cfm) { GtkWidget *filesel; - const char *filename; GtkFileFilter* filter; @@ -153,7 +152,10 @@ import_your (GtkWidget *widget, CertificateManagerData *cfm) gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filesel), filter); if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filesel)); + char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filesel)); + + /* destroy dialog to get rid of it in the GUI */ + gtk_widget_destroy (filesel); if (e_cert_db_import_pkcs12_file (e_cert_db_peek (), filename, NULL /* XXX */)) { @@ -163,9 +165,10 @@ import_your (GtkWidget *widget, CertificateManagerData *cfm) load_certs (cfm, E_CERT_USER, add_user_cert); gtk_tree_view_expand_all (GTK_TREE_VIEW (cfm->yourcerts_treeview)); } - } - gtk_widget_destroy (filesel); + g_free (filename); + } else + gtk_widget_destroy (filesel); } static void @@ -373,7 +376,6 @@ static void import_contact (GtkWidget *widget, CertificateManagerData *cfm) { GtkWidget *filesel; - const char *filename; GtkFileFilter *filter; @@ -396,7 +398,10 @@ import_contact (GtkWidget *widget, CertificateManagerData *cfm) gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filesel), filter); if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filesel)); + char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filesel)); + + /* destroy dialog to get rid of it in the GUI */ + gtk_widget_destroy (filesel); if (e_cert_db_import_certs_from_file (e_cert_db_peek (), filename, @@ -409,9 +414,10 @@ import_contact (GtkWidget *widget, CertificateManagerData *cfm) load_certs (cfm, E_CERT_CONTACT, add_contact_cert); gtk_tree_view_expand_all (GTK_TREE_VIEW (cfm->contactcerts_treeview)); } - } - gtk_widget_destroy (filesel); + g_free (filename); + } else + gtk_widget_destroy (filesel); } static void @@ -597,7 +603,6 @@ static void import_ca (GtkWidget *widget, CertificateManagerData *cfm) { GtkWidget *filesel; - const char *filename; GtkFileFilter *filter; @@ -620,7 +625,10 @@ import_ca (GtkWidget *widget, CertificateManagerData *cfm) gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (filesel), filter); if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (filesel))) { - filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filesel)); + char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filesel)); + + /* destroy dialog to get rid of it in the GUI */ + gtk_widget_destroy (filesel); if (e_cert_db_import_certs_from_file (e_cert_db_peek (), filename, @@ -632,9 +640,10 @@ import_ca (GtkWidget *widget, CertificateManagerData *cfm) unload_certs (cfm, E_CERT_CA); load_certs (cfm, E_CERT_CA, add_ca_cert); } - } - gtk_widget_destroy (filesel); + g_free (filename); + } else + gtk_widget_destroy (filesel); } static void diff --git a/smime/gui/smime-ui.glade b/smime/gui/smime-ui.glade index 2ea8fe3b8d..41d119f2ce 100644 --- a/smime/gui/smime-ui.glade +++ b/smime/gui/smime-ui.glade @@ -6,7 +6,7 @@ dialog1 GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE + GTK_WIN_POS_CENTER False True False @@ -1850,7 +1850,7 @@ Certificate Authority Trust GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE + GTK_WIN_POS_CENTER False True False @@ -2173,7 +2173,7 @@ Email Certificate Trust Settings GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE + GTK_WIN_POS_CENTER False True False -- cgit