Use a more reliable way of setting the initial state of PsppireDialogAction objects.
[pspp] / src / ui / gui / psppire-dialog-action-correlation.c
index 676f13e6aaed6a29638d89bf3a5c6516b9144fe7..30c3b05bc771aa134b217ca7826c9f7f97ef8139 100644 (file)
@@ -91,19 +91,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->two_tailed), TRUE);
 }
 
-static void
-psppire_dialog_action_correlation_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_correlation_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionCorrelation *act = PSPPIRE_DIALOG_ACTION_CORRELATION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("correlation.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "correlation.ui");
 
   pda->dialog = get_widget_assert (xml, "correlation-dialog");
   pda->source = get_widget_assert (xml, "dict-view");
@@ -115,12 +109,13 @@ psppire_dialog_action_correlation_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_correlation_class_init (PsppireDialogActionCorrelationClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_correlation_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_correlation_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }