X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-tt1s.c;h=5dd36a65dc106b8607010f0350b4fcb2b3ca48f1;hb=b525a9596e60d5ae4c6c464b4a426b77ade3dd72;hp=d3ac045273a4b3107354100ef63d14ff63e84564;hpb=258cbd9cdf386687122b0854274923acafc786d4;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-tt1s.c b/src/ui/gui/psppire-dialog-action-tt1s.c index d3ac045273..5dd36a65dc 100644 --- a/src/ui/gui/psppire-dialog-action-tt1s.c +++ b/src/ui/gui/psppire-dialog-action-tt1s.c @@ -73,7 +73,7 @@ dialog_state_valid (gpointer data) text = gtk_entry_get_text (GTK_ENTRY (tt_d->test_value_entry)); - if ( 0 == strcmp ("", text)) + if (0 == strcmp ("", text)) return FALSE; /* Check to see if the entry is numeric */ @@ -83,7 +83,7 @@ dialog_state_valid (gpointer data) return FALSE; - if ( 0 == gtk_tree_model_get_iter_first (vars, ¬used)) + if (0 == gtk_tree_model_get_iter_first (vars, ¬used)) return FALSE; return TRUE; @@ -102,26 +102,19 @@ refresh (PsppireDialogAction *rd_) gtk_list_store_clear (GTK_LIST_STORE (model)); } -static void -psppire_dialog_action_tt1s_activate (PsppireDialogAction *a) +static GtkBuilder * +psppire_dialog_action_tt1s_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionTt1s *act = PSPPIRE_DIALOG_ACTION_TT1S (a); - GHashTable *thing = psppire_dialog_action_get_hash_table (pda); - GtkBuilder *xml = g_hash_table_lookup (thing, a); - if (!xml) - { - xml = builder_new ("t-test.ui"); - g_hash_table_insert (thing, a, xml); - } - + GtkBuilder *xml = builder_new ("t-test.ui"); GtkWidget *options_button = get_widget_assert (xml, "button1"); pda->dialog = get_widget_assert (xml, "t-test-one-sample-dialog"); pda->source = get_widget_assert (xml, "one-sample-t-test-treeview2"); - g_object_set (pda->source, + g_object_set (pda->source, "predicate", var_is_numeric, NULL); act->vars_treeview = get_widget_assert (xml, "one-sample-t-test-treeview1"); @@ -134,7 +127,7 @@ psppire_dialog_action_tt1s_activate (PsppireDialogAction *a) g_signal_connect_swapped (options_button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opt); - + return xml; } static void @@ -148,7 +141,7 @@ static void psppire_dialog_action_tt1s_class_init (PsppireDialogActionTt1sClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - psppire_dialog_action_set_activation (class, psppire_dialog_action_tt1s_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_tt1s_activate; object_class->finalize = psppire_dialog_action_tt1s_finalize; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;