Use a more reliable way of setting the initial state of PsppireDialogAction objects.
[pspp] / src / ui / gui / psppire-dialog-action-correlation.c
index 29f6e20179c03cb148ffce4df909cb13d076f1b6..30c3b05bc771aa134b217ca7826c9f7f97ef8139 100644 (file)
@@ -30,7 +30,7 @@ static void psppire_dialog_action_correlation_class_init      (PsppireDialogActi
 G_DEFINE_TYPE (PsppireDialogActionCorrelation, psppire_dialog_action_correlation, PSPPIRE_TYPE_DIALOG_ACTION);
 
 static char *
-generate_syntax (PsppireDialogAction *act)
+generate_syntax (const PsppireDialogAction *act)
 {
   PsppireDialogActionCorrelation *rd = PSPPIRE_DIALOG_ACTION_CORRELATION (act);
   gchar *text;
@@ -91,15 +91,16 @@ refresh (PsppireDialogAction *rd_)
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->two_tailed), TRUE);
 }
 
-static void
-psppire_dialog_action_correlation_activate (GtkAction *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);
 
-  GtkBuilder *xml = builder_new ("correlation.ui");
-  pda->dialog = get_widget_assert   (xml, "correlation-dialog");
-  pda->source = get_widget_assert   (xml, "dict-view");
+  GtkBuilder *xml = builder_new ( "correlation.ui");
+
+  pda->dialog = get_widget_assert (xml, "correlation-dialog");
+  pda->source = get_widget_assert (xml, "dict-view");
 
   act->variables = get_widget_assert (xml, "psppire-var-view1");
   act->significant = get_widget_assert (xml, "button-flag-significants");
@@ -108,16 +109,13 @@ psppire_dialog_action_correlation_activate (GtkAction *a)
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
 
-  g_object_unref (xml);
-
-  if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_correlation_parent_class)->activate)
-    PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_correlation_parent_class)->activate (pda);
+  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;
 }