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));
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;
}