aboutsummaryrefslogtreecommitdiff
path: root/src/gui_import.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-02-25 16:39:11 +0100
committerThomas White <taw@physics.org>2021-02-25 16:39:11 +0100
commit32fa3814ff7f70acddf0d9de2e1184bd10affaec (patch)
treedd7256393bd12186cfef63a39b5a396adf631ae9 /src/gui_import.c
parente9279204f365ce6b3bf61716b1af2fdb29efcc0d (diff)
GUI: Complain more loudly if geometry can't be loaded
Diffstat (limited to 'src/gui_import.c')
-rw-r--r--src/gui_import.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui_import.c b/src/gui_import.c
index f6e36b85..94d04d24 100644
--- a/src/gui_import.c
+++ b/src/gui_import.c
@@ -387,19 +387,24 @@ static void finddata_response_sig(GtkWidget *dialog, gint resp,
gchar *geom_filename;
geom_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(ctx->geom_file));
- if ( geom_filename == NULL ) return;
+ if ( geom_filename == NULL ) {
+ error_box(proj, "Geometry file not found");
+ return;
+ }
g_free(proj->geom_filename);
proj->geom_filename = geom_filename;
data_template_free(proj->dtempl);
proj->dtempl = data_template_new_from_file(geom_filename);
- if ( proj->dtempl == NULL ) return;
+ if ( proj->dtempl == NULL ) {
+ error_box(proj, "Invalid geometry file");
+ return;
+ }
}
} /* else don't touch the geometry */
if ( (import_mode(ctx) != IMPORT_STREAM) && (proj->dtempl == NULL) ) {
- printf("No geometry!\n");
- ERROR("No geom!\n");
+ error_box(proj, "You must specify the geometry file.");
return;
}