From 47d41f7b12d3b78e83c64bae11b77d23bfa1be5c Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 17 Feb 2023 12:00:47 +0100 Subject: GUI: Add a reminder about the space group in the export headers --- src/gui_export.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'src') diff --git a/src/gui_export.c b/src/gui_export.c index c0fbfd1c..a5dffb9a 100644 --- a/src/gui_export.c +++ b/src/gui_export.c @@ -50,6 +50,7 @@ struct export_window { struct crystfelproject *proj; + GtkWidget *window; GtkWidget *cell_chooser; GtkWidget *limit_res; GtkWidget *min_res; @@ -124,6 +125,19 @@ static int export_to_mtz(struct gui_merge_result *result, } +void reminder(GtkWidget *window, const char *message) +{ + GtkWidget *dialog = gtk_message_dialog_new_with_markup(GTK_WINDOW(window), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + message); + gtk_window_set_title(GTK_WINDOW(dialog), "Reminder"); + gtk_dialog_run(GTK_DIALOG(dialog)); + gtk_widget_destroy(dialog); +} + + static int export_data(struct export_window *win, char *filename) { gchar *cell_filename; @@ -176,10 +190,44 @@ static int export_data(struct export_window *win, char *filename) if ( strcmp(format, "mtz") == 0 ) { r = export_to_mtz(result, filename, cell, min_res, max_res, 0); + reminder(win->window, + "CrystFEL does not know the space " + "group of your structure.\n\n" + "The space group written into the MTZ header is just " + "a representation of the processing done within " + "CrystFEL.\n\n" + "You may need to change the space group in the MTZ " + "header, to allow structure solution programs to find " + "the correct space group.\n\n" + "" + "Click here for some background information"); } else if ( strcmp(format, "mtz-bij") == 0 ) { r = export_to_mtz(result, filename, cell, min_res, max_res, 1); + reminder(win->window, + "CrystFEL does not know the space " + "group of your structure.\n\n" + "The space group written into the MTZ header is just " + "a representation of the processing done within " + "CrystFEL.\n\n" + "You may need to change the space group in the MTZ " + "header, to allow structure solution programs to find " + "the correct space group.\n\n" + "" + "Click here for some background information"); } else if ( strcmp(format, "xds") == 0 ) { r = export_to_xds(result, filename, cell, min_res, max_res); + reminder(win->window, + "CrystFEL does not know the space " + "group of your structure.\n\n" + "The space group written into the XDS file " + "(header SPACE_GROUP_NUMBER=...) is just a " + "representation of the processing done within " + "CrystFEL.\n\n" + "You may need to change the space group in the XDS " + "header, to allow structure solution programs to find " + "the correct space group.\n\n" + "" + "Click here for some background information"); } else { ERROR("Unrecognised export format '%s'\n", format); return 1; -- cgit v1.2.3