New file: builder-wrapper.h and builder-wrapper.c
[pspp-builds.git] / src / ui / gui / var-type-dialog.c
index fb1977a5ab211a1f3c33bf2241bc02642cea14fd..fb9fc6d9f143a561be032e00fbc254cc8d88202c 100644 (file)
@@ -1,5 +1,5 @@
 /* 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 <config.h>
 
 #include <gtk/gtk.h>
-
 #include <stdlib.h>
 #include <string.h>
 
-#include "var-type-dialog.h"
-
-#include "helper.h"
-
-#include <data/variable.h>
-#include <data/settings.h>
-#include <libpspp/message.h>
-
+#include "data/data-out.h"
+#include "data/settings.h"
+#include "data/variable.h"
+#include "libpspp/message.h"
+#include "ui/gui/builder-wrapper.h"
+#include "ui/gui/var-type-dialog.h"
 
 struct tgs
 {
@@ -262,12 +259,12 @@ preview_custom (GtkWidget *w, gpointer data)
       union value v;
       v.f = 1234.56;
 
-      sample_text = value_to_text (v, dialog->vs->dictionary, dialog->fmt_l);
+      sample_text = g_strchug (data_out (&v, NULL, &dialog->fmt_l));
       gtk_label_set_text (GTK_LABEL (dialog->label_psample), sample_text);
       g_free (sample_text);
 
       v.f = -v.f;
-      sample_text = value_to_text (v, dialog->vs->dictionary, dialog->fmt_l);
+      sample_text = g_strchug (data_out (&v, NULL, &dialog->fmt_l));
       gtk_label_set_text (GTK_LABEL (dialog->label_nsample), sample_text);
       g_free (sample_text);
     }
@@ -320,15 +317,13 @@ set_format_type_from_treeview (GtkTreeView *treeview, gpointer data)
 
 /* 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;