From cc8b4303f422643e9ed4327db4680cf87bcedd0a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 26 Nov 2021 15:22:19 +0100 Subject: GUI: Don't store stream filename in project There's already some confusion between "loading a stream into the GUI" and "adding a stream as a result". This should help resolve it, as well as simplifying multi-stream results (coming up). --- src/crystfel_gui.c | 11 ----------- src/gui_import.c | 6 ------ src/gui_project.c | 6 +----- src/gui_project.h | 1 - 4 files changed, 1 insertion(+), 23 deletions(-) (limited to 'src') diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c index 6dd9b37d..6268d64c 100644 --- a/src/crystfel_gui.c +++ b/src/crystfel_gui.c @@ -1091,17 +1091,6 @@ int main(int argc, char *argv[]) if ( dtempl != NULL ) { proj.dtempl = dtempl; } - } else if ( proj.stream_filename != NULL ) { - - Stream *st; - st = stream_open_for_read(proj.stream_filename); - if ( st != NULL ) { - char *geom_str = stream_geometry_file(st); - if ( geom_str != NULL ) { - proj.dtempl = data_template_new_from_string(geom_str); - } - } - stream_close(st); } act = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/centre"); diff --git a/src/gui_import.c b/src/gui_import.c index 3e432075..f340dd5f 100644 --- a/src/gui_import.c +++ b/src/gui_import.c @@ -277,7 +277,6 @@ int load_stream(struct crystfelproject *proj, char *stream_filename) /* Use the user's nominated DataTemplate over the one from the stream. * If it doesn't match, better that things break earlier. */ add_frames_from_stream(st, proj->dtempl, proj); - proj->stream_filename = stream_filename; stream_close(st); result_name = safe_basename(stream_filename); @@ -540,11 +539,6 @@ gint import_sig(GtkWidget *widget, struct crystfelproject *proj) FALSE, FALSE, 4.0); ctx->stream_chooser = gtk_file_chooser_button_new("Select stream file", GTK_FILE_CHOOSER_ACTION_OPEN); - if ( proj->stream_filename != NULL ) { - gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(ctx->stream_chooser), - proj->stream_filename); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(ctx->stream), TRUE); - } gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(ctx->stream_chooser), TRUE, TRUE, 2.0); diff --git a/src/gui_project.c b/src/gui_project.c index 6bda5d8e..42c28df4 100644 --- a/src/gui_project.c +++ b/src/gui_project.c @@ -565,7 +565,7 @@ static void handle_var(const char *key, const char *val, if ( strncmp(key, "stream.", 7) == 0 ) { parse_stream_opt(key, val, &proj->indexing_params); } else if ( strcmp(key, "stream") == 0 ) { - proj->stream_filename = strdup(val); + /* Ignore, kept for backwards compatability */ } if ( strcmp(key, "search_pattern") == 0 ) { @@ -918,9 +918,6 @@ int save_project(struct crystfelproject *proj) } fprintf(fh, "search_pattern %s\n", str_matchtype(proj->data_search_pattern)); - if ( proj->stream_filename != NULL ) { - fprintf(fh, "stream %s\n", proj->stream_filename); - } fprintf(fh, "peak_search_params.method %s\n", str_peaksearch(proj->peak_search_params.method)); @@ -1199,7 +1196,6 @@ int default_project(struct crystfelproject *proj) proj->peak_params = NULL; proj->data_top_folder = NULL; proj->data_search_pattern = 0; - proj->stream_filename = NULL; proj->dtempl = NULL; proj->cur_image = NULL; proj->indexing_opts = NULL; diff --git a/src/gui_project.h b/src/gui_project.h index e0bb7e66..84c7cd55 100644 --- a/src/gui_project.h +++ b/src/gui_project.h @@ -291,7 +291,6 @@ struct crystfelproject { int n_random_history; char *geom_filename; - char *stream_filename; char *data_top_folder; /* For convenience only. Filenames in * 'filenames' list should be complete */ enum match_type_id data_search_pattern; -- cgit v1.2.3