X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-paired.c;h=e0102b1405f7ca5ebbadc06a137fcc81c4f9d57f;hb=37d4cd28edb71f5559642108ed035c478525bec1;hp=558e86f52c70688cff95474142228f669f2eafd2;hpb=49a2f5d06529dec8d56be3d6994cce88f742e4f0;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-paired.c b/src/ui/gui/psppire-dialog-action-paired.c index 558e86f52c..e0102b1405 100644 --- a/src/ui/gui/psppire-dialog-action-paired.c +++ b/src/ui/gui/psppire-dialog-action-paired.c @@ -58,7 +58,7 @@ dialog_state_valid (gpointer data) if (v == NULL) return FALSE; - + /* if ( NULL == pd->valid) */ /* return TRUE; */ @@ -124,7 +124,7 @@ select_as_pair_member (GtkTreeIter source_iter, static gchar * -generate_syntax (PsppireDialogAction *pda) +generate_syntax (const PsppireDialogAction *pda) { PsppireDialogActionPaired *d = PSPPIRE_DIALOG_ACTION_PAIRED (pda); gchar *text = NULL; @@ -150,48 +150,53 @@ generate_syntax (PsppireDialogAction *pda) } static void -psppire_dialog_action_paired_activate (GtkAction *a) +psppire_dialog_action_paired_activate (PsppireDialogAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionPaired *act = PSPPIRE_DIALOG_ACTION_PAIRED (a); - GHashTable *thing = psppire_dialog_action_get_pointer (pda); + GHashTable *thing = psppire_dialog_action_get_hash_table (pda); GtkBuilder *xml = g_hash_table_lookup (thing, a); if (!xml) { xml = builder_new ("paired-samples.ui"); g_hash_table_insert (thing, a, xml); - } - GtkWidget *selector = get_widget_assert (xml, "psppire-selector3"); - GtkWidget *button = get_widget_assert (xml, "option-button"); + 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"); + + 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")); - pda->dialog = get_widget_assert (xml, "t-test-paired-samples-dialog"); - pda->source = get_widget_assert (xml, "paired-samples-t-test-treeview1"); + 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))); - gtk_window_set_title (GTK_WINDOW (pda->dialog), _("Paired Samples T Test")); + act->opt = tt_options_dialog_create (GTK_WINDOW (pda->toplevel)); - 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))); + g_signal_connect_swapped (button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opt); - act->opt = tt_options_dialog_create (GTK_WINDOW (pda->toplevel)); - 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); } static void