aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-08-27 15:12:34 +0200
committerThomas White <taw@physics.org>2020-08-27 15:12:34 +0200
commitfd1ac49e0a97dadf4a87cde83840cd80863c57ca (patch)
treef9cbd85bd8d48b94d45249799f262500aa8451a7
parentda3553b033ff4b00ce301a6d6122c1cbab16dbe0 (diff)
Don't close indexing dialog if there is a problem
-rw-r--r--src/gui_index.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/gui_index.c b/src/gui_index.c
index ffcadb9b..7e9401a6 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -89,9 +89,9 @@ static void get_indexing_opts(struct crystfelproject *proj,
}
-static void run_indexing_all(struct crystfelproject *proj,
- int backend_idx, const char *job_title,
- const char *job_notes)
+static int run_indexing_all(struct crystfelproject *proj,
+ int backend_idx, const char *job_title,
+ const char *job_notes)
{
struct crystfel_backend *be;
void *job_priv;
@@ -109,6 +109,9 @@ static void run_indexing_all(struct crystfelproject *proj,
if ( job_priv != NULL ) {
add_running_task(proj, "Indexing all frames",
be, job_priv);
+ return 0;
+ } else {
+ return 1;
}
}
@@ -158,14 +161,19 @@ static void index_all_response_sig(GtkWidget *dialog, gint resp,
free(njp->proj->indexing_new_job_title);
njp->proj->indexing_new_job_title = strdup(job_title);
- run_indexing_all(njp->proj, backend_idx,
- job_title, job_notes);
+ if ( run_indexing_all(njp->proj, backend_idx,
+ job_title, job_notes) == 0 )
+ {
+ gtk_widget_destroy(dialog);
+ njp->proj->indexing_opts = NULL;
+ }
free(job_notes);
- }
- gtk_widget_destroy(dialog);
- njp->proj->indexing_opts = NULL;
+ } else {
+ gtk_widget_destroy(dialog);
+ njp->proj->indexing_opts = NULL;
+ }
}