aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-06-27 02:21:45 +0800
committerPeter Williams <peterw@src.gnome.org>2000-06-27 02:21:45 +0800
commite923d2eea9e325677c57f88e1209765acb306846 (patch)
treed6d04bad75e1d5449799db9a27cf7279c5152ca9 /mail
parenta6123511735299f9811a40ed55344a9fcba90655 (diff)
downloadgsoc2013-evolution-e923d2eea9e325677c57f88e1209765acb306846.tar
gsoc2013-evolution-e923d2eea9e325677c57f88e1209765acb306846.tar.gz
gsoc2013-evolution-e923d2eea9e325677c57f88e1209765acb306846.tar.bz2
gsoc2013-evolution-e923d2eea9e325677c57f88e1209765acb306846.tar.lz
gsoc2013-evolution-e923d2eea9e325677c57f88e1209765acb306846.tar.xz
gsoc2013-evolution-e923d2eea9e325677c57f88e1209765acb306846.tar.zst
gsoc2013-evolution-e923d2eea9e325677c57f88e1209765acb306846.zip
Make the broken threads optional
svn path=/trunk/; revision=3740
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/component-factory.c32
-rw-r--r--mail/mail-ops.c25
-rw-r--r--mail/mail-threads.c16
-rw-r--r--mail/mail-threads.h3
5 files changed, 84 insertions, 4 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 7ee2d3492f..3677035550 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,15 @@
+2000-06-26 Peter Williams <peterw@helixcode.com>
+
+ * component-factory.c, mail-ops.c: #ifdef the threads stuff so
+ that if USE_BROKEN_THREADS is not defined we just call the functions
+ in the main thread.
+
+ * mail-threads.h: Don't declare funcs if USE_BROKEN_THREADS not
+ defined.
+
+ * mail-threads.c: Put the query and message boxes on top so that
+ you can see them.
+
2000-06-26 Jeffrey Stedfast <fejj@helixcode.com>
* mail-config.c (error_dialog): va_start() returns void, don't
diff --git a/mail/component-factory.c b/mail/component-factory.c
index a48ac18379..fd1ff42a60 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -303,8 +303,13 @@ create_imap_storage (EvolutionShellComponent *shell_component)
ii = g_new( struct create_info_s, 1 );
ii->storage = storage;
ii->source = g_strdup( source );
- mail_operation_try( "Create IMAP Storage", real_create_imap_storage, g_free, ii );
+#ifdef USE_BROKEN_THREADS
+ mail_operation_try( "Create IMAP Storage", real_create_imap_storage, g_free, ii );
+#else
+ real_create_imap_storage( ii );
+ g_free( ii );
+#endif
/* Note the g_free as our cleanup function deleting the ii struct when we're done */
}
@@ -324,9 +329,10 @@ real_create_imap_storage( gpointer user_data )
storage = ii->storage;
source = ii->source;
+#ifdef USE_BROKEN_THREADS
mail_op_hide_progressbar();
mail_op_set_message( "Connecting to IMAP service..." );
-
+#endif
ex = camel_exception_new ();
store = camel_session_get_store (session, source, ex);
@@ -339,7 +345,9 @@ real_create_imap_storage( gpointer user_data )
goto cleanup;
}
+#ifdef USE_BROKEN_THREADS
mail_op_set_message( "Connected. Examining folders..." );
+#endif
folder = camel_store_get_root_folder (store, ex);
if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE) {
@@ -360,15 +368,19 @@ real_create_imap_storage( gpointer user_data )
buf = g_strdup_printf ("%s/%s", source, path);
g_print ("Adding %s\n", path);
+#ifdef USE_BROKEN_THREADS
mail_op_set_message( "Adding %s", path );
+#endif
evolution_storage_new_folder (storage, path, "mail", buf, "description");
}
cleanup:
g_free( ii->source );
+#ifdef USE_BROKEN_THREADS
if( camel_exception_is_set( ex ) )
mail_op_error( "%s", camel_exception_get_description( ex ) );
+#endif
camel_exception_free (ex);
}
@@ -414,8 +426,13 @@ create_news_storage (EvolutionShellComponent *shell_component)
ni = g_new( struct create_info_s, 1 );
ni->storage = storage;
ni->source = g_strdup( source );
- mail_operation_try( "Create News Storage", real_create_news_storage, g_free, ni );
+#ifdef USE_BROKEN_THREADS
+ mail_operation_try( "Create News Storage", real_create_news_storage, g_free, ni );
+#else
+ real_create_news_storage( ni );
+ g_free( ni );
+#endif
/* again note the g_free cleanup func */
}
@@ -435,8 +452,10 @@ real_create_news_storage( gpointer user_data )
storage = ni->storage;
source = ni->source;
+#ifdef USE_BROKEN_THREADS
mail_op_hide_progressbar();
mail_op_set_message( "Connecting to news service..." );
+#endif
ex = camel_exception_new ();
@@ -450,7 +469,9 @@ real_create_news_storage( gpointer user_data )
goto cleanup;
}
+#ifdef USE_BROKEN_THREADS
mail_op_set_message( "Connected. Examining folders..." );
+#endif
folder = camel_store_get_root_folder (store, ex);
if (camel_exception_get_id (ex) != CAMEL_EXCEPTION_NONE) {
@@ -468,15 +489,18 @@ real_create_news_storage( gpointer user_data )
buf = g_strdup_printf ("%s%s", source, path);
g_print ("Adding %s\n", path);
+#ifdef USE_BROKEN_THREADS
mail_op_set_message( "Adding %s", path );
-
+#endif
/* FIXME: should be s,"mail","news",? */
evolution_storage_new_folder (storage, path, "mail", buf, "description");
}
cleanup:
g_free( ni->source );
+#ifdef USE_BROKEN_THREADS
if( camel_exception_is_set( ex ) )
mail_op_error( "%s", camel_exception_get_description( ex ) );
+#endif
camel_exception_free (ex);
}
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index feddab24e2..7ba935be8a 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -86,11 +86,15 @@ mail_exception_dialog (char *head, CamelException *ex, gpointer widget)
g_free (msg);
}
+#ifdef USE_BROKEN_THREADS
static void
async_mail_exception_dialog (char *head, CamelException *ex, gpointer unused )
{
mail_op_error( "%s: %s", head, camel_exception_get_description( ex ) );
}
+#else
+#define async_mail_exception_dialog mail_exception_dialog
+#endif
static gboolean
check_configured (void)
@@ -326,7 +330,11 @@ fetch_mail (GtkWidget *button, gpointer user_data)
info = g_new( rfm_t, 1 );
info->fb = FOLDER_BROWSER( user_data );
info->source_url = url;
+#ifdef USE_BROKEN_THREADS
mail_operation_try( _("Fetching mail"), real_fetch_mail, NULL, info );
+#else
+ real_fetch_mail( info );
+#endif
}
static gboolean
@@ -360,8 +368,10 @@ real_send_mail( gpointer user_data )
char *from = NULL;
struct post_send_data *psd = NULL;
+#ifdef USE_BROKEN_THREADS
mail_op_hide_progressbar();
mail_op_set_message( "Connecting to transport..." );
+#endif
ex = camel_exception_new ();
composer = info->composer;
@@ -378,13 +388,17 @@ real_send_mail( gpointer user_data )
camel_service_connect (CAMEL_SERVICE (transport), ex);
+#ifdef USE_BROKEN_THREADS
mail_op_set_message( "Connected. Sending..." );
+#endif
if (!camel_exception_is_set (ex))
camel_transport_send (transport, CAMEL_MEDIUM (message), ex);
if (!camel_exception_is_set (ex)) {
+#ifdef USE_BROKEN_THREADS
mail_op_set_message( "Sent. Disconnecting..." );
+#endif
camel_service_disconnect (CAMEL_SERVICE (transport), ex);
}
@@ -490,7 +504,12 @@ composer_send_cb (EMsgComposer *composer, gpointer data)
info->from = from;
info->psd = psd;
+#ifdef USE_BROKEN_THREADS
mail_operation_try( "Send Message", real_send_mail, cleanup_send_mail, info );
+#else
+ real_send_mail( info );
+ cleanup_send_mail( info );
+#endif
}
static void
@@ -631,8 +650,10 @@ static void real_expunge_folder( gpointer user_data )
FolderBrowser *fb = FOLDER_BROWSER(user_data);
CamelException ex;
+#ifdef USE_BROKEN_THREADS
mail_op_hide_progressbar();
mail_op_set_message( "Expunging %s...", fb->message_list->folder->full_name );
+#endif
camel_exception_init(&ex);
@@ -653,7 +674,11 @@ expunge_folder (BonoboUIHandler *uih, void *user_data, const char *path)
FolderBrowser *fb = FOLDER_BROWSER(user_data);
if (fb->message_list->folder) {
+#ifdef USE_BROKEN_THREADS
mail_operation_try( "Expunge Folder", real_expunge_folder, NULL, fb );
+#else
+ real_expunge_folder( fb );
+#endif
}
}
diff --git a/mail/mail-threads.c b/mail/mail-threads.c
index 949c9c4a7c..c0c16fc7ff 100644
--- a/mail/mail-threads.c
+++ b/mail/mail-threads.c
@@ -762,6 +762,14 @@ static void show_error( com_msg_t *msg )
timeout_toggle( FALSE );
modal_may_proceed = FALSE;
gtk_widget_show( GTK_WIDGET( err_dialog ) );
+ gnome_win_hints_set_layer( err_dialog,
+ WIN_LAYER_ONTOP );
+ gnome_win_hints_set_state( err_dialog,
+ WIN_STATE_ARRANGE_IGNORE );
+ gnome_win_hints_set_hints( err_dialog,
+ WIN_HINTS_SKIP_FOCUS |
+ WIN_HINTS_SKIP_WINLIST |
+ WIN_HINTS_SKIP_TASKBAR );
}
/**
@@ -809,6 +817,14 @@ static void get_password( com_msg_t *msg )
*(msg->reply) = NULL;
timeout_toggle( FALSE );
gtk_widget_show( GTK_WIDGET( dialog ) );
+ gnome_win_hints_set_layer( dialog,
+ WIN_LAYER_ONTOP );
+ gnome_win_hints_set_state( dialog,
+ WIN_STATE_ARRANGE_IGNORE );
+ gnome_win_hints_set_hints( dialog,
+ WIN_HINTS_SKIP_FOCUS |
+ WIN_HINTS_SKIP_WINLIST |
+ WIN_HINTS_SKIP_TASKBAR );
}
}
diff --git a/mail/mail-threads.h b/mail/mail-threads.h
index d3f2a184e3..e26acdbb14 100644
--- a/mail/mail-threads.h
+++ b/mail/mail-threads.h
@@ -25,6 +25,7 @@
#ifndef _MAIL_THREADS_H_
#define _MAIL_THREADS_H_
+#ifdef USE_BROKEN_THREADS
/* Schedule to operation to happen eventually */
gboolean mail_operation_try( const gchar *description,
@@ -46,4 +47,6 @@ void mail_operation_wait_for_finish( void );
gboolean mail_operations_are_executing( void );
+#endif /* defined USE_BROKEN_THREADS */
+
#endif /* defined _MAIL_THREADS_H_ */