aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations
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
parent21eb448cadb620929c16b8ca732bd759ac4d74bb (diff)
downloadgsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.tar
gsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.tar.gz
gsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.tar.bz2
gsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.tar.lz
gsoc2013-evolution-4dbbd163dd4a8866e9547ff40002b34ade4ff3b1.tar.xz
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')
-rw-r--r--plugins/exchange-operations/ChangeLog17
-rw-r--r--plugins/exchange-operations/Makefile.am7
-rw-r--r--plugins/exchange-operations/exchange-account-setup.c96
-rw-r--r--plugins/exchange-operations/exchange-config-listener.c25
-rw-r--r--plugins/exchange-operations/exchange-operations.c48
-rw-r--r--plugins/exchange-operations/exchange-operations.h3
-rw-r--r--plugins/exchange-operations/org-gnome-exchange-operations.error.xml142
7 files changed, 254 insertions, 84 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index 6eed7b9ba0..b6f1189740 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,20 @@
+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
+
2005-07-11 Shakti Sen <shprasad@novell.com>
* Makefile.am: Included files exchange-folder-subscription.c,
diff --git a/plugins/exchange-operations/Makefile.am b/plugins/exchange-operations/Makefile.am
index 727560fc72..1d270478bb 100644
--- a/plugins/exchange-operations/Makefile.am
+++ b/plugins/exchange-operations/Makefile.am
@@ -55,9 +55,14 @@ glade_DATA = \
exchange-folder-tree.glade \
exchange-permissions-dialog.glade
+error_DATA = org-gnome-exchange-operations.error
+errordir = $(privdatadir)/errors
+
EXTRA_DIST = \
org-gnome-exchange-operations.eplug.in \
+ org-gnome-exchange-operations.error.xml \
org-gnome-folder-permissions.xml \
org-gnome-folder-subscription.xml \
- $(glade_DATA)
+ $(glade_DATA)
+BUILT_SOURCES = $(error_DATA)
diff --git a/plugins/exchange-operations/exchange-account-setup.c b/plugins/exchange-operations/exchange-account-setup.c
index aeb0e2ea5f..1d32b096c8 100644
--- a/plugins/exchange-operations/exchange-account-setup.c
+++ b/plugins/exchange-operations/exchange-account-setup.c
@@ -48,6 +48,7 @@
#include "mail/em-config.h"
#include "exchange-delegates.h"
+#define ERROR_DOMAIN "org-gnome-exchange-operations"
GtkWidget* org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data);
GtkWidget *org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data);
@@ -116,6 +117,7 @@ btn_chpass_clicked (GtkButton *button, gpointer data)
{
ExchangeAccount *account;
char *old_password, *new_password;
+ ExchangeAccountResult result;
account = exchange_operations_get_exchange_account ();
@@ -126,7 +128,8 @@ btn_chpass_clicked (GtkButton *button, gpointer data)
}
new_password = exchange_get_new_password (old_password, TRUE);
g_print ("Current password is \"%s\"\n", old_password);
- exchange_account_set_password (account, old_password, new_password);
+ result = exchange_account_set_password (account, old_password, new_password);
+ exchange_operations_report_error (account, result);
g_free (old_password);
g_free (new_password);
@@ -226,8 +229,9 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
/* See if oof info found already */
if (!exchange_oof_get (account, &oof_state, &message)) {
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not read out-of-office state")); */
+
+ e_error_run (NULL, ERROR_DOMAIN ":state-read-error", NULL);
+
return NULL;
}
@@ -365,90 +369,48 @@ print_error (const char *owa_url, E2kAutoconfigResult result)
switch (result) {
case E2K_AUTOCONFIG_CANT_CONNECT:
- if (!strncmp (owa_url, "http:", 5)) {
- old = "http";
- new = "https";
- } else {
- old = "https";
- new = "http";
- }
-
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not connect to the Exchange "
- "server.\nMake sure the URL is correct "
- "(try \"%s\" instead of \"%s\"?) "
- "and try again."), new, old);
- */
- break;
+ if (!strncmp (owa_url, "http:", 5)) {
+ old = "http";
+ new = "https";
+ } else {
+ old = "https";
+ new = "http";
+ }
+
+ e_error_run (NULL, ERROR_DOMAIN ":account-connect-error", "", NULL);
+
+ break;
case E2K_AUTOCONFIG_CANT_RESOLVE:
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not locate Exchange server.\n"
- "Make sure the server name is spelled correctly "
- "and try again."));
- */
- break;
+
+ e_error_run (NULL, ERROR_DOMAIN ":account-resolve-error", "", NULL);
+ break;
case E2K_AUTOCONFIG_AUTH_ERROR:
case E2K_AUTOCONFIG_AUTH_ERROR_TRY_NTLM:
case E2K_AUTOCONFIG_AUTH_ERROR_TRY_BASIC:
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not authenticate to the Exchange "
- "server.\nMake sure the username and "
- "password are correct and try again."));
- */
+ e_error_run (NULL, ERROR_DOMAIN ":password-incorrect", NULL);
break;
case E2K_AUTOCONFIG_AUTH_ERROR_TRY_DOMAIN:
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not authenticate to the Exchange "
- "server.\nMake sure the username and "
- "password are correct and try again.\n\n"
- "You may need to specify the Windows "
- "domain name as part of your username "
- "(eg, \"MY-DOMAIN\\%s\")."),
- ac->username);
- */
+ e_error_run (NULL, ERROR_DOMAIN ":account-domain-error", NULL);
break;
case E2K_AUTOCONFIG_NO_OWA:
case E2K_AUTOCONFIG_NOT_EXCHANGE:
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not find OWA data at the indicated URL.\n"
- "Make sure the URL is correct and try again."));
- */
+ e_error_run (NULL, ERROR_DOMAIN ":account-wss-error", NULL);
break;
case E2K_AUTOCONFIG_CANT_BPROPFIND:
- /* SURF : e_notice (
- NULL, GTK_MESSAGE_ERROR,
- _("Ximian Connector requires access to certain "
- "functionality on the Exchange Server that appears "
- "to be disabled or blocked. (This is usually "
- "unintentional.) Your Exchange Administrator will "
- "need to enable this functionality in order for "
- "you to be able to use Ximian Connector.\n\n"
- "For information to provide to your Exchange "
- "administrator, please follow the link below:\n"
- "http://support.novell.com/cgi-bin/search/searchtid.cgi?/ximian/ximian328.html "));
- */
+ e_error_run (NULL, ERROR_DOMAIN ":connect-exchange-error", NULL);
break;
case E2K_AUTOCONFIG_EXCHANGE_5_5:
- /* SURF : e_notice (
- NULL, GTK_MESSAGE_ERROR,
- _("The Exchange server URL you provided is for an "
- "Exchange 5.5 Server. Ximian Connector supports "
- "Microsoft Exchange 2000 and 2003 only."));
- */
+ e_error_run (NULL, ERROR_DOMAIN ":account-version-error", NULL);
break;
default:
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not configure Exchange account because "
- "an unknown error occurred. Check the URL, "
- "username, and password, and try again."));
- */
+ e_error_run (NULL, ERROR_DOMAIN ":configure-error", NULL);
break;
}
@@ -732,8 +694,8 @@ set_oof_info ()
}
if (!exchange_oof_set (account, oof_data->state, oof_data->message)) {
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("Could not update out-of-office state")); */
+
+ e_error_run (NULL, ERROR_DOMAIN ":state-update-error", NULL);
}
}
diff --git a/plugins/exchange-operations/exchange-config-listener.c b/plugins/exchange-operations/exchange-config-listener.c
index 7991a7d956..bb85a07802 100644
--- a/plugins/exchange-operations/exchange-config-listener.c
+++ b/plugins/exchange-operations/exchange-config-listener.c
@@ -27,6 +27,7 @@
#endif
#include "exchange-config-listener.h"
+#include "exchange-operations.h"
#include <exchange-account.h>
#include <exchange-constants.h>
@@ -34,9 +35,8 @@
#include <e-folder-exchange.h>
#include <e2k-marshal.h>
#include <e2k-uri.h>
-// SURF : #include "mail-stub-listener.h"
-// SURF : #include <libedataserver/e-dialog-utils.h>
+#include <e-util/e-error.h>
#include <libedataserver/e-source.h>
#include <libedataserver/e-source-list.h>
@@ -833,6 +833,7 @@ account_added (EAccountList *account_list, EAccount *account)
{
ExchangeConfigListener *config_listener;
ExchangeAccount *exchange_account;
+ ExchangeAccountResult result;
if (!is_active_exchange_account (account))
return;
@@ -840,9 +841,7 @@ account_added (EAccountList *account_list, EAccount *account)
config_listener = EXCHANGE_CONFIG_LISTENER (account_list);
if (config_listener->priv->configured_account) {
/* Multiple accounts configured. */
- /* SURF : e_notice (NULL, GTK_MESSAGE_ERROR,
- _("You may only configure a single Exchange account"));
- */
+ e_error_run (NULL, "org-gnome-exchange-operations:single-account-error", NULL);
return;
}
@@ -872,7 +871,8 @@ account_added (EAccountList *account_list, EAccount *account)
g_signal_emit (config_listener, signals[EXCHANGE_ACCOUNT_CREATED], 0,
exchange_account);
add_sources (exchange_account);
- exchange_account_connect (exchange_account);
+ exchange_account_connect (exchange_account, NULL, &result);
+ exchange_operations_report_error (exchange_account, result);
add_new_sources (exchange_account);
}
@@ -1036,10 +1036,7 @@ account_changed (EAccountList *account_list, EAccount *account)
remove_account_esources (priv->exchange_account);
/* Nope. Let the user know we're ignoring him. */
- /* SURF : e_notice (NULL, GTK_MESSAGE_WARNING,
- _("Changes to Exchange account configuration will "
- "take\nplace after you quit and restart Evolution."));
- */
+ e_error_run (NULL, "org-gnome-exchange-operations:apply-restart", NULL);
/* But note the new URI so if he changes something else, we
* only warn again if he changes again.
@@ -1083,15 +1080,11 @@ account_removed (EAccountList *account_list, EAccount *account)
priv->configured_name = NULL;
} else {
if (account->enabled) {
- /* SURF : e_notice (NULL, GTK_MESSAGE_INFO,
- _("The Exchange account will be removed when you quit Evolution"));
- */
+ e_error_run (NULL, "org-gnome-exchange-operations:remove-quit", NULL);
}
else {
/* The account is in use. We can't remove it. */
- /* SURF : e_notice (NULL, GTK_MESSAGE_INFO,
- _("The Exchange account will be disabled when you quit Evolution"));
- */
+ e_error_run (NULL, "org-gnome-exchange-operations:disable-quit", NULL);
}
}
}
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);
+}
+
diff --git a/plugins/exchange-operations/exchange-operations.h b/plugins/exchange-operations/exchange-operations.h
index 5b4fe3a577..bf41b3088f 100644
--- a/plugins/exchange-operations/exchange-operations.h
+++ b/plugins/exchange-operations/exchange-operations.h
@@ -26,6 +26,7 @@
#include "e-util/e-plugin.h"
#include "exchange-config-listener.h"
+#include <exchange-account.h>
#ifdef __cplusplus
extern "C" {
@@ -43,6 +44,8 @@ gboolean exchange_operations_tokenize_string (char **string, char *token, char d
gboolean exchange_operations_cta_add_node_to_tree (GtkTreeStore *store, GtkTreeIter *parent, const char *nuri);
void exchange_operations_cta_select_node_from_tree (GtkTreeStore *store, GtkTreeIter *parent, const char *nuri, const char *ruri, GtkTreeSelection *selection) ;
+void exchange_operations_report_error (ExchangeAccount *account, ExchangeAccountResult result);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/plugins/exchange-operations/org-gnome-exchange-operations.error.xml b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml
new file mode 100644
index 0000000000..b89d106279
--- /dev/null
+++ b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<error-list domain="org-gnome-exchange-operations">
+
+ <error id="single-account-error" type="error">
+ <_primary>You may only configure a single Exchange account.</_primary>
+ </error>
+
+ <error id="apply-restart" type="info">
+ <_primary>Please restart Evolution</_primary>
+ <_secondary>Changes to Exchange account configuration will take place after you quit and restart Evolution.</_secondary>
+ </error>
+
+ <error id="remove-quit" type="info">
+ <_primary>The Exchange account will be removed when you quit Evolution</_primary>
+ </error>
+
+ <error id="disable-quit" type="info">
+ <_primary>The Exchange account will be disabled when you quit Evolution</_primary>
+ </error>
+
+ <error id="state-read-error" type="error">
+ <_primary>Could not read out-of-office state</_primary>
+ </error>
+
+ <error id="state-update-error" type="error">
+ <_primary>Could not update out-of-office state</_primary>
+ </error>
+
+ <error id="config-error" type="error">
+ <_primary>Cannot change password due to configuration problems.</_primary>
+ </error>
+
+ <error id="password-weak-error" type="error">
+ <_primary>Server rejected password because it is too weak.</_primary>
+ <_secondary>Try again with a different password.</_secondary>
+ </error>
+
+ <error id="password-change-error" type="error">
+ <_primary>Could not change password.</_primary>
+ </error>
+
+ <error id="password-change-success" type="info">
+ <_primary>Password successfully changed.</_primary>
+ </error>
+
+ <error id="account-offline" type="info">
+ <_primary>Exchange Account is offline.</_primary>
+ <_secondary>Cannot display folders.</_secondary>
+ </error>
+
+ <error id="password-incorrect" type="error">
+ <_primary>Could not authenticate to server.</_primary>
+ <_secondary>Make sure the username and password are correct and try again.</_secondary>
+ </error>
+
+ <error id="account-domain-error" type="error">
+ <_primary>Could not authenticate to server.</_primary>
+ <_secondary xml:space="preserve">This probably means that your server requires
+you to specify the Windows domain name
+as part of your username (eg, &quot;DOMAIN\user&quot;).
+
+Or you might have just typed your password wrong.</_secondary>
+ </error>
+
+ <error id="account-mailbox-na" type="error">
+ <_primary>Mailbox for {0} is not on this server.</_primary>
+ </error>
+
+ <error id="account-version-error" type="error">
+ <_primary>The Exchange server is not compatible with Exchange Connector.</_primary>
+ <_secondary xml:space="preserve">The server is runinng Exchange 5.5. Exchange Connector
+supports Microsoft Exchange 2000 and 2003 only.</_secondary>
+ </error>
+
+ <error id="account-wss-error" type="error">
+ <_primary>Could not find Exchange Web Storage System.</_primary>
+ <_secondary>If OWA is running on a different path, you must specify that in the account configuration dialog.</_secondary>
+ </error>
+
+ <error id="account-no-mailbox" type="info">
+ <_primary>No mailbox for user {0} on {1}.</_primary>
+ </error>
+
+ <error id="account-resolve-error" type="error">
+ <_primary>Could not locate server {0}.</_primary>
+ <_secondary>Make sure the server name is spelled correctly and try again.</_secondary>
+ </error>
+
+ <error id="account-connect-error" type="error">
+ <_primary>Could not connect to server {0}.</_primary>
+ <_secondary>Make sure the URL is correct and try again.</_secondary>
+ </error>
+
+ <error id="password-expired" type="error">
+ <_primary>Your password has expired.</_primary>
+ </error>
+
+ <error id="account-unknown-error" type="error">
+ <_primary>Could not connect to server {0}.</_primary>
+ <_secondary>Unknown error.</_secondary>
+ </error>
+
+ <error id="account-quota-error" type="error">
+ <_primary>You have exceeded your quota for storing mails on this server.</_primary>
+ <_secondary>You will not be able to either send or recieve mails now.</_secondary>
+ </error>
+
+ <error id="account-quota-send-error" type="warning">
+ <_primary>You are nearing your quota available for storing mails on this server.</_primary>
+ <_secondary>You will not be able to send mails till you clear up some space by deleting some mails.</_secondary>
+ </error>
+
+ <error id="account-quota-warn" type="warning">
+ <_primary>You are nearing your quota available for storing mails on this server.</_primary>
+ <_secondary>Try to clear up some space by deleting some mails.</_secondary>
+ </error>
+
+ <error id="connector-exchange-error" type="error">
+ <_primary>Exchange Connector access error.</_primary>
+ <_secondary xml:space="preserve">Exchange Connector requires access to certain
+functionality on the Exchange Server that appears
+to be disabled or blocked. (This is usually
+unintentional.) Your Exchange Administrator will
+need to enable this functionality in order for
+you to be able to use Ximian Connector.
+
+For information to provide to your Exchange
+administrator, please follow the link below:
+
+http://support.novell.com/cgi-bin/search/searchtid.cgi?/ximian/ximian328.html
+ </_secondary>
+ </error>
+
+ <error id="configure-error" type="error">
+ <_secondary xml:space="preserve">Could not configure Exchange account because
+an unknown error occurred. Check the URL,
+username, and password, and try again.</_secondary>
+ </error>
+
+</error-list>
+
+