From a7fb79e81f6e2a0dfddc61e91f207609e31a4632 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Wed, 7 Feb 2007 02:12:57 +0000 Subject: [PATCH] Addressed some of the issues raised by John McCabe-Dansted when building native w32 target. --- src/ui/gui/data-editor.c | 2 ++ src/ui/gui/data-editor.glade | 17 ----------------- src/ui/gui/data-sheet.c | 2 +- src/ui/gui/missing-val-dialog.c | 16 ++++++++++++++++ src/ui/gui/syntax-editor.glade | 2 -- src/ui/gui/var-sheet.c | 2 +- tests/command/npar-binomial.sh | 19 +------------------ tests/command/npar-chisquare.sh | 17 ++++------------- tests/command/very-long-strings.sh | 7 ++----- 9 files changed, 27 insertions(+), 57 deletions(-) diff --git a/src/ui/gui/data-editor.c b/src/ui/gui/data-editor.c index 4d7d6b5c..fd5e491f 100644 --- a/src/ui/gui/data-editor.c +++ b/src/ui/gui/data-editor.c @@ -135,6 +135,8 @@ new_data_editor (void) vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_assert(vs); /* Traps a possible bug in win32 build */ + g_signal_connect (vs->dict, "weight-changed", G_CALLBACK (on_weight_change), de); diff --git a/src/ui/gui/data-editor.glade b/src/ui/gui/data-editor.glade index 6ce94bb2..ffca7012 100644 --- a/src/ui/gui/data-editor.glade +++ b/src/ui/gui/data-editor.glade @@ -98,7 +98,6 @@ gtk-quit True True - @@ -256,7 +255,6 @@ False Insert Variable True - @@ -265,7 +263,6 @@ False Insert Cases True - @@ -274,7 +271,6 @@ False Go To Case True - @@ -289,7 +285,6 @@ False Sort Cases True - @@ -362,7 +357,6 @@ True _Windows True - @@ -370,7 +364,6 @@ True _Minimise All Windows True - @@ -396,7 +389,6 @@ True _About True - @@ -431,7 +423,6 @@ True Save gtk-save - False @@ -494,7 +485,6 @@ False Go To Case gtk-jump-to - False @@ -548,7 +538,6 @@ Insert Case True pspp-insert-case - False @@ -625,7 +614,6 @@ Value Labels True pspp-value-labels - False @@ -1307,7 +1295,6 @@ True gtk-cancel True - 1 @@ -1537,7 +1524,6 @@ True gtk-ok True - @@ -1547,7 +1533,6 @@ True gtk-cancel True - 1 @@ -1844,7 +1829,6 @@ True gtk-ok True - @@ -1854,7 +1838,6 @@ True gtk-cancel True - 1 diff --git a/src/ui/gui/data-sheet.c b/src/ui/gui/data-sheet.c index 0fdba116..18b4e359 100644 --- a/src/ui/gui/data-sheet.c +++ b/src/ui/gui/data-sheet.c @@ -158,7 +158,7 @@ font_change_callback (GObject *obj, gpointer data) -GtkWidget* +G_MODULE_EXPORT GtkWidget* psppire_data_sheet_create (gchar *widget_name, gchar *string1, gchar *string2, gint int1, gint int2) { diff --git a/src/ui/gui/missing-val-dialog.c b/src/ui/gui/missing-val-dialog.c index 58ff43da..63403d92 100644 --- a/src/ui/gui/missing-val-dialog.c +++ b/src/ui/gui/missing-val-dialog.c @@ -207,6 +207,20 @@ range (GtkToggleButton *button, gpointer data) } + +/* Callback for when the Missing Value dialog is closed using + the window delete button.*/ +static gint +on_delete (GtkWidget *w, GdkEvent *e, gpointer data) +{ + struct missing_val_dialog *dialog = data; + + gtk_widget_hide (dialog->window); + + return TRUE; +} + + /* Creates the dialog structure from the xml */ struct missing_val_dialog * missing_val_dialog_create (GladeXML *xml) @@ -228,6 +242,8 @@ missing_val_dialog_create (GladeXML *xml) g_signal_connect (get_widget_assert (xml, "missing_val_ok"), "clicked", G_CALLBACK (missing_val_dialog_accept), dialog); + g_signal_connect (GTK_OBJECT (dialog->window), "delete-event", + G_CALLBACK (on_delete), dialog); dialog->mv[0] = get_widget_assert (xml, "mv0"); dialog->mv[1] = get_widget_assert (xml, "mv1"); diff --git a/src/ui/gui/syntax-editor.glade b/src/ui/gui/syntax-editor.glade index c27eef44..64cdeabe 100644 --- a/src/ui/gui/syntax-editor.glade +++ b/src/ui/gui/syntax-editor.glade @@ -86,7 +86,6 @@ True _Syntax True - @@ -233,7 +232,6 @@ True _Windows True - diff --git a/src/ui/gui/var-sheet.c b/src/ui/gui/var-sheet.c index 4ca2cf29..3c26fcd1 100644 --- a/src/ui/gui/var-sheet.c +++ b/src/ui/gui/var-sheet.c @@ -410,7 +410,7 @@ extern PsppireVarStore *the_var_store; /* Create the var sheet */ -GtkWidget* +G_MODULE_EXPORT GtkWidget* psppire_variable_sheet_create (gchar *widget_name, gchar *string1, gchar *string2, diff --git a/tests/command/npar-binomial.sh b/tests/command/npar-binomial.sh index 5fd38156..db7b9763 100755 --- a/tests/command/npar-binomial.sh +++ b/tests/command/npar-binomial.sh @@ -216,9 +216,9 @@ $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi activity="compare output 1" +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list diff $TEMPDIR/pspp.list - << EOF P < 0.5; N1/N2 < 1 - 1.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)| @@ -227,9 +227,7 @@ P < 0.5; N1/N2 < 1 | |Group2# 2.00|15| .714| | | | |Total # |21| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P < 0.5; N1/N2 > 1 - 2.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)| @@ -238,9 +236,7 @@ P < 0.5; N1/N2 > 1 | |Group2# 2.00| 6| .462| | | | |Total # |13| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P < 0.5; N1/N2 = 1 - 3.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)| @@ -249,9 +245,7 @@ P < 0.5; N1/N2 = 1 | |Group2# 2.00| 8| .500| | | | |Total # |16| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P > 0.5; N1/N2 < 1 - 4.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)| @@ -260,9 +254,7 @@ P > 0.5; N1/N2 < 1 | |Group2# 2.00|12| .522| | | | |Total # |23| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P > 0.5; N1/N2 > 1 - 5.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)| @@ -271,9 +263,7 @@ P > 0.5; N1/N2 > 1 | |Group2# 2.00| 9| .450| | | | |Total # |20| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P > 0.5; N1/N2 == 1 - 6.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (1-tailed)| @@ -282,9 +272,7 @@ P > 0.5; N1/N2 == 1 | |Group2# 2.00|11| .500| | | | |Total # |22| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P == 0.5; N1/N2 < 1 - 7.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (2-tailed)| @@ -293,9 +281,7 @@ P == 0.5; N1/N2 < 1 | |Group2# 2.00|15| .652| | | | |Total # |23| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P == 0.5; N1/N2 > 1 - 8.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (2-tailed)| @@ -304,9 +290,7 @@ P == 0.5; N1/N2 > 1 | |Group2# 2.00| 6| .333| | | | |Total # |18| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - P == 0.5; N1/N2 == 1 - 9.1 NPAR TESTS. Binomial Test +-+------#--------+--+--------------+----------+---------------------+ | | #Category| N|Observed Prop.|Test Prop.|Exact Sig. (2-tailed)| @@ -315,7 +299,6 @@ P == 0.5; N1/N2 == 1 | |Group2# 2.00|10| .500| | | | |Total # |20| 1.00| | | +-+------#--------+--+--------------+----------+---------------------+ - EOF if [ $? -ne 0 ] ; then fail ; fi diff --git a/tests/command/npar-chisquare.sh b/tests/command/npar-chisquare.sh index 5e2e45cf..60503a9c 100755 --- a/tests/command/npar-chisquare.sh +++ b/tests/command/npar-chisquare.sh @@ -95,6 +95,7 @@ $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE if [ $? -ne 0 ] ; then no_result ; fi activity="compare output 1" +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list diff $TEMPDIR/pspp.list - << EOF 1.1 NPAR TESTS. x +--------#----------+----------+--------+ @@ -108,7 +109,6 @@ diff $TEMPDIR/pspp.list - << EOF | 5.00# 1| 2.33| -1.33| |Total # 14| | | +--------#----------+----------+--------+ - 1.2 NPAR TESTS. y +--------#----------+----------+--------+ | #Observed N|Expected N|Residual| @@ -119,7 +119,6 @@ diff $TEMPDIR/pspp.list - << EOF | 4.00# 2| 3.50| -1.50| |Total # 14| | | +--------#----------+----------+--------+ - 1.3 NPAR TESTS. Test Statistics +-----------#-----+-----+ | # x | y | @@ -128,7 +127,6 @@ diff $TEMPDIR/pspp.list - << EOF |df # 5| 3| |Asymp. Sig.# .678| .112| +-----------#-----+-----+ - 2.1 NPAR TESTS. y +--------#----------+----------+--------+ | #Observed N|Expected N|Residual| @@ -139,7 +137,6 @@ diff $TEMPDIR/pspp.list - << EOF | 4.00# 2| 3.50| -1.50| |Total # 14| | | +--------#----------+----------+--------+ - 2.2 NPAR TESTS. Test Statistics +-----------#------+ | # y | @@ -148,7 +145,6 @@ diff $TEMPDIR/pspp.list - << EOF |df # 3| |Asymp. Sig.# .014| +-----------#------+ - 3.1 NPAR TESTS. Frequencies +-----#---------------------------------------#---------------------------------------+ | # x # y | @@ -160,7 +156,6 @@ diff $TEMPDIR/pspp.list - << EOF |3 # 4.00| 2| 1.58| .42# 4.00| 2| 1.11| .89| |Total# | 10| | # | 7| | | +-----#--------+----------+----------+--------#--------+----------+----------+--------+ - 3.2 NPAR TESTS. Test Statistics +-----------#----+-----+ | # x | y | @@ -169,7 +164,6 @@ diff $TEMPDIR/pspp.list - << EOF |df # 2| 2| |Asymp. Sig.#.936| .127| +-----------#----+-----+ - EOF if [ $? -ne 0 ] ; then fail ; fi @@ -202,6 +196,7 @@ $SUPERVISOR $PSPP --testing-mode -o raw-ascii $TESTFILE > $TEMPDIR/output if [ $? -eq 0 ] ; then no_result ; fi activity="compare errors 2" +perl -pi -e 's/^\s*$//g' $TEMPDIR/output diff $TEMPDIR/output - << EOF error: CHISQUARE test specified 6 expected values, but 4 distinct values were encountered in variable y. EOF @@ -241,6 +236,7 @@ if [ $? -ne 0 ] ; then no_result ; fi activity="compare output 3" +perl -pi -e 's/^\s*$//g' $TEMPDIR/pspp.list diff $TEMPDIR/pspp.list - <