aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-28 23:04:38 +0000
committertaw27 <taw27@bf6ca9ba-c028-0410-8290-897cf20841d1>2007-10-28 23:04:38 +0000
commit84538e5734e50761731b7a5554dbd3c749635521 (patch)
tree375a319527936725d31bfe2e4ed6b892b5825c9b
parent7363aac90000245b866d85fea61f1928c755d813 (diff)
Trap if no cache filename specified and PEAKSEARCH_CACHED set
git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@183 bf6ca9ba-c028-0410-8290-897cf20841d1
-rw-r--r--src/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index d9fe3d3..5335a19 100644
--- a/src/main.c
+++ b/src/main.c
@@ -80,7 +80,13 @@ static gint main_method_window_response(GtkWidget *method_window, gint response,
ctx->finecentering = FALSE;
}
- ctx->cache_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(ctx->cache_file_selector));
+ if ( ctx->psmode == PEAKSEARCH_CACHED ) {
+ ctx->cache_filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(ctx->cache_file_selector));
+ if ( !ctx->cache_filename ) {
+ fprintf(stderr, "Please specify a cache filename!\n");
+ gtk_exit(1);
+ }
+ }
gtk_widget_destroy(method_window);
while ( gtk_events_pending() ) gtk_main_iteration();