From c68488f1f82883ab025093cdcc6af4d43ce43cd5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 3 Jul 2020 10:30:20 +0200 Subject: Special cases for stream --- src/crystfel_gui.c | 13 +++++++++---- src/gui_project.c | 14 ++++++++------ 2 files changed, 17 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/crystfel_gui.c b/src/crystfel_gui.c index ee4d2203..18c70b3f 100644 --- a/src/crystfel_gui.c +++ b/src/crystfel_gui.c @@ -863,11 +863,16 @@ int main(int argc, char *argv[]) DataTemplate *dtempl; GtkAction *w; proj.cur_frame = 0; - dtempl = data_template_new_from_file(proj.geom_filename); - if ( dtempl != NULL ) { - crystfel_image_view_set_datatemplate(CRYSTFEL_IMAGE_VIEW(proj.imageview), - dtempl); + + if ( proj.geom_filename != NULL ) { + dtempl = data_template_new_from_file(proj.geom_filename); + if ( dtempl != NULL ) { + crystfel_image_view_set_datatemplate(CRYSTFEL_IMAGE_VIEW(proj.imageview), + dtempl); + proj.dtempl = dtempl; + } } + w = gtk_ui_manager_get_action(proj.ui, "/mainwindow/view/peaks"); gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(w), proj.show_peaks); diff --git a/src/gui_project.c b/src/gui_project.c index 280cc1be..22458daa 100644 --- a/src/gui_project.c +++ b/src/gui_project.c @@ -383,12 +383,14 @@ int save_project(struct crystfelproject *proj) fprintf(fh, "backend %s\n", proj->backend->name); fprintf(fh, "-----\n"); - for ( i=0; in_frames; i++ ) { - if ( proj->events[i] != NULL ) { - fprintf(fh, "%s %s\n", - proj->filenames[i], proj->events[i]); - } else { - fprintf(fh, "%s\n", proj->filenames[i]); + if ( proj->stream == NULL ) { + for ( i=0; in_frames; i++ ) { + if ( proj->events[i] != NULL ) { + fprintf(fh, "%s %s\n", + proj->filenames[i], proj->events[i]); + } else { + fprintf(fh, "%s\n", proj->filenames[i]); + } } } -- cgit v1.2.3