From 79b8daba1e34e0c16104966314213ce1d0ad7b56 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 7 Dec 2020 10:16:58 +0100 Subject: GUI: Select result when loading stream --- src/crystfel_gui.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c index 7be8e67b..5dd5cedb 100644 --- a/src/crystfel_gui.c +++ b/src/crystfel_gui.c @@ -129,6 +129,13 @@ static void swap_data_arrays(struct image *a, struct image *b) } +static void select_result(struct crystfelproject *proj, + const char *result_name) +{ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(proj->results_combo), + result_name); +} + /* Bring the image view up to date after changing the selected image */ void update_imageview(struct crystfelproject *proj) @@ -424,10 +431,10 @@ static void finddata_response_sig(GtkWidget *dialog, gint resp, streams = malloc(sizeof(char *)); if ( streams != NULL ) { + char *result_name = safe_basename(stream_filename); streams[0] = strdup(stream_filename); - add_result(proj, - safe_basename(stream_filename), - streams, 1); + add_result(proj, result_name, streams, 1); + select_result(proj, result_name); } crystfel_image_view_set_show_peaks(CRYSTFEL_IMAGE_VIEW(proj->imageview), -- cgit v1.2.3