diff options
author | Thomas White <taw@physics.org> | 2020-12-07 10:16:58 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-12-07 10:16:58 +0100 |
commit | 79b8daba1e34e0c16104966314213ce1d0ad7b56 (patch) | |
tree | 62ba10e87ab94a86b6844ad48692a7c8ac6f0b34 | |
parent | 27fbe3bf46c7c114e32a745b369e8f05902f75fc (diff) |
GUI: Select result when loading stream
-rw-r--r-- | src/crystfel_gui.c | 13 |
1 files 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), |