diff options
Diffstat (limited to 'src/gui_project.c')
-rw-r--r-- | src/gui_project.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gui_project.c b/src/gui_project.c index 638ee065..53874121 100644 --- a/src/gui_project.c +++ b/src/gui_project.c @@ -37,6 +37,7 @@ #include <assert.h> #include "gui_project.h" +#include "crystfel_gui.h" #include "gui_backend_local.h" #include "gui_backend_slurm.h" @@ -565,6 +566,7 @@ static void read_results(FILE *fh, struct crystfelproject *proj) char **streams = NULL; int n_streams = 0; char *results_name = NULL; + int selected = 0; do { @@ -576,17 +578,27 @@ static void read_results(FILE *fh, struct crystfelproject *proj) if ( strncmp(line, "Result ", 7) == 0 ) { if ( n_streams > 0 ) { + /* Add the previously-read result */ add_result(proj, results_name, streams, n_streams); + + if ( selected ) { + select_result(proj, results_name); + } } n_streams = 0; + selected = 0; streams = NULL; results_name = strdup(line+7); } + if ( strncmp(line, " Selected", 11) == 0 ) { + selected = 1; + } + if ( strncmp(line, " Stream ", 10) == 0 ) { streams = add_stream(strdup(line+10), streams, @@ -600,6 +612,10 @@ static void read_results(FILE *fh, struct crystfelproject *proj) results_name, streams, n_streams); + + if ( selected ) { + select_result(proj, results_name); + } } break; @@ -836,6 +852,11 @@ int save_project(struct crystfelproject *proj) fprintf(fh, " Stream %s\n", proj->results[i].streams[j]); } + if ( strcmp(selected_result(proj), + proj->results[i].name) == 0 ) + { + fprintf(fh, " Selected\n"); + } } fprintf(fh, "-----\n"); |