diff options
Diffstat (limited to 'src/crystfelmergeopts.c')
-rw-r--r-- | src/crystfelmergeopts.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/crystfelmergeopts.c b/src/crystfelmergeopts.c index aa357235..eb5f0665 100644 --- a/src/crystfelmergeopts.c +++ b/src/crystfelmergeopts.c @@ -44,6 +44,7 @@ #include "crystfelmergeopts.h" #include "crystfelsymmetryselector.h" +#include "gtk-util-routines.h" G_DEFINE_TYPE(CrystFELMergeOpts, @@ -431,40 +432,6 @@ void crystfel_merge_opts_set_push_res(CrystFELMergeOpts *mo, } -static float get_float(GtkWidget *entry) -{ - const gchar *text; - char *rval; - float val; - text = gtk_entry_get_text(GTK_ENTRY(entry)); - errno = 0; - val = strtof(text, &rval); - if ( *rval != '\0' ) return NAN; - return val; -} - - -static unsigned int get_uint(GtkWidget *entry) -{ - const gchar *text; - char *rval; - unsigned long int val; - text = gtk_entry_get_text(GTK_ENTRY(entry)); - errno = 0; - val = strtoul(text, &rval, 10); - if ( *rval != '\0' ) { - printf("Invalid integer '%s'\n", text); - return 0; - } - return val; -} - -static int get_bool(GtkWidget *widget) -{ - return gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); -} - - const char *crystfel_merge_opts_get_model(CrystFELMergeOpts *opts) { return gtk_combo_box_get_active_id(GTK_COMBO_BOX(opts->model_combo)); |