aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-11-26 15:22:19 +0100
committerThomas White <taw@physics.org>2021-11-26 15:28:22 +0100
commitcc8b4303f422643e9ed4327db4680cf87bcedd0a (patch)
treef16ccd3ca2b42a6c1b8e3623af170b30de0b730e /src
parenta509bb92bfe3ba9525e6e348a5674c6df1f17c15 (diff)
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).
Diffstat (limited to 'src')
-rw-r--r--src/crystfel_gui.c11
-rw-r--r--src/gui_import.c6
-rw-r--r--src/gui_project.c6
-rw-r--r--src/gui_project.h1
4 files changed, 1 insertions, 23 deletions
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;