treewide: Replace <name>_cnt by n_<name>s and <name>_cap by allocated_<name>.
[pspp] / src / ui / gui / psppire-dialog-action-binomial.c
index 6ca3905c3a166f2f49e89ed1590702872a570d8b..648e6e551d4c1c85ac35faf3e590046839273522 100644 (file)
@@ -67,10 +67,10 @@ dialog_state_valid (gpointer data)
 
   GtkTreeIter notused;
 
-  if ( !gtk_tree_model_get_iter_first (vars, &notused) )
+  if (!gtk_tree_model_get_iter_first (vars, &notused))
     return FALSE;
 
-  if ( ! get_proportion (act, &prop))
+  if (! get_proportion (act, &prop))
     return FALSE;
 
   if (prop < 0 || prop > 1.0)
@@ -96,19 +96,13 @@ refresh (PsppireDialogAction *da)
 }
 
 
-static void
-psppire_dialog_action_binomial_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_binomial_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionBinomial *act = PSPPIRE_DIALOG_ACTION_BINOMIAL (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("binomial.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ("binomial.ui");
 
   pda->dialog = get_widget_assert   (xml, "binomial-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -126,8 +120,8 @@ psppire_dialog_action_binomial_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_refresh (pda, refresh);
 
   psppire_dialog_action_set_valid_predicate (pda,
-                                       dialog_state_valid);
-
+                                            dialog_state_valid);
+  return xml;
 }
 
 
@@ -143,14 +137,14 @@ generate_syntax (const PsppireDialogAction *a)
 
   ds_init_cstr (&str, "NPAR TEST\n\t/BINOMIAL");
 
-  if ( get_proportion (scd, &prop))
+  if (get_proportion (scd, &prop))
     ds_put_c_format (&str, "(%.*g)", DBL_DIG + 1, prop);
 
   ds_put_cstr (&str, " =");
 
   psppire_var_view_append_names_str (PSPPIRE_VAR_VIEW (scd->var_view), 0, &str);
 
-  if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->cutpoint_button)))
+  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (scd->cutpoint_button)))
     {
       const gchar *cutpoint = gtk_entry_get_text (GTK_ENTRY (scd->cutpoint_entry));
       ds_put_c_format  (&str, "(%s)", cutpoint);
@@ -168,7 +162,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_binomial_class_init (PsppireDialogActionBinomialClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_binomial_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_binomial_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }