aboutsummaryrefslogtreecommitdiffstats
path: root/shell/importer/importer.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-01-23 08:37:44 +0800
committerIain Holmes <iain@src.gnome.org>2001-01-23 08:37:44 +0800
commit9908f0dba12569b2b9fe0b48de9d46ec3f2386bc (patch)
tree70cb90835c03f9f38014008932e5695e63ae47e0 /shell/importer/importer.c
parentff2d16601e0b4b71339b0820f4d2a5e0e92fdb92 (diff)
downloadgsoc2013-evolution-9908f0dba12569b2b9fe0b48de9d46ec3f2386bc.tar
gsoc2013-evolution-9908f0dba12569b2b9fe0b48de9d46ec3f2386bc.tar.gz
gsoc2013-evolution-9908f0dba12569b2b9fe0b48de9d46ec3f2386bc.tar.bz2
gsoc2013-evolution-9908f0dba12569b2b9fe0b48de9d46ec3f2386bc.tar.lz
gsoc2013-evolution-9908f0dba12569b2b9fe0b48de9d46ec3f2386bc.tar.xz
gsoc2013-evolution-9908f0dba12569b2b9fe0b48de9d46ec3f2386bc.tar.zst
gsoc2013-evolution-9908f0dba12569b2b9fe0b48de9d46ec3f2386bc.zip
New listener object. Plus some oneway stuff as well.
svn path=/trunk/; revision=7729
Diffstat (limited to 'shell/importer/importer.c')
-rw-r--r--shell/importer/importer.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/shell/importer/importer.c b/shell/importer/importer.c
index 7bbec3aa66..1d245eb721 100644
--- a/shell/importer/importer.c
+++ b/shell/importer/importer.c
@@ -125,6 +125,7 @@ put_html (GtkHTML *html,
/* Data to be passed around */
typedef struct _ImporterComponentData {
EvolutionImporterClient *client;
+ EvolutionImporterListener *listener;
char *filename;
GnomeDialog *dialog;
@@ -138,7 +139,7 @@ typedef struct _ImporterComponentData {
static gboolean importer_timeout_fn (gpointer data);
static void
-import_cb (EvolutionImporterClient *client,
+import_cb (EvolutionImporterListener *listener,
EvolutionImporterResult result,
gboolean more_items,
void *data)
@@ -166,7 +167,13 @@ import_cb (EvolutionImporterClient *client,
return;
}
+ if (result == EVOLUTION_IMPORTER_BUSY) {
+ gtk_timeout_add (5000, importer_timeout_fn, data);
+ return;
+ }
+
if (more_items) {
+ g_warning ("Processing...\n");
label = g_strdup_printf (_("Importing %s\nImporting item %d."),
icd->filename, ++(icd->item));
gtk_label_set_text (GTK_LABEL (icd->contents), label);
@@ -174,14 +181,16 @@ import_cb (EvolutionImporterClient *client,
while (gtk_events_pending ())
gtk_main_iteration ();
- evolution_importer_client_process_item (client, import_cb, data);
+ g_idle_add_full (G_PRIORITY_LOW, importer_timeout_fn,
+ data, NULL);
return;
}
}
g_free (icd->filename);
if (!icd->destroyed)
- gtk_object_unref (GTK_OBJECT (icd->dialog));
+ gtk_object_destroy (GTK_OBJECT (icd->dialog));
+ bonobo_object_unref (BONOBO_OBJECT (icd->listener));
bonobo_object_unref (BONOBO_OBJECT (icd->client));
g_free (icd);
}
@@ -192,6 +201,7 @@ importer_timeout_fn (gpointer data)
ImporterComponentData *icd = (ImporterComponentData *) data;
char *label;
+ g_warning ("Idle called");
label = g_strdup_printf (_("Importing %s\nImporting item %d."),
icd->filename, icd->item);
gtk_label_set_text (GTK_LABEL (icd->contents), label);
@@ -199,7 +209,7 @@ importer_timeout_fn (gpointer data)
while (gtk_events_pending ())
gtk_main_iteration ();
- evolution_importer_client_process_item (icd->client, import_cb, data);
+ evolution_importer_client_process_item (icd->client, icd->listener);
return FALSE;
}
@@ -342,8 +352,9 @@ start_import (const char *filename,
g_free (label);
while (gtk_events_pending ())
gtk_main_iteration ();
-
- evolution_importer_client_process_item (icd->client, import_cb, icd);
+
+ icd->listener = evolution_importer_listener_new (import_cb, icd);
+ evolution_importer_client_process_item (icd->client, icd->listener);
}
static void