aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--shell/ChangeLog7
-rw-r--r--shell/e-shell-importer.c25
2 files changed, 22 insertions, 10 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index dc5f7d4fae..a15b3dfcca 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,12 @@
2004-04-14 JP Rosevear <jpr@ximian.com>
+ * e-shell-importer.c (get_iid_for_filetype): differentiate between
+ user cancellation and no importer
+ (next_file_page): don't throw up a dialog if the user cancelled
+ the selection process
+
+2004-04-14 JP Rosevear <jpr@ximian.com>
+
* e-shell-importer.c (start_import): don't unref the dialog,
destroy it properly
diff --git a/shell/e-shell-importer.c b/shell/e-shell-importer.c
index 79c961ef7d..18268cc004 100644
--- a/shell/e-shell-importer.c
+++ b/shell/e-shell-importer.c
@@ -370,13 +370,12 @@ choose_importer_from_list (GList *importer_list)
return g_strdup (iid);
}
-static char *
-get_iid_for_filetype (const char *filename)
+static gboolean
+get_iid_for_filetype (const char *filename, char **ret_iid)
{
Bonobo_ServerInfoList *info_list;
CORBA_Environment ev;
GList *can_handle = NULL;
- char *ret_iid;
int i, len = 0;
CORBA_exception_init (&ev);
@@ -420,22 +419,24 @@ get_iid_for_filetype (const char *filename)
iid = can_handle->data;
- ret_iid = g_strdup (iid->iid);
+ *ret_iid = g_strdup (iid->iid);
free_iid_list (can_handle);
g_list_free (can_handle);
- return ret_iid;
+ return TRUE;
} else if (len > 1) {
/* Display all the IIDs */
- ret_iid = choose_importer_from_list (can_handle);
+ *ret_iid = choose_importer_from_list (can_handle);
free_iid_list (can_handle);
g_list_free (can_handle);
- return ret_iid;
+ return *ret_iid ? TRUE : FALSE;
} else {
- return NULL;
+ *ret_iid = NULL;
+
+ return TRUE;
}
}
@@ -482,7 +483,7 @@ start_import (gpointer parent, const char *filename, EvolutionImporterClient *cl
g_object_unref (icd->client);
if (icd->dialog)
- gtk_widget_destroy (icd->dialog);
+ gtk_widget_destroy (GTK_WIDGET (icd->dialog));
g_free (icd);
return;
}
@@ -1029,7 +1030,11 @@ next_file_page (GnomeDruidPage *page,
/* Work out the component to use */
if (data->choosen_iid == NULL || strcmp (data->choosen_iid, "Automatic") == 0) {
- real_iid = get_iid_for_filetype (data->filename);
+ if (!get_iid_for_filetype (data->filename, &real_iid)) {
+ gnome_druid_set_page (druid, GNOME_DRUID_PAGE (data->filedialog));
+
+ return TRUE;
+ }
} else {
real_iid = g_strdup (data->choosen_iid);
}