aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-mt.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-05 05:07:15 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-05 05:07:15 +0800
commit983fce5e535e4e203815767cf6899f6dc8c5242a (patch)
treed6ca3538c046798597275132c66be6da18733d7f /mail/mail-mt.c
parentc95a226217a68703c48397c23ea8accc491d44e4 (diff)
downloadgsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.gz
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.bz2
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.lz
gsoc2013-evolution-983fce5e535e4e203815767cf6899f6dc8c5242a.tar.xz
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/mail-mt.c')
-rw-r--r--mail/mail-mt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 7281ce63a4..6c25d7ab8e 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -292,9 +292,12 @@ static void error_response(GtkObject *o, gint button, gpointer data)
void
mail_msg_check_error (gpointer msg)
{
+ EShell *shell;
+ GtkWindow *parent;
MailMsg *m = msg;
gchar *what;
GtkDialog *gd;
+ GList *windows;
#ifdef MALLOC_CHECK
checkmem(m);
@@ -322,12 +325,16 @@ mail_msg_check_error (gpointer msg)
return;
}
+ shell = e_shell_get_default ();
+ windows = e_shell_get_watched_windows (shell);
+ parent = (windows != NULL) ? GTK_WINDOW (windows->data) : NULL;
+
if (m->info->desc
&& (what = m->info->desc (m))) {
- gd = (GtkDialog *)e_error_new(NULL, "mail:async-error", what, camel_exception_get_description(&m->ex), NULL);
+ gd = (GtkDialog *)e_error_new(parent, "mail:async-error", what, camel_exception_get_description(&m->ex), NULL);
g_free(what);
} else
- gd = (GtkDialog *)e_error_new(NULL, "mail:async-error-nodescribe", camel_exception_get_description(&m->ex), NULL);
+ gd = (GtkDialog *)e_error_new(parent, "mail:async-error-nodescribe", camel_exception_get_description(&m->ex), NULL);
g_hash_table_insert(active_errors, m->info, gd);
g_signal_connect(gd, "response", G_CALLBACK(error_response), m->info);