X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Ft-test-independent-samples-dialog.c;h=392867adbb606acd5c62abad6ce6a58286807f13;hb=8af88c0b7ea2fe75df7e45497988ed0371006a86;hp=e9b6a169a4a7ffbf2da447d006d94ec5d6b307fd;hpb=1effaa062b65095fbaa5c83c691deb741a79f8ee;p=pspp-builds.git diff --git a/src/ui/gui/t-test-independent-samples-dialog.c b/src/ui/gui/t-test-independent-samples-dialog.c index e9b6a169..392867ad 100644 --- a/src/ui/gui/t-test-independent-samples-dialog.c +++ b/src/ui/gui/t-test-independent-samples-dialog.c @@ -17,23 +17,21 @@ #include -#include #include #include "t-test-independent-samples-dialog.h" #include "psppire-dict.h" #include "psppire-var-store.h" #include "helper.h" -#include -#include "data-editor.h" +#include "psppire-data-window.h" #include "psppire-dialog.h" #include "dialog-common.h" #include "dict-display.h" #include "widget-io.h" #include "t-test-options.h" -#include +#include #include -#include "syntax-editor.h" +#include "helper.h" #include @@ -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)); @@ -117,10 +115,7 @@ tt_groups_dialog_create (GladeXML *xml, GtkWindow *parent) g_signal_connect (grps->values_toggle_button, "toggled", G_CALLBACK (set_group_criterion_type), grps); - gtk_window_set_transient_for (parent, - GTK_WINDOW (grps->dialog)); - - + gtk_window_set_transient_for (GTK_WINDOW (grps->dialog), parent); grps->val[0] = strdup (""); grps->val[1] = strdup (""); @@ -131,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; @@ -165,7 +160,7 @@ generate_syntax (const struct tt_indep_samples_dialog *d) GString *str = g_string_new ("T-TEST /VARIABLES="); - append_variable_names (str, d->dict, GTK_TREE_VIEW (tv)); + append_variable_names (str, d->dict, GTK_TREE_VIEW (tv), 0); g_string_append (str, "\n\t/GROUPS="); @@ -181,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); } @@ -198,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); } @@ -398,14 +391,11 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) { struct tt_indep_samples_dialog tt_d; gint response; - struct data_editor *de = data; + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (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"); @@ -420,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; @@ -430,11 +420,11 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) tt_d.define_groups_button = get_widget_assert (xml, "define-groups-button"); tt_d.groups_entry = get_widget_assert (xml, "indep-samples-t-test-entry"); - tt_d.opts = tt_options_dialog_create (xml, de->parent.window); - tt_d.grps = tt_groups_dialog_create (xml, de->parent.window); + tt_d.opts = tt_options_dialog_create (xml, GTK_WINDOW (de)); + tt_d.grps = tt_groups_dialog_create (xml, GTK_WINDOW (de)); - gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), de->parent.window); + gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), GTK_WINDOW (de)); attach_dictionary_to_treeview (GTK_TREE_VIEW (dict_view), vs->dict, @@ -446,6 +436,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1), dict_view, test_variables_treeview, insert_source_row_into_tree_view, + NULL, NULL); psppire_selector_set_allow (PSPPIRE_SELECTOR (selector1), @@ -455,7 +446,8 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2), dict_view, tt_d.groups_entry, insert_source_row_into_entry, - is_currently_in_entry); + is_currently_in_entry, + NULL); g_signal_connect_swapped (tt_d.define_groups_button, "clicked", G_CALLBACK (run_define_groups), &tt_d); @@ -482,6 +474,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) case GTK_RESPONSE_OK: { gchar *syntax = generate_syntax (&tt_d); + struct getl_interface *sss = create_syntax_string_source (syntax); execute_syntax (sss); @@ -491,12 +484,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) case PSPPIRE_RESPONSE_PASTE: { gchar *syntax = generate_syntax (&tt_d); - - struct syntax_editor *se = - (struct syntax_editor *) window_create (WINDOW_SYNTAX, NULL); - - gtk_text_buffer_insert_at_cursor (se->buffer, syntax, -1); - + paste_syntax_in_new_window (syntax); g_free (syntax); } break;