work on docs
[pspp] / src / ui / gui / psppire-dialog-action-tt1s.c
index d1a4d8e10cd3d60555a3991e3797e14b554d247d..5dd36a65dc106b8607010f0350b4fcb2b3ca48f1 100644 (file)
@@ -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, &notused))
+  if (0 == gtk_tree_model_get_iter_first (vars, &notused))
     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,9 +127,7 @@ psppire_dialog_action_tt1s_activate (PsppireDialogAction *a)
 
   g_signal_connect_swapped (options_button, "clicked",
                            G_CALLBACK (tt_options_dialog_run), act->opt);
-
-  if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_tt1s_parent_class)->activate)
-    PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_tt1s_parent_class)->activate (pda);
+  return xml;
 }
 
 static void
@@ -150,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;