From 3c3d40ddf4819a9bf2c24d0c10c6bdc4ec525b96 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Fri, 1 Jul 2011 18:39:40 +0200 Subject: [PATCH] Move the glade definition for the paired samples dialog box to its own file --- src/ui/gui/automake.mk | 1 + src/ui/gui/paired-samples.ui | 168 ++++++++++++++++++ .../gui/t-test-independent-samples-dialog.c | 2 +- src/ui/gui/t-test-one-sample.c | 2 +- src/ui/gui/t-test-options.c | 14 +- src/ui/gui/t-test-options.h | 2 +- src/ui/gui/t-test-paired-samples.c | 4 +- src/ui/gui/t-test.ui | 163 ----------------- 8 files changed, 183 insertions(+), 173 deletions(-) create mode 100644 src/ui/gui/paired-samples.ui diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 56d07447..b5a588e5 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -19,6 +19,7 @@ UI_FILES = \ src/ui/gui/frequencies.ui \ src/ui/gui/k-related.ui \ src/ui/gui/oneway.ui \ + src/ui/gui/paired-samples.ui \ src/ui/gui/psppire.ui \ src/ui/gui/rank.ui \ src/ui/gui/sort.ui \ diff --git a/src/ui/gui/paired-samples.ui b/src/ui/gui/paired-samples.ui new file mode 100644 index 00000000..1e6f8b55 --- /dev/null +++ b/src/ui/gui/paired-samples.ui @@ -0,0 +1,168 @@ + + + + + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Paired Samples T Test + True + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + never + automatic + etched-in + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + + + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.059999998658895493 + 0 + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + 5 + paired-samples-t-test-treeview1 + paired-samples-t-test-treeview2 + + + + + False + False + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + none + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + automatic + etched-in + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + 2 + + + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Test Variable(s): + True + + + + + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical + + + Options... + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + False + False + 0 + + + + + False + False + 1 + + + + + 2 + + + + + 0 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + vertical + + + False + False + end + 1 + + + + + + diff --git a/src/ui/gui/t-test-independent-samples-dialog.c b/src/ui/gui/t-test-independent-samples-dialog.c index 8983bc67..d4adf587 100644 --- a/src/ui/gui/t-test-independent-samples-dialog.c +++ b/src/ui/gui/t-test-independent-samples-dialog.c @@ -416,7 +416,7 @@ t_test_independent_samples_dialog (PsppireDataWindow *de) 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)); diff --git a/src/ui/gui/t-test-one-sample.c b/src/ui/gui/t-test-one-sample.c index befe8682..477d1de5 100644 --- a/src/ui/gui/t-test-one-sample.c +++ b/src/ui/gui/t-test-one-sample.c @@ -141,7 +141,7 @@ t_test_one_sample_dialog (PsppireDataWindow *de) g_object_get (vs, "dictionary", &tt_d.dict, NULL); tt_d.vars_treeview = get_widget_assert (xml, "one-sample-t-test-treeview1"); tt_d.test_value_entry = get_widget_assert (xml, "test-value-entry"); - tt_d.opt = tt_options_dialog_create (xml, GTK_WINDOW (de)); + tt_d.opt = tt_options_dialog_create (GTK_WINDOW (de)); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); diff --git a/src/ui/gui/t-test-options.c b/src/ui/gui/t-test-options.c index 224b022c..e57b29f5 100644 --- a/src/ui/gui/t-test-options.c +++ b/src/ui/gui/t-test-options.c @@ -49,23 +49,26 @@ struct tt_options_dialog gdouble confidence_interval; gboolean non_default_options; enum exclude_mode excl; + GtkBuilder *xml; }; struct tt_options_dialog * -tt_options_dialog_create (GtkBuilder *xml, GtkWindow *parent) +tt_options_dialog_create (GtkWindow *parent) { struct tt_options_dialog *tto = xmalloc (sizeof (*tto)); + tto->xml = builder_new ("t-test.ui"); + tto->confidence = widget_scanf (_("Confidence Interval: %2d %%"), &tto->conf_percent); - tto->dialog = get_widget_assert (xml, "options-dialog"); + tto->dialog = get_widget_assert (tto->xml, "options-dialog"); - tto->box = get_widget_assert (xml, "vbox1"); + tto->box = get_widget_assert (tto->xml, "vbox1"); - tto->analysis = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton1")); - tto->listwise = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "radiobutton2")); + tto->analysis = GTK_TOGGLE_BUTTON (get_widget_assert (tto->xml, "radiobutton1")); + tto->listwise = GTK_TOGGLE_BUTTON (get_widget_assert (tto->xml, "radiobutton2")); gtk_widget_show (tto->confidence); @@ -84,6 +87,7 @@ void tt_options_dialog_destroy (struct tt_options_dialog *tto) { gtk_container_remove (GTK_CONTAINER (tto->box), tto->confidence); + g_object_unref (tto->xml); g_free (tto); } diff --git a/src/ui/gui/t-test-options.h b/src/ui/gui/t-test-options.h index e80ef444..add815bf 100644 --- a/src/ui/gui/t-test-options.h +++ b/src/ui/gui/t-test-options.h @@ -24,7 +24,7 @@ struct tt_options_dialog; void tt_options_dialog_run (struct tt_options_dialog *); -struct tt_options_dialog * tt_options_dialog_create (GtkBuilder *, GtkWindow *); +struct tt_options_dialog * tt_options_dialog_create (GtkWindow *); void tt_options_dialog_destroy (struct tt_options_dialog *); diff --git a/src/ui/gui/t-test-paired-samples.c b/src/ui/gui/t-test-paired-samples.c index 6233aa30..7e50c8b1 100644 --- a/src/ui/gui/t-test-paired-samples.c +++ b/src/ui/gui/t-test-paired-samples.c @@ -162,7 +162,7 @@ t_test_paired_samples_dialog (PsppireDataWindow *de) PsppireVarStore *vs = NULL; - GtkBuilder *xml = builder_new ("t-test.ui"); + GtkBuilder *xml = builder_new ("paired-samples.ui"); GtkWidget *dict_view = get_widget_assert (xml, "paired-samples-t-test-treeview1"); @@ -178,7 +178,7 @@ t_test_paired_samples_dialog (PsppireDataWindow *de) g_object_get (vs, "dictionary", &tt_d.dict, NULL); tt_d.pairs_treeview = get_widget_assert (xml, "paired-samples-t-test-treeview2"); - tt_d.opt = tt_options_dialog_create (xml, GTK_WINDOW (de)); + tt_d.opt = tt_options_dialog_create (GTK_WINDOW (de)); gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); diff --git a/src/ui/gui/t-test.ui b/src/ui/gui/t-test.ui index 1a763ae3..d2002d0a 100644 --- a/src/ui/gui/t-test.ui +++ b/src/ui/gui/t-test.ui @@ -699,167 +699,4 @@ - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Paired Samples T Test - True - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - never - automatic - etched-in - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - - - 0 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0.059999998658895493 - 0 - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - 5 - paired-samples-t-test-treeview1 - paired-samples-t-test-treeview2 - - - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - vertical - 5 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - none - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 12 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - always - automatic - etched-in - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - 2 - - - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Test Variable(s): - True - - - - - 0 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - vertical - - - Options... - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - 0 - - - - - False - False - 1 - - - - - 2 - - - - - 0 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - vertical - - - False - False - end - 1 - - - - - -- 2.30.2