aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-10-13 22:24:10 +0800
committerMilan Crha <mcrha@redhat.com>2009-10-13 22:24:10 +0800
commite06b88c4fda627599d7c1a33ddec0a35a4374e4f (patch)
treea862b4d3909923719ab03936ec60dfc00f185ba8 /shell
parentdc2953040b0fb9576411d2f145e7e6ff11dd989a (diff)
downloadgsoc2013-evolution-e06b88c4fda627599d7c1a33ddec0a35a4374e4f.tar.gz
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.c4
-rw-r--r--shell/e-shell-migrate.c8
-rw-r--r--shell/e-shell.c27
-rw-r--r--shell/e-shell.h1
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);