diff options
author | Jonathon Jongsma <jonathon@quotidian.org> | 2009-11-25 06:55:54 +0800 |
---|---|---|
committer | Jonathon Jongsma <jonathon@quotidian.org> | 2009-12-01 03:31:19 +0800 |
commit | 0da239224f119664577c0d5dc47cab2632b083be (patch) | |
tree | d1979fdf65cbfed4e97f2047168259975d257dad /shell | |
parent | fff91b3bc66758f21a4040d7ec198318333e5150 (diff) | |
download | gsoc2013-evolution-0da239224f119664577c0d5dc47cab2632b083be.tar.gz gsoc2013-evolution-0da239224f119664577c0d5dc47cab2632b083be.tar.zst gsoc2013-evolution-0da239224f119664577c0d5dc47cab2632b083be.zip |
port shell/ over to the new EError API
https://bugzilla.gnome.org/show_bug.cgi?id=602963
Diffstat (limited to 'shell')
-rw-r--r-- | shell/Makefile.am | 1 | ||||
-rw-r--r-- | shell/e-shell-content.c | 14 | ||||
-rw-r--r-- | shell/e-shell-migrate.c | 8 | ||||
-rw-r--r-- | shell/e-shell-window-actions.c | 2 |
4 files changed, 18 insertions, 7 deletions
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) |