/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2005, 2006, 2010, 2011 Free Software Foundation
+ Copyright (C) 2005, 2006, 2010, 2011, 2012 Free Software Foundation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "data/settings.h"
#include "data/variable.h"
#include "libpspp/message.h"
-#include "ui/gui/helper.h"
+#include "ui/gui/builder-wrapper.h"
#include "ui/gui/var-type-dialog.h"
struct tgs
/* Create the structure */
struct var_type_dialog *
-var_type_dialog_create (GtkWindow *toplevel, PsppireVarStore *vs)
+var_type_dialog_create (GtkWindow *toplevel)
{
gint i;
struct var_type_dialog *dialog = g_malloc (sizeof (struct var_type_dialog));
GtkBuilder *xml = builder_new ("var-sheet-dialogs.ui");
- dialog->vs = vs;
-
dialog->window = get_widget_assert (xml,"var_type_dialog");
dialog->active_button = -1;
break;
case BUTTON_DATE:
case BUTTON_CUSTOM:
- g_assert (fmt_check_output (&dialog->fmt_l));
- result = memcpy (&spec, &dialog->fmt_l, sizeof (struct fmt_spec));
+ if (! fmt_check_output (&dialog->fmt_l))
+ g_critical ("Invalid variable format");
+ else
+ result = memcpy (&spec, &dialog->fmt_l, sizeof (struct fmt_spec));
break;
case BUTTON_DOLLAR:
result = make_output_format_try (&spec, FMT_DOLLAR, width, decimals);
break;
default:
- g_print ("Unknown variable type: %d\n", dialog->active_button) ;
+ g_critical ("Unknown variable type: %d", dialog->active_button) ;
result = false;
break;
}