aboutsummaryrefslogtreecommitdiffstats
path: root/mail/test-thread.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-06-23 04:31:01 +0800
committerPeter Williams <peterw@src.gnome.org>2000-06-23 04:31:01 +0800
commit855dff022c610063a9524c19386f9e2863b88ae7 (patch)
treefc6fc22da5559cd7596d1ccb95be193b12cd0489 /mail/test-thread.c
parenta3a3ee2b1456314989686ed356108b7356c0a272 (diff)
downloadgsoc2013-evolution-855dff022c610063a9524c19386f9e2863b88ae7.tar
gsoc2013-evolution-855dff022c610063a9524c19386f9e2863b88ae7.tar.gz
gsoc2013-evolution-855dff022c610063a9524c19386f9e2863b88ae7.tar.bz2
gsoc2013-evolution-855dff022c610063a9524c19386f9e2863b88ae7.tar.lz
gsoc2013-evolution-855dff022c610063a9524c19386f9e2863b88ae7.tar.xz
gsoc2013-evolution-855dff022c610063a9524c19386f9e2863b88ae7.tar.zst
gsoc2013-evolution-855dff022c610063a9524c19386f9e2863b88ae7.zip
Make the async dialogs non-modal; add cleanup callbacks in the main thread.
svn path=/trunk/; revision=3694
Diffstat (limited to 'mail/test-thread.c')
-rw-r--r--mail/test-thread.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/mail/test-thread.c b/mail/test-thread.c
index a08cd63702..9c62e7f78c 100644
--- a/mail/test-thread.c
+++ b/mail/test-thread.c
@@ -13,6 +13,7 @@ static void op_2( gpointer userdata );
static void op_3( gpointer userdata );
static void op_4( gpointer userdata );
static void op_5( gpointer userdata );
+static void done( gpointer userdata );
static gboolean queue_ops( void );
static gboolean queue_ops( void )
@@ -22,13 +23,13 @@ static gboolean queue_ops( void )
g_message( "Top of queue_ops" );
- mail_operation_try( "The Crawling Progress Bar of Doom", op_1, NULL );
- mail_operation_try( "The Mysterious Message Setter", op_2, NULL );
- mail_operation_try( "The Error Dialog of No Return", op_3, NULL );
+ mail_operation_try( "The Crawling Progress Bar of Doom", op_1, done, "op1 finished" );
+ mail_operation_try( "The Mysterious Message Setter", op_2, done, "op2 finished" );
+ mail_operation_try( "The Error Dialog of No Return", op_3, done, "op3 finished" );
for( i = 0; i < 3; i++ ) {
sprintf( buf, "Queue Filler %d", i );
- mail_operation_try( buf, op_4, GINT_TO_POINTER( i ) );
+ mail_operation_try( buf, op_4, NULL, GINT_TO_POINTER( i ) );
}
g_message( "Waiting for finish..." );
@@ -36,18 +37,18 @@ static gboolean queue_ops( void )
g_message( "Ops done -- queue some more!" );
- mail_operation_try( "Progress Bar Redux", op_1, NULL );
+ mail_operation_try( "Progress Bar Redux", op_1, NULL, NULL );
g_message( "Waiting for finish again..." );
mail_operation_wait_for_finish();
g_message( "Ops done -- more, more!" );
- mail_operation_try( "Dastardly Password Stealer", op_5, NULL );
+ mail_operation_try( "Dastardly Password Stealer", op_5, NULL, NULL );
for( i = 0; i < 3; i++ ) {
sprintf( buf, "Queue Filler %d", i );
- mail_operation_try( buf, op_4, GINT_TO_POINTER( i ) );
+ mail_operation_try( buf, op_4, NULL, GINT_TO_POINTER( i ) );
}
g_message( "Waiting for finish AGAIN..." );
@@ -125,6 +126,11 @@ static void op_5( gpointer userdata )
sleep( 1 );
}
+static void done( gpointer userdata )
+{
+ g_message( "Operation done: %s", (gchar *) userdata );
+}
+
int main( int argc, char **argv )
{
g_thread_init( NULL );