diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-09-05 05:07:15 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-09-05 05:07:15 +0800 |
commit | 983fce5e535e4e203815767cf6899f6dc8c5242a (patch) | |
tree | d6ca3538c046798597275132c66be6da18733d7f /mail/em-folder-utils.c | |
parent | c95a226217a68703c48397c23ea8accc491d44e4 (diff) | |
download | gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.gz gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.zst gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.zip |
Kill the default parent window hack in e-error.c.
Fix as many cases that relied on it as I could find, but there may be
more cases out there. They should be fixed too. Passing a NULL parent
window to e_error_new() is illegal and will emit a runtime warning.
Diffstat (limited to 'mail/em-folder-utils.c')
-rw-r--r-- | mail/em-folder-utils.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index 700e445beb..0379607bc0 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -290,8 +290,18 @@ emfu_copy_folder_selected (const gchar *uri, gpointer data) } if (cfd->delete && fromstore == local_store && emfu_is_special_local_folder (cfd->fi->full_name)) { - GtkWidget *w = e_error_new (NULL, - "mail:no-rename-special-folder", cfd->fi->full_name, NULL); + EShell *shell; + GtkWindow *parent; + GtkWidget *w; + GList *windows; + + shell = e_shell_get_default (); + windows = e_shell_get_watched_windows (shell); + parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL; + + w = e_error_new ( + parent, "mail:no-rename-special-folder", + cfd->fi->full_name, NULL); em_utils_show_error_silent (w); goto fail; } @@ -379,8 +389,18 @@ emfu_delete_done (CamelFolder *folder, gboolean removed, CamelException *ex, gpo GtkWidget *dialog = data; if (ex && camel_exception_is_set (ex)) { - GtkWidget *w = e_error_new (NULL, - "mail:no-delete-folder", folder->full_name, camel_exception_get_description (ex), NULL); + EShell *shell; + GtkWindow *parent; + GtkWidget *w; + GList *windows; + + shell = e_shell_get_default (); + windows = e_shell_get_watched_windows (shell); + parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL; + + w = e_error_new ( + parent, "mail:no-delete-folder", + folder->full_name, camel_exception_get_description (ex), NULL); em_utils_show_error_silent (w); camel_exception_clear (ex); } @@ -406,14 +426,23 @@ emfu_delete_response (GtkWidget *dialog, gint response, gpointer data) void em_folder_utils_delete_folder (CamelFolder *folder) { + EShell *shell; + GtkWindow *parent; CamelStore *local_store; GtkWidget *dialog; + GList *windows; gint flags = 0; + shell = e_shell_get_default (); + windows = e_shell_get_watched_windows (shell); + parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL; + local_store = e_mail_local_get_store (); if (folder->parent_store == local_store && emfu_is_special_local_folder (folder->full_name)) { - dialog = e_error_new (NULL, "mail:no-delete-special-folder", folder->full_name, NULL); + dialog = e_error_new ( + parent, "mail:no-delete-special-folder", + folder->full_name, NULL); em_utils_show_error_silent (dialog); return; } @@ -426,7 +455,7 @@ em_folder_utils_delete_folder (CamelFolder *folder) camel_object_ref (folder); - dialog = e_error_new(NULL, + dialog = e_error_new (parent, (folder->parent_store && CAMEL_IS_VEE_STORE(folder->parent_store))?"mail:ask-delete-vfolder":"mail:ask-delete-folder", folder->full_name, NULL); g_object_set_data_full ((GObject *) dialog, "folder", folder, camel_object_unref); |