From e7a430163104edf067865306cdc1b5192bb08d4c Mon Sep 17 00:00:00 2001 From: Bharath Acharya Date: Mon, 8 Dec 2008 07:22:13 +0000 Subject: ** Fix for bug #558498 2008-12-08 Bharath Acharya ** 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 --- plugins/exchange-operations/ChangeLog | 9 +++++++++ .../exchange-operations/exchange-account-setup.c | 21 ++++++++++++++++++++- .../org-gnome-exchange-operations.error.xml | 5 +++++ 3 files changed, 34 insertions(+), 1 deletion(-) (limited to 'plugins') 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 + + ** 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 ** 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. + + <_primary>Exchange Account is offline. + <_secondary>Cannot access the "Exchange settings" tab in offline mode. + + <_primary>Exchange Account is offline. <_secondary>Cannot perform the operation. -- cgit v1.2.3