diff options
author | Milan Crha <mcrha@redhat.com> | 2009-10-13 22:24:10 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-10-13 22:24:10 +0800 |
commit | e06b88c4fda627599d7c1a33ddec0a35a4374e4f (patch) | |
tree | a862b4d3909923719ab03936ec60dfc00f185ba8 /shell | |
parent | dc2953040b0fb9576411d2f145e7e6ff11dd989a (diff) | |
download | gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.gz gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.bz2 gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.lz gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.xz gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.zst gsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.zip |
Bug #594471 - Shouldn't call e_error_new/run with NULL 'parent'
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-content.c | 4 | ||||
-rw-r--r-- | shell/e-shell-migrate.c | 8 | ||||
-rw-r--r-- | shell/e-shell.c | 27 | ||||
-rw-r--r-- | shell/e-shell.h | 1 |
4 files changed, 34 insertions, 6 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 821f683d96..6761af7296 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -1384,7 +1384,7 @@ run: if (response != GTK_RESPONSE_OK && response != GTK_RESPONSE_APPLY) goto exit; - if (!filter_rule_validate (rule)) + if (!filter_rule_validate (rule, GTK_WINDOW (dialog))) goto run; e_shell_content_set_search_rule (shell_content, rule); @@ -1486,7 +1486,7 @@ run: if (response != GTK_RESPONSE_OK) goto exit; - if (!filter_rule_validate (rule)) + if (!filter_rule_validate (rule, GTK_WINDOW (dialog))) goto run; rule_context_add_rule (context, rule); diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 10cea586b6..a330d9d1a5 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -71,7 +71,7 @@ shell_migrate_attempt (EShell *shell, gint response; response = e_error_run ( - NULL, "shell:upgrade-failed", + e_shell_get_active_window (shell), "shell:upgrade-failed", error->message, NULL); if (response == GTK_RESPONSE_CANCEL) @@ -243,7 +243,7 @@ e_shell_migrate_attempt (EShell *shell) have = g_strdup_printf (_("%ld KB"), avail); e_error_run ( - NULL, "shell:upgrade-nospace", + e_shell_get_active_window (shell), "shell:upgrade-nospace", need, have, NULL); g_free (need); @@ -286,13 +286,13 @@ check_old: string = g_strdup_printf ( "%d.%d.%d", last_major, last_minor, last_micro); response = e_error_run ( - NULL, "shell:upgrade-remove-1-4", string, NULL); + e_shell_get_active_window (shell), "shell:upgrade-remove-1-4", string, NULL); g_free (string); switch (response) { case GTK_RESPONSE_OK: /* delete */ response = e_error_run ( - NULL, + e_shell_get_active_window (shell), "shell:upgrade-remove-1-4-confirm", NULL); if (response == GTK_RESPONSE_OK) diff --git a/shell/e-shell.c b/shell/e-shell.c index bf664649fc..924441fa56 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -1348,6 +1348,33 @@ e_shell_get_watched_windows (EShell *shell) } /** + * e_shell_get_active_window: + * @shell: an #EShell; can be NULL, in that case is used + * result of @e_shell_get_default + * + * Returns: an active, the most recently focused, window. + **/ +GtkWindow * +e_shell_get_active_window (EShell *shell) +{ + GList *w; + GtkWindow *window = NULL; + + if (!shell) + shell = e_shell_get_default (); + + g_return_val_if_fail (shell != NULL, NULL); + + for (w = e_shell_get_watched_windows (shell); w && !window; w = w->next) { + window = GTK_WINDOW (w->data); + } + + g_return_val_if_fail (window != NULL, NULL); + + return window; +} + +/** * e_shell_send_receive: * @shell: an #EShell * @parent: the parent #GtkWindow diff --git a/shell/e-shell.h b/shell/e-shell.h index 818607e1fb..2872608809 100644 --- a/shell/e-shell.h +++ b/shell/e-shell.h @@ -92,6 +92,7 @@ guint e_shell_handle_uris (EShell *shell, void e_shell_watch_window (EShell *shell, GtkWindow *window); GList * e_shell_get_watched_windows (EShell *shell); +GtkWindow * e_shell_get_active_window (EShell *shell); void e_shell_send_receive (EShell *shell, GtkWindow *parent); gboolean e_shell_get_network_available (EShell *shell); |