aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/exchange-operations
diff options
context:
space:
mode:
authorBharath Acharya <abharath@novell.com>2008-12-08 15:22:13 +0800
committerBharath Acharya <abharath@src.gnome.org>2008-12-08 15:22:13 +0800
commite7a430163104edf067865306cdc1b5192bb08d4c (patch)
treecfc079b073a0693f266215916af1d1e245875637 /plugins/exchange-operations
parent1eba7c5d8d740185a48b007e51acc16e4eebaf47 (diff)
downloadgsoc2013-evolution-e7a430163104edf067865306cdc1b5192bb08d4c.tar.gz
gsoc2013-evolution-e7a430163104edf067865306cdc1b5192bb08d4c.tar.zst
gsoc2013-evolution-e7a430163104edf067865306cdc1b5192bb08d4c.zip
** Fix for bug #558498
2008-12-08 Bharath Acharya <abharath@novell.com> ** Fix for bug #558498 * exchange-account-setup.c: (org_gnome_exchange_settings), (destroy_oof_data), (org_gnome_exchange_commit): * org-gnome-exchange-operations.error.xml:Check for the offline status before setting up the Exchange settings. svn path=/trunk/; revision=36842
Diffstat (limited to 'plugins/exchange-operations')
-rw-r--r--plugins/exchange-operations/ChangeLog9
-rw-r--r--plugins/exchange-operations/exchange-account-setup.c21
-rw-r--r--plugins/exchange-operations/org-gnome-exchange-operations.error.xml5
3 files changed, 34 insertions, 1 deletions
diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog
index 6c7483eaa4..34dc1f3aa0 100644
--- a/plugins/exchange-operations/ChangeLog
+++ b/plugins/exchange-operations/ChangeLog
@@ -1,3 +1,12 @@
+2008-12-08 Bharath Acharya <abharath@novell.com>
+
+ ** Fix for bug #558498
+
+ * exchange-account-setup.c: (org_gnome_exchange_settings),
+ (destroy_oof_data), (org_gnome_exchange_commit):
+ * org-gnome-exchange-operations.error.xml:Check for the offline status
+ before setting up the Exchange settings.
+
2008-12-02 Milan Crha <mcrha@redhat.com>
** Part of fix for bug #562228
diff --git a/plugins/exchange-operations/exchange-account-setup.c b/plugins/exchange-operations/exchange-account-setup.c
index 46b98d3acb..5b3d0b9653 100644
--- a/plugins/exchange-operations/exchange-account-setup.c
+++ b/plugins/exchange-operations/exchange-account-setup.c
@@ -181,6 +181,7 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
const char *source_url;
char *message = NULL, *txt = NULL, *oof_message;
gboolean oof_state = FALSE;
+ gint offline_status;
GtkVBox *vbox_settings;
@@ -234,6 +235,14 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data)
account = exchange_operations_get_exchange_account ();
+ exchange_config_listener_get_offline_status (exchange_global_config_listener,
+ &offline_status);
+ if (offline_status == OFFLINE_MODE) {
+ e_error_run (NULL, ERROR_DOMAIN ":exchange-settings-offline", NULL);
+
+ return NULL;
+ }
+
oof_data = g_new0 (OOFData, 1);
oof_data->state = FALSE;
@@ -857,7 +866,8 @@ destroy_oof_data (void)
{
if (oof_data->message)
g_free (oof_data->message);
- g_free (oof_data);
+ if (oof_data)
+ g_free (oof_data);
}
void
@@ -866,6 +876,7 @@ org_gnome_exchange_commit (EPlugin *epl, EConfigHookItemFactoryData *data)
EMConfigTargetAccount *target_account;
const char *source_url;
CamelURL *url;
+ gint offline_status;
target_account = (EMConfigTargetAccount *)data->config->target;
source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL);
@@ -886,6 +897,14 @@ org_gnome_exchange_commit (EPlugin *epl, EConfigHookItemFactoryData *data)
}
camel_url_free (url);
+
+ exchange_config_listener_get_offline_status (exchange_global_config_listener,
+ &offline_status);
+
+ if (offline_status == OFFLINE_MODE) {
+ return;
+ }
+
/* Set oof data in exchange account */
set_oof_info ();
destroy_oof_data ();
diff --git a/plugins/exchange-operations/org-gnome-exchange-operations.error.xml b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml
index c162f365ec..37ed0aa318 100644
--- a/plugins/exchange-operations/org-gnome-exchange-operations.error.xml
+++ b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml
@@ -48,6 +48,11 @@
<_secondary>Cannot display folders.</_secondary>
</error>
+ <error id="exchange-settings-offline" type="info">
+ <_primary>Exchange Account is offline.</_primary>
+ <_secondary>Cannot access the "Exchange settings" tab in offline mode.</_secondary>
+ </error>
+
<error id="account-offline-generic" type="info">
<_primary>Exchange Account is offline.</_primary>
<_secondary>Cannot perform the operation.</_secondary>