From 2b34727c23cb4c291f2fc8b52a29619957f2e06a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 7 Dec 2015 22:08:14 +0100 Subject: [PATCH] Paired Samples Dialog: Fix broken logic --- src/ui/gui/paired-samples.ui | 108 ++++++++---------- src/ui/gui/psppire-dialog-action-paired.c | 43 ++++--- src/ui/gui/psppire-dialog-action-two-sample.c | 2 +- 3 files changed, 76 insertions(+), 77 deletions(-) diff --git a/src/ui/gui/paired-samples.ui b/src/ui/gui/paired-samples.ui index 107f5fb38a..ee9520b6af 100644 --- a/src/ui/gui/paired-samples.ui +++ b/src/ui/gui/paired-samples.ui @@ -22,55 +22,6 @@ 5 5 5 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - 0 - none - - - True - 12 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - etched-in - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - False - False - 2 - - - - - - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - _Test Pair(s): - True - True - paired-samples-t-test-treeview2 - - - - - 2 - 0 - - True @@ -132,30 +83,71 @@ - + True False True + True vertical - start - - O_ptions... + True - True - True - True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + True + 0 + none + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + 12 + etched-in + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + False + False + 2 + + + + + + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + _Test Pair(s): + True + True + paired-samples-t-test-treeview2 + + - True + False True 0 + + + 2 - 1 + 0 + 2 diff --git a/src/ui/gui/psppire-dialog-action-paired.c b/src/ui/gui/psppire-dialog-action-paired.c index 558e86f52c..fdd9a2b34d 100644 --- a/src/ui/gui/psppire-dialog-action-paired.c +++ b/src/ui/gui/psppire-dialog-action-paired.c @@ -161,34 +161,41 @@ psppire_dialog_action_paired_activate (GtkAction *a) { xml = builder_new ("paired-samples.ui"); g_hash_table_insert (thing, a, xml); - } + + GtkWidget *selector = get_widget_assert (xml, "psppire-selector3"); + GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL); + GtkWidget *button = gtk_button_new_with_mnemonic (_("O_ptions...")); + GtkWidget *box = get_widget_assert (xml, "dynamic-populate"); - GtkWidget *selector = get_widget_assert (xml, "psppire-selector3"); - GtkWidget *button = get_widget_assert (xml, "option-button"); + pda->dialog = get_widget_assert (xml, "t-test-paired-samples-dialog"); + pda->source = get_widget_assert (xml, "paired-samples-t-test-treeview1"); - pda->dialog = get_widget_assert (xml, "t-test-paired-samples-dialog"); - pda->source = get_widget_assert (xml, "paired-samples-t-test-treeview1"); + gtk_window_set_title (GTK_WINDOW (pda->dialog), _("Paired Samples T Test")); - gtk_window_set_title (GTK_WINDOW (pda->dialog), _("Paired Samples T Test")); + act->pairs_treeview = get_widget_assert (xml, "paired-samples-t-test-treeview2"); + act->list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (act->pairs_treeview))); - act->pairs_treeview = get_widget_assert (xml, "paired-samples-t-test-treeview2"); - act->list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (act->pairs_treeview))); + act->opt = tt_options_dialog_create (GTK_WINDOW (pda->toplevel)); - act->opt = tt_options_dialog_create (GTK_WINDOW (pda->toplevel)); + g_signal_connect_swapped (button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opt); - g_signal_connect_swapped (button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opt); + gtk_box_pack_start (GTK_BOX (bb), button, TRUE, TRUE, 5); + gtk_box_pack_start (GTK_BOX (box), bb, FALSE, FALSE, 5); + gtk_widget_show_all (box); - psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - psppire_dialog_action_set_refresh (pda, refresh); - g_object_set (pda->source, - "predicate", var_is_numeric, - NULL); + psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); + psppire_dialog_action_set_refresh (pda, refresh); + + g_object_set (pda->source, + "predicate", var_is_numeric, + NULL); - psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector), - select_as_pair_member, - act); + psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector), + select_as_pair_member, + act); + } if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_paired_parent_class)->activate) PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_paired_parent_class)->activate (pda); diff --git a/src/ui/gui/psppire-dialog-action-two-sample.c b/src/ui/gui/psppire-dialog-action-two-sample.c index c570993b84..ce08e05271 100644 --- a/src/ui/gui/psppire-dialog-action-two-sample.c +++ b/src/ui/gui/psppire-dialog-action-two-sample.c @@ -185,7 +185,7 @@ psppire_dialog_action_two_sample_activate (GtkAction *a) /* NPAR Specific options */ GtkWidget *frame = gtk_frame_new (_("Test Type")); GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); - GtkWidget *box = get_widget_assert (xml, "vbox3"); + GtkWidget *box = get_widget_assert (xml, "dynamic-populate"); strcpy (act->nts[NT_WILCOXON].syntax, "/WILCOXON"); -- 2.30.2