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=f83f9e0d68cf75453d3c0ec277aca2a611012193;hb=17308c1e0578259823fdd996633fa70e1c2747f3;hp=5d77ce43031ea7e46b37c3f0de57e9f9a22e67eb;hpb=bd17d2af982332ee1791998361b1ac6731fe14fa;p=pspp diff --git a/src/ui/gui/t-test-independent-samples-dialog.c b/src/ui/gui/t-test-independent-samples-dialog.c index 5d77ce4303..f83f9e0d68 100644 --- a/src/ui/gui/t-test-independent-samples-dialog.c +++ b/src/ui/gui/t-test-independent-samples-dialog.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007, 2009 Free Software Foundation + Copyright (C) 2007, 2009, 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 @@ -21,6 +21,7 @@ #include "t-test-independent-samples-dialog.h" #include "psppire-dict.h" #include "psppire-var-store.h" +#include "psppire-var-view.h" #include "executor.h" #include "psppire-data-window.h" #include "psppire-dialog.h" @@ -30,7 +31,7 @@ #include "t-test-options.h" #include -#include +#include "builder-wrapper.h" #include "helper.h" #include @@ -160,7 +161,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), 0); + psppire_var_view_append_names (PSPPIRE_VAR_VIEW (tv), 0, str); g_string_append (str, "\n\t/GROUPS="); @@ -387,11 +388,10 @@ dialog_state_valid (gpointer data) /* Pops up the dialog box */ void -t_test_independent_samples_dialog (GObject *o, gpointer data) +t_test_independent_samples_dialog (PsppireDataWindow *de) { struct tt_indep_samples_dialog tt_d; gint response; - PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); PsppireVarStore *vs = NULL; @@ -400,9 +400,6 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) GtkWidget *dict_view = get_widget_assert (xml, "indep-samples-t-test-treeview1"); - GtkWidget *test_variables_treeview = - get_widget_assert (xml, "indep-samples-t-test-treeview2"); - GtkWidget *selector2 = get_widget_assert (xml, "indep-samples-t-test-selector2"); @@ -420,32 +417,20 @@ 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, GTK_WINDOW (de)); + tt_d.opts = tt_options_dialog_create (GTK_WINDOW (de)); tt_d.grps = tt_groups_dialog_create (xml, GTK_WINDOW (de)); gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), GTK_WINDOW (de)); - g_object_set (dict_view, "dictionary", tt_d.dict, NULL); - - set_dest_model (GTK_TREE_VIEW (test_variables_treeview), tt_d.dict); - - - psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1), - dict_view, test_variables_treeview, - insert_source_row_into_tree_view, - NULL, - NULL); + g_object_set (dict_view, "model", tt_d.dict, NULL); psppire_selector_set_allow (PSPPIRE_SELECTOR (selector1), numeric_only); - psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2), - dict_view, tt_d.groups_entry, - insert_source_row_into_entry, - is_currently_in_entry, - NULL); + psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector2), + is_currently_in_entry); g_signal_connect_swapped (tt_d.define_groups_button, "clicked", G_CALLBACK (run_define_groups), &tt_d); @@ -470,21 +455,10 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) switch (response) { case GTK_RESPONSE_OK: - { - gchar *syntax = generate_syntax (&tt_d); - - struct getl_interface *sss = create_syntax_string_source (syntax); - execute_syntax (sss); - - g_free (syntax); - } + g_free (execute_syntax_string (de, generate_syntax (&tt_d))); break; case PSPPIRE_RESPONSE_PASTE: - { - gchar *syntax = generate_syntax (&tt_d); - paste_syntax_in_new_window (syntax); - g_free (syntax); - } + g_free (paste_syntax_to_window (generate_syntax (&tt_d))); break; default: break;