From 4dbbd163dd4a8866e9547ff40002b34ade4ff3b1 Mon Sep 17 00:00:00 2001 From: Sarfraaz Ahmed Date: Mon, 11 Jul 2005 07:16:42 +0000 Subject: Patch submitted by ArunPrakash Newly added, to report 2005-07-11 Sarfraaz Ahmed Patch submitted by ArunPrakash * exchange-operations.c (exchange_operations_report_error) : Newly added, to report errors using e_error_run. Also a list of error-ids is added. * exchange-config-listener.c (account_added) (account_removed) : Modified the usage of e_notice to e_error_run. Also the error from exchange_account_connect is reported using exchange_operations_report_error. * exchange-account-setup.c (btn_chpass_clicked) (org_gnome_exchange_settings) (print_error) (set_oof_info): Changed to use exchange_operations_report_error and e_error_run functions. * org-gnome-exchange-operations.error.xml : Newly added, defines the list of error messages used in the plugin. * Makefile.am : Modified for org-gnome-exchange-operations.error.xml svn path=/trunk/; revision=29707 --- plugins/exchange-operations/exchange-operations.c | 48 +++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'plugins/exchange-operations/exchange-operations.c') diff --git a/plugins/exchange-operations/exchange-operations.c b/plugins/exchange-operations/exchange-operations.c index d5f479cebc..b37473ae50 100644 --- a/plugins/exchange-operations/exchange-operations.c +++ b/plugins/exchange-operations/exchange-operations.c @@ -22,9 +22,29 @@ #include #include "exchange-operations.h" +#include ExchangeConfigListener *exchange_global_config_listener=NULL; +static char *error_ids[] = { "config-error", + "password-weak-error", + "password-change-error", + "password-change-success", + "account-offline", + "password-incorrect", + "account-domain-error", + "account-mailbox-na", + "account-version-error", + "account-wss-error", + "account-no-mailbox", + "account-resolve-error", + "account-connect-error", + "password-expired", + "account-unknown-error", + "account-quota-error", + "account-quota-send-error", + "account-quota-warn" }; + static void free_exchange_listener (void) { @@ -166,3 +186,31 @@ exchange_operations_get_exchange_account (void) return account; } +void +exchange_operations_report_error (ExchangeAccount *account, ExchangeAccountResult result) +{ + gchar *error_string; + + g_return_if_fail (account != NULL); + + error_string = g_strconcat ("org-gnome-exchange-operations:", error_ids[result], NULL); + + switch (result) { + case EXCHANGE_ACCOUNT_MAILBOX_NA: + e_error_run (NULL, error_string, exchange_account_get_username (account), NULL); + break; + case EXCHANGE_ACCOUNT_NO_MAILBOX: + e_error_run (NULL, error_string, exchange_account_get_username (account), + account->exchange_server, NULL); + break; + case EXCHANGE_ACCOUNT_RESOLVE_ERROR: + case EXCHANGE_ACCOUNT_CONNECT_ERROR: + case EXCHANGE_ACCOUNT_UNKNOWN_ERROR: + e_error_run (NULL, error_string, account->exchange_server, NULL); + break; + default: + e_error_run (NULL, error_string, NULL); + } + g_free (error_string); +} + -- cgit v1.2.3