From 681fbbe63fc58fe0783310f840f7de390470b351 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 2 Dec 2021 15:48:52 +0100 Subject: GUI: Add a checkbox for automatically rescanning streams Usually, one will want this option enabled. However, sometimes it speeds things up a lot to disable it. Fixes: https://gitlab.desy.de/thomas.white/crystfel/-/issues/54 --- src/crystfel_gui.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/crystfel_gui.c') diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c index 165ed666..177b6499 100644 --- a/src/crystfel_gui.c +++ b/src/crystfel_gui.c @@ -178,6 +178,8 @@ static int should_rescan_streams(struct crystfelproject *proj) { GSList *item = proj->tasks; + if ( !proj->rescan_on_change ) return 0; + if ( !proj->scanned_since_last_job_finished ) { proj->scanned_since_last_job_finished = 1; return 1; @@ -657,6 +659,13 @@ static gint results_combo_changed_sig(GtkComboBox *w, } +static gint rescan_on_change_sig(GtkWidget *w, struct crystfelproject *proj) +{ + proj->rescan_on_change = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); + return FALSE; +} + + static gint show_centre_sig(GtkWidget *w, struct crystfelproject *proj) { proj->show_centre = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); @@ -711,6 +720,7 @@ static void add_menu_bar(struct crystfelproject *proj, GtkWidget *vbox) " " "" "" + " " " " " " "" @@ -752,6 +762,8 @@ static void add_menu_bar(struct crystfelproject *proj, GtkWidget *vbox) G_CALLBACK(label_refls_sig), FALSE }, { "CentreAction", NULL, "Beam centre", NULL, NULL, G_CALLBACK(show_centre_sig), FALSE }, + { "RescanOnChangeAction", NULL, "Rescan streams when changing frame", NULL, NULL, + G_CALLBACK(rescan_on_change_sig), FALSE }, }; proj->action_group = gtk_action_group_new("cellwindow"); -- cgit v1.2.3