From 351903ad90942abecccf363f97a6639c74ef2e58 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 22 Feb 2001 22:27:40 +0000 Subject: Make op cancellable/report internals. (get_folder_get): 2001-02-23 Not Zed * mail-ops.c (create_folder_get): Make op cancellable/report internals. (get_folder_get): (sync_folder_sync): (get_folderinfo_get): Make op cancellable/report internals. * mail-vtrash.c (get_trash_get): Setup the operation registration, and create a pseudo "start/stop" operation. * component-factory.c (owner_set_cb): Make trash creation async. * mail-local.c (register_folder_desc): A description of what we're doing. * mail-mt.c (mail_msg_new): Set status callback to operation_new. (mail_operation_status): Operation status function, proxy messages to main thread, and attempt to present a meaningful ui experience for operations. svn path=/trunk/; revision=8351 --- mail/mail-local.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'mail/mail-local.c') diff --git a/mail/mail-local.c b/mail/mail-local.c index eba6f36992..f27778aaac 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -445,6 +445,14 @@ struct _register_msg { MailLocalFolder *local_folder; }; +static char *register_folder_desc(struct _mail_msg *mm, int done) +{ + struct _register_msg *m = (struct _register_msg *)mm; + + printf("returning description for %s\n", m->local_folder->uri); + + return g_strdup_printf(_("Opening '%s'"), m->local_folder->uri); +} static void register_folder_register(struct _mail_msg *mm) @@ -488,7 +496,7 @@ register_folder_register(struct _mail_msg *mm) camel_object_unref (CAMEL_OBJECT (store)); free_metainfo (meta); - camel_operation_register(mm->cancel); + camel_operation_unregister(mm->cancel); } static void @@ -518,17 +526,12 @@ register_folder_free(struct _mail_msg *mm) } static struct _mail_msg_op register_folder_op = { - NULL, + register_folder_desc, register_folder_register, register_folder_registered, register_folder_free, }; -static void new_status(struct _CamelOperation *op, const char *what, int pc, void *data) -{ - printf("oepration %s %d %% complete\n", what, pc); -} - static void local_storage_new_folder_cb (EvolutionStorageListener *storage_listener, const char *path, @@ -557,10 +560,6 @@ local_storage_new_folder_cb (EvolutionStorageListener *storage_listener, m->local_folder = local_folder; - /* HACK: so we reuse the cancel pointer */ - camel_operation_unref(m->msg.cancel); - m->msg.cancel = camel_operation_new(new_status, m); - /* run synchronous, the shell expects it (I think) */ id = m->msg.seq; e_thread_put(mail_thread_queued, (EMsg *)m); -- cgit v1.2.3