diff options
author | Iain Holmes <iain@src.gnome.org> | 2001-08-30 06:14:02 +0800 |
---|---|---|
committer | Iain Holmes <iain@src.gnome.org> | 2001-08-30 06:14:02 +0800 |
commit | 8d8d02da690396538a009e4caf67ea6e4cfa8a95 (patch) | |
tree | 7e6555a595963d76df0e1c5c97dde07b1d535ce6 /importers/netscape-importer.c | |
parent | a036c22b744939540ce776e76826f215cf7d81a2 (diff) | |
download | gsoc2013-evolution-8d8d02da690396538a009e4caf67ea6e4cfa8a95.tar gsoc2013-evolution-8d8d02da690396538a009e4caf67ea6e4cfa8a95.tar.gz gsoc2013-evolution-8d8d02da690396538a009e4caf67ea6e4cfa8a95.tar.bz2 gsoc2013-evolution-8d8d02da690396538a009e4caf67ea6e4cfa8a95.tar.lz gsoc2013-evolution-8d8d02da690396538a009e4caf67ea6e4cfa8a95.tar.xz gsoc2013-evolution-8d8d02da690396538a009e4caf67ea6e4cfa8a95.tar.zst gsoc2013-evolution-8d8d02da690396538a009e4caf67ea6e4cfa8a95.zip |
Importer changes
svn path=/trunk/; revision=12521
Diffstat (limited to 'importers/netscape-importer.c')
-rw-r--r-- | importers/netscape-importer.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/importers/netscape-importer.c b/importers/netscape-importer.c index 097da9339b..8c4283dc99 100644 --- a/importers/netscape-importer.c +++ b/importers/netscape-importer.c @@ -102,11 +102,12 @@ create_importer_gui (NetscapeImporter *importer) { GtkWidget *dialog; - dialog = gnome_message_box_new ("", GNOME_MESSAGE_BOX_INFO, NULL); + dialog = gnome_message_box_new (_("Evolution is importing your old Netscape data"), GNOME_MESSAGE_BOX_INFO, NULL); gtk_window_set_title (GTK_WINDOW (dialog), _("Importing...")); importer->label = gtk_label_new (_("Please wait")); importer->progressbar = gtk_progress_bar_new (); + gtk_progress_set_activity_mode (GTK_PROGRESS (importer->progressbar), TRUE); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), importer->label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), @@ -558,6 +559,21 @@ netscape_can_import (EvolutionIntelligentImporter *ii, } } +static gboolean +importer_timeout_fn (gpointer data) +{ + NetscapeImporter *importer = (NetscapeImporter *) data; + CORBA_Object objref; + CORBA_Environment ev; + + CORBA_exception_init (&ev); + objref = bonobo_object_corba_objref (BONOBO_OBJECT (importer->listener)); + GNOME_Evolution_Importer_processItem (importer->importer, objref, &ev); + CORBA_exception_free (&ev); + + return FALSE; +} + static void importer_cb (EvolutionImporterListener *listener, EvolutionImporterResult result, @@ -568,7 +584,23 @@ importer_cb (EvolutionImporterListener *listener, CORBA_Object objref; CORBA_Environment ev; + if (result == EVOLUTION_IMPORTER_NOT_READY || + result == EVOLUTION_IMPORTER_BUSY) { + gtk_timeout_add (5000, importer_timeout_fn, data); + return; + } + if (more_items) { + GtkAdjustment *adj; + float newval; + + adj = GTK_PROGRESS (importer->progressbar)->adjustment; + newval = adj->value + 1; + if (newval > adj->upper) { + newval = adj->lower; + } + + gtk_progress_set_value (GTK_PROGRESS (importer->progressbar), newval); CORBA_exception_init (&ev); objref = bonobo_object_corba_objref (BONOBO_OBJECT (importer->listener)); GNOME_Evolution_Importer_processItem (importer->importer, @@ -582,8 +614,6 @@ importer_cb (EvolutionImporterListener *listener, return; } - gtk_progress_set_value (GTK_PROGRESS (importer->progressbar), 1); - if (importer->dir_list) { import_next (importer); } else { |