Re: [evolution-patches] patch to make 'cancel' work for imap on send/receive dialogue window



looks ok to me

On Tue, 2003-07-29 at 16:50, Not Zed wrote:
> Worked out why the cancel button wasn't working - various tasks
> performed under the banner of 'checking for new mail' were run with
> their own cancellation port, so the buttons cancel just went no-where.
> 
> This patch should address it.
> 
> One side-effect is that the popup-window will now contain more info
> about the sync process - however, some of the text is longer and so may
> resize the window in unattractive ways.
> 
>  Michael
> 
> ______________________________________________________________________
> 
> Index: mail/ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
> retrieving revision 1.2761.2.7
> diff -u -3 -r1.2761.2.7 ChangeLog
> --- mail/ChangeLog	28 Jul 2003 21:01:33 -0000	1.2761.2.7
> +++ mail/ChangeLog	29 Jul 2003 20:47:09 -0000
> @@ -1,3 +1,16 @@
> +2003-07-29  Not Zed  <NotZed Ximian com>
> +
> +	* mail-folder-cache.c (mail_note_store): add a CamelOperation for
> +	overriding status handler.
> +
> +	* mail-send-recv.c (receive_update_got_store): Pass our own cancel
> +	handle to get_folderinfo and mail_note_store.
> +	(mail_send_receive, mail_receive_uri): Same for get_store.
> +
> +	* mail-ops.c (mail_get_store, mail_get_folderinfo): Add a
> +	CamelOperation argument, for overriding the status handler.  Fixed
> +	most calles to pass NULL to use the default.
> +
>  2003-07-25  Jeffrey Stedfast  <fejj ximian com>
>  
>  	* message-browser.c (on_key_press): New callback function to
> Index: mail/component-factory.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/component-factory.c,v
> retrieving revision 1.328.4.1
> diff -u -3 -r1.328.4.1 component-factory.c
> --- mail/component-factory.c	15 Jul 2003 19:47:57 -0000	1.328.4.1
> +++ mail/component-factory.c	29 Jul 2003 20:47:09 -0000
> @@ -1345,7 +1345,7 @@
>  		 const char *path,
>  		 CamelStore *store)
>  {
> -	mail_note_store (CAMEL_STORE (store), storage, CORBA_OBJECT_NIL,
> +	mail_note_store (CAMEL_STORE (store), NULL, storage, CORBA_OBJECT_NIL,
>  			 storage_connected, listener);
>  }
>  
> @@ -1369,7 +1369,7 @@
>  		evolution_storage_has_subfolders (storage, "/", _("Connecting..."));
>  		mail_hash_storage (store, storage);
>  		/*if (auto_connect)*/
> -		mail_note_store ((CamelStore *) store, storage, CORBA_OBJECT_NIL, NULL, NULL);
> +		mail_note_store ((CamelStore *) store, NULL, storage, CORBA_OBJECT_NIL, NULL, NULL);
>  		/* falllll */
>  	case EVOLUTION_STORAGE_ERROR_ALREADYREGISTERED:
>  	case EVOLUTION_STORAGE_ERROR_EXISTS:
> Index: mail/mail-account-gui.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-account-gui.c,v
> retrieving revision 1.133
> diff -u -3 -r1.133 mail-account-gui.c
> --- mail/mail-account-gui.c	11 Jun 2003 16:19:34 -0000	1.133
> +++ mail/mail-account-gui.c	29 Jul 2003 20:47:09 -0000
> @@ -2001,7 +2001,7 @@
>  	   component, then get the CamelStore and add it to
>  	   the shell storages */
>  	if (is_storage && account->enabled)
> -		mail_get_store (account->source->url, add_new_store, account);
> +		mail_get_store (account->source->url, NULL, add_new_store, account);
>  	
>  	if (gtk_toggle_button_get_active (gui->default_account))
>  		mail_config_set_default_account (account);
> Index: mail/mail-folder-cache.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-folder-cache.c,v
> retrieving revision 1.69
> diff -u -3 -r1.69 mail-folder-cache.c
> --- mail/mail-folder-cache.c	2 Jun 2003 17:50:25 -0000	1.69
> +++ mail/mail-folder-cache.c	29 Jul 2003 20:47:09 -0000
> @@ -809,7 +809,7 @@
>  
>  	if (g_hash_table_lookup(stores, store) != NULL) {
>  		/* re-use the cancel id.  we're already in the store update list too */
> -		ud->id = mail_get_folderinfo(store, update_folders, ud);
> +		ud->id = mail_get_folderinfo(store, NULL, update_folders, ud);
>  	} else {
>  		/* the store vanished, that means we were probably cancelled, or at any rate,
>  		   need to clean ourselves up */
> @@ -820,7 +820,7 @@
>  }
>  
>  void
> -mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
> +mail_note_store(CamelStore *store, CamelOperation *op, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
>  		void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
>  {
>  	struct _store_info *si;
> @@ -887,7 +887,7 @@
>  		ud = g_malloc (sizeof (*ud));
>  		ud->done = done;
>  		ud->data = data;
> -		ud->id = mail_get_folderinfo (store, update_folders, ud);
> +		ud->id = mail_get_folderinfo (store, op, update_folders, ud);
>  
>  		e_dlist_addtail (&si->folderinfo_updates, (EDListNode *) ud);
>  	}
> Index: mail/mail-folder-cache.h
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-folder-cache.h,v
> retrieving revision 1.11
> diff -u -3 -r1.11 mail-folder-cache.h
> --- mail/mail-folder-cache.h	27 Oct 2001 00:47:21 -0000	1.11
> +++ mail/mail-folder-cache.h	29 Jul 2003 20:47:09 -0000
> @@ -31,7 +31,7 @@
>     The folders are scanned from the store, and/or added at
>     runtime via the folder_created event */
>  void
> -mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
> +mail_note_store(CamelStore *store, CamelOperation *op, EvolutionStorage *storage, GNOME_Evolution_Storage corba_storage,
>  		void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data);
>  
>  /* de-note a store */
> Index: mail/mail-local.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-local.c,v
> retrieving revision 1.132
> diff -u -3 -r1.132 mail-local.c
> --- mail/mail-local.c	2 Jun 2003 17:27:27 -0000	1.132
> +++ mail/mail-local.c	29 Jul 2003 20:47:09 -0000
> @@ -1218,7 +1218,7 @@
>  	}
>  
>  	/* setup to record this store's changes */
> -	mail_note_store((CamelStore *)global_local_store, NULL, local_corba_storage, NULL, NULL);
> +	mail_note_store((CamelStore *)global_local_store, NULL, NULL, local_corba_storage, NULL, NULL);
>  
>  	local_storage_listener = evolution_storage_listener_new ();
>  	corba_local_storage_listener = evolution_storage_listener_corba_objref (
> Index: mail/mail-offline-handler.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-offline-handler.c,v
> retrieving revision 1.12
> diff -u -3 -r1.12 mail-offline-handler.c
> --- mail/mail-offline-handler.c	16 May 2003 18:52:14 -0000	1.12
> +++ mail/mail-offline-handler.c	29 Jul 2003 20:47:09 -0000
> @@ -270,7 +270,7 @@
>  
>  	if (service_is_relevant (CAMEL_SERVICE (store), FALSE)) {
>  		mail_store_set_offline (store, FALSE, NULL, NULL);
> -		mail_note_store (store, NULL, CORBA_OBJECT_NIL,
> +		mail_note_store (store, NULL, NULL, CORBA_OBJECT_NIL,
>  				 NULL, NULL);
>  	}
>  }
> Index: mail/mail-ops.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-ops.c,v
> retrieving revision 1.392
> diff -u -3 -r1.392 mail-ops.c
> --- mail/mail-ops.c	2 Jun 2003 17:50:25 -0000	1.392
> +++ mail/mail-ops.c	29 Jul 2003 20:47:09 -0000
> @@ -1167,12 +1167,17 @@
>  };
>  
>  int
> -mail_get_folderinfo (CamelStore *store, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
> +mail_get_folderinfo (CamelStore *store, CamelOperation *op, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data)
>  {
>  	struct _get_folderinfo_msg *m;
>  	int id;
>  
>  	m = mail_msg_new(&get_folderinfo_op, NULL, sizeof(*m));
> +	if (op) {
> +		camel_operation_unref(m->msg.cancel);
> +		m->msg.cancel = op;
> +		camel_operation_ref(op);
> +	}
>  	m->store = store;
>  	camel_object_ref(store);
>  	m->done = done;
> @@ -1379,12 +1384,17 @@
>  };
>  
>  int
> -mail_get_store (const char *uri, void (*done) (char *uri, CamelStore *store, void *data), void *data)
> +mail_get_store (const char *uri, CamelOperation *op, void (*done) (char *uri, CamelStore *store, void *data), void *data)
>  {
>  	struct _get_store_msg *m;
>  	int id;
>  	
>  	m = mail_msg_new (&get_store_op, NULL, sizeof (*m));
> +	if (op) {
> +		camel_operation_unref(m->msg.cancel);
> +		m->msg.cancel = op;
> +		camel_operation_ref(op);
> +	}
>  	m->uri = g_strdup (uri);
>  	m->data = data;
>  	m->done = done;
> Index: mail/mail-ops.h
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-ops.h,v
> retrieving revision 1.60
> diff -u -3 -r1.60 mail-ops.h
> --- mail/mail-ops.h	2 Jun 2003 17:50:26 -0000	1.60
> +++ mail/mail-ops.h	29 Jul 2003 20:47:09 -0000
> @@ -68,7 +68,7 @@
>  		     EThread *thread);
>  
>  /* and for a store */
> -int mail_get_store (const char *uri,
> +int mail_get_store (const char *uri, CamelOperation *op,
>  		    void (*done) (char *uri, CamelStore *store, void *data), void *data);
>  
>  /* build an attachment */
> @@ -94,7 +94,7 @@
>  		       void *data);
>  
>  /* get folder info asynchronously */
> -int mail_get_folderinfo (CamelStore *store,
> +int mail_get_folderinfo (CamelStore *store, CamelOperation *op,
>  			 void (*done)(CamelStore *store, CamelFolderInfo *info, void *data),
>  			 void *data);
>  
> Index: mail/mail-send-recv.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-send-recv.c,v
> retrieving revision 1.73
> diff -u -3 -r1.73 mail-send-recv.c
> --- mail/mail-send-recv.c	11 Jun 2003 23:02:09 -0000	1.73
> +++ mail/mail-send-recv.c	29 Jul 2003 20:47:09 -0000
> @@ -669,7 +669,7 @@
>  		EvolutionStorage *storage = mail_lookup_storage (store);
>  		
>  		if (storage) {
> -			mail_note_store(store, storage, CORBA_OBJECT_NIL, receive_update_done, info);
> +			mail_note_store(store, info->cancel, storage, CORBA_OBJECT_NIL, receive_update_done, info);
>  			/*bonobo_object_unref (BONOBO_OBJECT (storage));*/
>  		} else {
>  			/* If we get here, store must be an external
> @@ -677,7 +677,7 @@
>  			 * Do a get_folder_info just to force it to
>  			 * update itself.
>  			 */
> -			mail_get_folderinfo(store, receive_update_got_folderinfo, info);
> +			mail_get_folderinfo(store, info->cancel, receive_update_got_folderinfo, info);
>  		}
>  	} else {
>  		receive_done ("", info);
> @@ -733,8 +733,7 @@
>  					receive_done, info);
>  			break;
>  		case SEND_UPDATE:
> -			/* FIXME: error reporting? */
> -			mail_get_store(info->uri, receive_update_got_store, info);
> +			mail_get_store(info->uri, info->cancel, receive_update_got_store, info);
>  			break;
>  		default:
>  			g_assert_not_reached ();
> @@ -900,8 +899,7 @@
>  				 receive_done, info);
>  		break;
>  	case SEND_UPDATE:
> -		/* FIXME: error reporting? */
> -		mail_get_store (info->uri, receive_update_got_store, info);
> +		mail_get_store (info->uri, info->cancel, receive_update_got_store, info);
>  		break;
>  	default:
>  		g_assert_not_reached ();
> Index: mail/subscribe-dialog.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/subscribe-dialog.c,v
> retrieving revision 1.89
> diff -u -3 -r1.89 subscribe-dialog.c
> --- mail/subscribe-dialog.c	16 Apr 2003 05:03:22 -0000	1.89
> +++ mail/subscribe-dialog.c	29 Jul 2003 20:47:09 -0000
> @@ -1139,7 +1139,7 @@
>  	sd->store_func = func;
>  	sd->store_data = user_data;
>  	store_data_ref (sd);
> -	sd->request_id = mail_get_store (sd->uri, sd_got_store, sd);
> +	sd->request_id = mail_get_store (sd->uri, NULL, sd_got_store, sd);
>  }
>  
>  static void
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com




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