From 0da239224f119664577c0d5dc47cab2632b083be Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 24 Nov 2009 16:55:54 -0600 Subject: port shell/ over to the new EError API https://bugzilla.gnome.org/show_bug.cgi?id=602963 --- shell/Makefile.am | 1 + shell/e-shell-content.c | 14 ++++++++++++-- shell/e-shell-migrate.c | 8 ++++---- shell/e-shell-window-actions.c | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) (limited to 'shell') diff --git a/shell/Makefile.am b/shell/Makefile.am index 6ff40baab7..eacf65d18d 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -134,6 +134,7 @@ evolution_LDADD = \ $(top_builddir)/widgets/menus/libmenus.la \ $(top_builddir)/widgets/misc/libemiscwidgets.la \ $(top_builddir)/e-util/libeutil.la \ + $(top_builddir)/filter/libfilter.la \ $(TZDIALOG_LIBS) \ $(SHELL_LIBS) \ $(EVOLUTIONICONRC) diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 3640a2a5f4..e10d1094c6 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -1472,6 +1472,7 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content) ERuleContext *context; const gchar *user_filename; gint response; + EError *error = NULL; g_return_if_fail (E_IS_SHELL_CONTENT (shell_content)); @@ -1516,8 +1517,12 @@ run: if (response != GTK_RESPONSE_OK && response != GTK_RESPONSE_APPLY) goto exit; - if (!e_filter_rule_validate (rule, GTK_WINDOW (dialog))) + if (!e_filter_rule_validate (rule, &error)) { + e_error_run_dialog (GTK_WINDOW (dialog), error); + e_error_free (error); + error = NULL; goto run; + } e_shell_content_set_search_rule (shell_content, rule); @@ -1571,6 +1576,7 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content) const gchar *user_filename; gchar *search_name; gint response; + EError *error = NULL; g_return_if_fail (E_IS_SHELL_CONTENT (shell_content)); @@ -1619,8 +1625,12 @@ run: if (response != GTK_RESPONSE_OK) goto exit; - if (!e_filter_rule_validate (rule, GTK_WINDOW (dialog))) + if (!e_filter_rule_validate (rule, &error)) { + e_error_run_dialog (GTK_WINDOW (dialog), error); + e_error_free (error); + error = NULL; goto run; + } e_rule_context_add_rule (context, rule); e_rule_context_save (context, user_filename); diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index d7c8312a86..0c17c97fe8 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -70,7 +70,7 @@ shell_migrate_attempt (EShell *shell, if (error != NULL) { gint response; - response = e_error_run ( + response = e_error_run_dialog_for_args ( e_shell_get_active_window (shell), "shell:upgrade-failed", error->message, NULL); @@ -242,7 +242,7 @@ e_shell_migrate_attempt (EShell *shell) need = g_strdup_printf (_("%ld KB"), usage); have = g_strdup_printf (_("%ld KB"), avail); - e_error_run ( + e_error_run_dialog_for_args ( e_shell_get_active_window (shell), "shell:upgrade-nospace", need, have, NULL); @@ -285,13 +285,13 @@ check_old: string = g_strdup_printf ( "%d.%d.%d", last_major, last_minor, last_micro); - response = e_error_run ( + response = e_error_run_dialog_for_args ( 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 ( + response = e_error_run_dialog_for_args ( e_shell_get_active_window (shell), "shell:upgrade-remove-1-4-confirm", NULL); diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 058e45699b..82970092c3 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -752,7 +752,7 @@ action_forget_passwords_cb (GtkAction *action, { gint response; - response = e_error_run ( + response = e_error_run_dialog_for_args ( GTK_WINDOW (shell_window), "shell:forget-passwords", NULL); if (response == GTK_RESPONSE_OK) -- cgit