Converted T-Test dialogs to GtkBuilder
[pspp-builds.git] / src / ui / gui / t-test-independent-samples-dialog.c
index 74b43cc1dba7d84987ea33021a56063d343d8274..22b4526c4d7027a2dccb8a235992d33fa1378427 100644 (file)
 
 
 #include <config.h>
-#include <glade/glade.h>
 #include <gtk/gtk.h>
 #include "t-test-independent-samples-dialog.h"
 #include "psppire-dict.h"
 #include "psppire-var-store.h"
 #include "helper.h"
-#include <gtksheet/gtksheet.h>
 #include "data-editor.h"
 #include "psppire-dialog.h"
 #include "dialog-common.h"
 #include "dict-display.h"
 #include "widget-io.h"
 #include "t-test-options.h"
-#include <libpspp/syntax-gen.h>
+#include <ui/syntax-gen.h>
 
 #include <language/syntax-string-source.h>
 #include "syntax-editor.h"
@@ -92,7 +90,7 @@ tt_groups_dialog_destroy (struct tt_groups_dialog *grps)
 }
 
 static struct tt_groups_dialog *
-tt_groups_dialog_create (GladeXML *xml, GtkWindow *parent)
+tt_groups_dialog_create (GtkBuilder *xml, GtkWindow *parent)
 {
   struct tt_groups_dialog *grps = xmalloc (sizeof (*grps));
 
@@ -128,7 +126,7 @@ tt_groups_dialog_create (GladeXML *xml, GtkWindow *parent)
 
 struct tt_indep_samples_dialog
 {
-  GladeXML *xml;  /* The xml that generated the widgets */
+  GtkBuilder *xml;  /* The xml that generated the widgets */
   GtkWidget *dialog;
   PsppireDict *dict;
   GtkWidget *define_groups_button;
@@ -178,9 +176,8 @@ generate_syntax (const struct tt_indep_samples_dialog *d)
 
       if ( var_is_alpha (group_variable))
        {
-         struct string s;
-         ds_init_cstr (&s, d->grps->val[0]);
-         gen_quoted_string (&s);
+         struct string s = DS_EMPTY_INITIALIZER;
+         syntax_gen_string (&s, ss_cstr (d->grps->val[0]));
          g_string_append (str, ds_cstr (&s));
          ds_destroy (&s);
        }
@@ -195,9 +192,8 @@ generate_syntax (const struct tt_indep_samples_dialog *d)
 
          if ( var_is_alpha (group_variable))
            {
-             struct string s;
-             ds_init_cstr (&s, d->grps->val[1]);
-             gen_quoted_string (&s);
+             struct string s = DS_EMPTY_INITIALIZER;
+             syntax_gen_string (&s, ss_cstr (d->grps->val[1]));
              g_string_append (str, ds_cstr (&s));
              ds_destroy (&s);
            }
@@ -397,12 +393,9 @@ t_test_independent_samples_dialog (GObject *o, gpointer data)
   gint response;
   struct data_editor *de = data;
 
-  PsppireVarStore *vs;
+  PsppireVarStore *vs = NULL;
 
-  GladeXML *xml = XML_NEW ("t-test.glade");
-
-  GtkSheet *var_sheet =
-    GTK_SHEET (get_widget_assert (de->xml, "variable_sheet"));
+  GtkBuilder *xml = builder_new ("t-test.ui");
 
   GtkWidget *dict_view =
     get_widget_assert (xml, "indep-samples-t-test-treeview1");
@@ -417,9 +410,9 @@ t_test_independent_samples_dialog (GObject *o, gpointer data)
     get_widget_assert (xml, "indep-samples-t-test-selector1");
 
   GtkWidget *options_button =
-    get_widget_assert (xml, "options-button");
+    get_widget_assert (xml, "indep-samples-t-test-options-button");
 
-  vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet));
+  g_object_get (de->data_editor, "var-store", &vs, NULL);
 
   tt_d.dialog = get_widget_assert (xml, "t-test-independent-samples-dialog");
   tt_d.xml = xml;