]> err.no Git - mapper/commitdiff
Fix cancel
authorKaj-Michael Lang <milang@tal.org>
Mon, 3 Mar 2008 15:19:22 +0000 (17:19 +0200)
committerKaj-Michael Lang <milang@tal.org>
Mon, 3 Mar 2008 15:19:22 +0000 (17:19 +0200)
src/import-gui.c

index f64ac88ef955efcb5fd968a557072831d9a6737a..b778ae3fe70ab4d21c0bebf0d68becfe9208473e 100644 (file)
@@ -87,7 +87,7 @@ gtk_box_pack_start(GTK_BOX(vbox), entry_db, TRUE, TRUE, 0);
 
 gtk_widget_show_all(dialog);
 
-if (GTK_RESPONSE_ACCEPT==gtk_dialog_run(GTK_DIALOG(dialog))) {
+while (GTK_RESPONSE_ACCEPT==gtk_dialog_run(GTK_DIALOG(dialog))) {
        gchar *planet, *db;
 
        planet=gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(picker_planet));
@@ -97,15 +97,14 @@ if (GTK_RESPONSE_ACCEPT==gtk_dialog_run(GTK_DIALOG(dialog))) {
                progress=gtk_progress_bar_new();
                import_dialog=progress_dialog(window, "Importing OSM data...", progress);
 
-               if (osm_import_bg(planet, db, osm_import_progress_cb, osm_import_done_cb)==TRUE)
-                       gtk_widget_destroy(dialog);
-               else
+               if (osm_import_bg(planet, db, osm_import_progress_cb, osm_import_done_cb)==TRUE) {
+                       break;
+               else
                        popup_error(dialog, _("Failed to start import."));
        } else {
                popup_error(dialog, _("Missing file selection!"));
        }
-} else {
-       gtk_widget_destroy(dialog);
 }
+gtk_widget_destroy(dialog);
 return TRUE;
 }