[evolution] port shell/ over to the new EError API
- From: Jonathon Jongsma <jjongsma src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution] port shell/ over to the new EError API
- Date: Mon, 30 Nov 2009 19:34:17 +0000 (UTC)
commit 0da239224f119664577c0d5dc47cab2632b083be
Author: Jonathon Jongsma <jonathon quotidian org>
Date: Tue Nov 24 16:55:54 2009 -0600
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(-)
---
diff --git a/shell/Makefile.am b/shell/Makefile.am
index 6ff40ba..eacf65d 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 3640a2a..e10d109 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 d7c8312..0c17c97 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 058e456..8297009 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]