aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations/exchange-operations.c
diff options
context:
space:
mode:
authorSarfraaz Ahmed <asarfraaz@novell.com>2005-07-11 15:16:42 +0800
committerAhmed Sarfraaz <sarfraaz@src.gnome.org>2005-07-11 15:16:42 +0800
commit4dbbd163dd4a8866e9547ff40002b34ade4ff3b1 (patch)
tree04aac693323367be1ab12c38e528c553544726ba /plugins/exchange-operations/exchange-operations.c
parent21eb448cadb620929c16b8ca732bd759ac4d74bb (diff)
downloadgsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.tar.gz
gsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.tar.zst
gsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.zip
Patch submitted by ArunPrakash <arunp@novell.com> Newly added, to report
2005-07-11 Sarfraaz Ahmed <asarfraaz@novell.com> Patch submitted by ArunPrakash <arunp@novell.com> * 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
Diffstat (limited to 'plugins/exchange-operations/exchange-operations.c')
-rw-r--r--plugins/exchange-operations/exchange-operations.c48
1 files changed, 48 insertions, 0 deletions
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 <string.h>
#include "exchange-operations.h"
+#include <e-util/e-error.h>
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);
+}
+