projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in oneway /descriptives subcommand vs. weights.
[pspp]
/
src
/
ui
/
gui
/
t-test-independent-samples-dialog.c
diff --git
a/src/ui/gui/t-test-independent-samples-dialog.c
b/src/ui/gui/t-test-independent-samples-dialog.c
index 22b4526c4d7027a2dccb8a235992d33fa1378427..93102c058166f6785e685448ab790a6ae7c3b47f 100644
(file)
--- 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.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007 Free Software Foundation
+ Copyright (C) 2007
, 2009
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
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,8
+21,9
@@
#include "t-test-independent-samples-dialog.h"
#include "psppire-dict.h"
#include "psppire-var-store.h"
#include "t-test-independent-samples-dialog.h"
#include "psppire-dict.h"
#include "psppire-var-store.h"
-#include "helper.h"
-#include "data-editor.h"
+#include "psppire-var-view.h"
+#include "executor.h"
+#include "psppire-data-window.h"
#include "psppire-dialog.h"
#include "dialog-common.h"
#include "dict-display.h"
#include "psppire-dialog.h"
#include "dialog-common.h"
#include "dict-display.h"
@@
-31,7
+32,7
@@
#include <ui/syntax-gen.h>
#include <language/syntax-string-source.h>
#include <ui/syntax-gen.h>
#include <language/syntax-string-source.h>
-#include "
syntax-edito
r.h"
+#include "
helpe
r.h"
#include <gl/xalloc.h>
#include <gl/xalloc.h>
@@
-117,8
+118,8
@@
tt_groups_dialog_create (GtkBuilder *xml, GtkWindow *parent)
gtk_window_set_transient_for (GTK_WINDOW (grps->dialog), parent);
gtk_window_set_transient_for (GTK_WINDOW (grps->dialog), parent);
- grps->val[0] = strdup ("");
- grps->val[1] = strdup ("");
+ grps->val[0] =
x
strdup ("");
+ grps->val[1] =
x
strdup ("");
return grps;
}
return grps;
}
@@
-160,7
+161,7
@@
generate_syntax (const struct tt_indep_samples_dialog *d)
GString *str = g_string_new ("T-TEST /VARIABLES=");
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=");
g_string_append (str, "\n\t/GROUPS=");
@@
-340,10
+341,10
@@
run_define_groups (struct tt_indep_samples_dialog *ttd)
grps->group_defn = GROUPS_VALUES;
grps->val[0] =
grps->group_defn = GROUPS_VALUES;
grps->val[0] =
- strdup (gtk_entry_get_text (GTK_ENTRY (grps->grp_entry[0])));
+
x
strdup (gtk_entry_get_text (GTK_ENTRY (grps->grp_entry[0])));
grps->val[1] =
grps->val[1] =
- strdup (gtk_entry_get_text (GTK_ENTRY (grps->grp_entry[1])));
+
x
strdup (gtk_entry_get_text (GTK_ENTRY (grps->grp_entry[1])));
}
else
{
}
else
{
@@
-352,7
+353,7
@@
run_define_groups (struct tt_indep_samples_dialog *ttd)
grps->val[1] = NULL;
grps->val[0] =
grps->val[1] = NULL;
grps->val[0] =
- strdup (gtk_entry_get_text (GTK_ENTRY (grps->cut_point_entry)));
+
x
strdup (gtk_entry_get_text (GTK_ENTRY (grps->cut_point_entry)));
}
psppire_dialog_notify_change (PSPPIRE_DIALOG (ttd->dialog));
}
psppire_dialog_notify_change (PSPPIRE_DIALOG (ttd->dialog));
@@
-387,11
+388,10
@@
dialog_state_valid (gpointer data)
/* Pops up the dialog box */
void
/* 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;
{
struct tt_indep_samples_dialog tt_d;
gint response;
- struct data_editor *de = data;
PsppireVarStore *vs = NULL;
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 *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");
GtkWidget *selector2 =
get_widget_assert (xml, "indep-samples-t-test-selector2");
@@
-416,38
+413,24
@@
t_test_independent_samples_dialog (GObject *o, gpointer data)
tt_d.dialog = get_widget_assert (xml, "t-test-independent-samples-dialog");
tt_d.xml = xml;
tt_d.dialog = get_widget_assert (xml, "t-test-independent-samples-dialog");
tt_d.xml = xml;
-
tt_d.dict = vs->dict
;
+
g_object_get (vs, "dictionary", &tt_d.dict, NULL)
;
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.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);
-
-
- gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), 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));
- attach_dictionary_to_treeview (GTK_TREE_VIEW (dict_view),
- vs->dict,
- GTK_SELECTION_MULTIPLE, NULL);
-
set_dest_model (GTK_TREE_VIEW (test_variables_treeview), vs->dict
);
+
gtk_window_set_transient_for (GTK_WINDOW (tt_d.dialog), GTK_WINDOW (de)
);
-
- 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_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);
g_signal_connect_swapped (tt_d.define_groups_button, "clicked",
G_CALLBACK (run_define_groups), &tt_d);
@@
-474,6
+457,7
@@
t_test_independent_samples_dialog (GObject *o, gpointer data)
case GTK_RESPONSE_OK:
{
gchar *syntax = generate_syntax (&tt_d);
case GTK_RESPONSE_OK:
{
gchar *syntax = generate_syntax (&tt_d);
+
struct getl_interface *sss = create_syntax_string_source (syntax);
execute_syntax (sss);
struct getl_interface *sss = create_syntax_string_source (syntax);
execute_syntax (sss);
@@
-483,12
+467,7
@@
t_test_independent_samples_dialog (GObject *o, gpointer data)
case PSPPIRE_RESPONSE_PASTE:
{
gchar *syntax = generate_syntax (&tt_d);
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_to_window (syntax);
g_free (syntax);
}
break;
g_free (syntax);
}
break;