Re: [evolution-patches] Exchange: Patch for bug #311324



Hi,

I am sending a new patch which solves the online/offline support in
exchange. Now I am doing it in exchange-config-listener part, e-d-s-
exchange changes are not required now.

Please review the patch.

Thanks,
Shakti


On Fri, 2005-07-29 at 10:32 +0530, shakti wrote:
> Hi,
> 
> I have attached a patch for online/offline support in exchange (in eds
> as well as for plugins). Please review the patch. bug #311324.
> 
> Thanks,
> Shakti
> 
> _______________________________________________
> evolution-patches mailing list
> evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/ChangeLog,v
retrieving revision 1.36
diff -u -p -r1.36 ChangeLog
--- ChangeLog	28 Jul 2005 18:05:12 -0000	1.36
+++ ChangeLog	1 Aug 2005 05:12:40 -0000
@@ -1,3 +1,12 @@
+2005-07-29  Shakti Sen <shprasad novell com>
+
+	* exchange-folder.c (org_gnome_exchange_folder_ab_unsubscribe,
+	org_gnome_exchange_folder_unsubscribe, 
+	org_gnome_exchange_folder_subscription): Added offline/online support
+	and removed some warning messages.
+
+	Fixes bug #311324.
+
 2005-07-27  Praveen Kumar <kpraveen novell com>
 
 	* exchange-folder.c (org_gnome_exchange_folder_subscription) : Handle
Index: exchange-config-listener.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-config-listener.c,v
retrieving revision 1.8
diff -u -p -r1.8 exchange-config-listener.c
--- exchange-config-listener.c	22 Jul 2005 07:48:16 -0000	1.8
+++ exchange-config-listener.c	1 Aug 2005 05:12:40 -0000
@@ -838,6 +838,19 @@ idle_construct (gpointer data)
 	return FALSE;
 }
 
+gboolean
+get_offline_status (ExchangeConfigListener *excl)
+{
+	ExchangeConfigListenerPrivate *priv = excl->priv;
+	GConfValue *value;
+	gboolean offline = FALSE;
+	value = gconf_client_get (priv->gconf,
+					"/apps/evolution/shell/start_offline", NULL);
+	if (value)
+		offline = gconf_value_get_bool (value);
+	return offline;
+
+}	
 /**
  * exchange_config_listener_new:
  *
Index: exchange-folder.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-folder.c,v
retrieving revision 1.6
diff -u -p -r1.6 exchange-folder.c
--- exchange-folder.c	28 Jul 2005 18:05:12 -0000	1.6
+++ exchange-folder.c	1 Aug 2005 05:12:41 -0000
@@ -301,12 +301,25 @@ org_gnome_exchange_folder_ab_unsubscribe
 	gchar *title = NULL;
 	gchar *displayed_folder_name = NULL;
 	gint response;
+	gboolean mode;
 
 	account = exchange_operations_get_exchange_account ();
 
 	if (!account)
 		return;
 
+	mode = exchange_is_offline ();
+
+	if (mode) {
+		printf ("Unsubscribe to Other User's Folder is not allowed in Offline mode\n");
+		/* FIXME:
+		   I think throwing an error dialog is not allowed
+		   because of UI freeze.
+		   e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
+		*/
+		return;
+	}	
+
 	source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
 	displayed_folder_name = (gchar *) e_source_peek_name (source);
 	dialog = gtk_message_dialog_new (NULL,
@@ -344,12 +357,24 @@ org_gnome_exchange_folder_unsubscribe (E
 	gchar *title = NULL;
 	gchar *displayed_folder_name = NULL;
 	gint response;
+	gboolean mode;
 
 	account = exchange_operations_get_exchange_account ();
 
 	if (!account)
 		return;
 
+	mode = exchange_is_offline ();
+	if (mode) {
+		printf ("Unsubscribe to Other User's Folder is not allowed in Offline mode\n");
+		/* FIXME:
+		   I think throwing an error dialog is not allowed 
+		   because of UI freeze.
+		   e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
+		*/
+		return;
+	}	
+
 	source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (target->selector));
 	displayed_folder_name = (gchar *) e_source_peek_name (source);
 	dialog = gtk_message_dialog_new (NULL,
@@ -390,11 +415,23 @@ org_gnome_exchange_folder_subscription (
 	gchar *folder_type = NULL;
 	gchar *physical_uri = NULL;
 	gchar *user_email_address = NULL, *folder_name = NULL;
+	gboolean mode;
 
 	account = exchange_operations_get_exchange_account ();
 
 	if (!account)
 		return;
+
+	mode = exchange_is_offline ();
+	if (mode) {
+		printf ("Subscribe to Other User's Folder is not allowed in Offline mode\n");
+		/* FIXME:
+		   I think throwing an error dialog is not allowed i
+		   because of UI freeze.
+		   e_error_run (NULL, ERROR_DOMAIN ":folder-offline-error", NULL);
+		*/
+		return;
+	}	
 
 	create_folder_subscription_dialog (account->account_name, &user_email_address, &folder_name);
 
Index: exchange-operations.c
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-operations.c,v
retrieving revision 1.7
diff -u -p -r1.7 exchange-operations.c
--- exchange-operations.c	25 Jul 2005 06:12:03 -0000	1.7
+++ exchange-operations.c	1 Aug 2005 05:12:41 -0000
@@ -61,6 +61,11 @@ e_plugin_lib_enable (EPluginLib *eplib, 
 	return 0;
 }
 
+gboolean
+exchange_is_offline () {
+	return get_offline_status (exchange_global_config_listener);
+}	
+
 /* FIXME: See if a GLib variant of this function available */
 gboolean
 exchange_operations_tokenize_string (char **string, char *token, char delimit)
Index: exchange-operations.h
===================================================================
RCS file: /cvs/gnome/evolution/plugins/exchange-operations/exchange-operations.h,v
retrieving revision 1.5
diff -u -p -r1.5 exchange-operations.h
--- exchange-operations.h	25 Jul 2005 06:12:03 -0000	1.5
+++ exchange-operations.h	1 Aug 2005 05:12:41 -0000
@@ -40,6 +40,8 @@ extern ExchangeConfigListener *exchange_
 int e_plugin_lib_enable (EPluginLib *eplib, int enable);
 
 ExchangeAccount *exchange_operations_get_exchange_account (void);
+gboolean exchange_is_offline (void);
+gboolean get_offline_status (ExchangeConfigListener *excl);
 
 gboolean exchange_operations_tokenize_string (char **string, char *token, char delimit);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]