psppire_data_window: Don't crash when trying to delete cases when none are selected
[pspp] / src / ui / gui / psppire-dialog-action-compute.c
index 5fc63d5dedf48314d4eb017714139ba27fe4cb0b..2a9b68906593cf69b6549062087d62cab86cd0aa 100644 (file)
@@ -35,7 +35,7 @@ G_DEFINE_TYPE (PsppireDialogActionCompute, psppire_dialog_action_compute, PSPPIR
 
 
 static char *
-generate_syntax (PsppireDialogAction *act)
+generate_syntax (const PsppireDialogAction *act)
 {
   PsppireDialogActionCompute *cd = PSPPIRE_DIALOG_ACTION_COMPUTE (act);
   gchar *text;
@@ -454,14 +454,14 @@ insert_function_into_syntax_area (GtkTreeIter iter,
 }
 
 
-
-static void
-psppire_dialog_action_compute_activate (GtkAction *a)
+static GtkBuilder *
+psppire_dialog_action_compute_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionCompute *act = PSPPIRE_DIALOG_ACTION_COMPUTE (a);
 
-  GtkBuilder *xml = builder_new ("compute.ui");
+  GtkBuilder *xml = builder_new ( "compute.ui");
+
   pda->dialog = get_widget_assert   (xml, "compute-variable-dialog");
   pda->source = get_widget_assert   (xml, "compute-treeview1");
 
@@ -490,7 +490,7 @@ psppire_dialog_action_compute_activate (GtkAction *a)
                    G_CALLBACK (on_expression_toggle), pda);
 
   g_signal_connect (act->str_btn, "toggled",
-                   G_CALLBACK (on_type_toggled), pda);
+                   G_CALLBACK (on_type_toggled), pda);
 
 
   g_object_set (pda->source,
@@ -520,16 +520,13 @@ psppire_dialog_action_compute_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_compute_parent_class)->activate)
-    PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_compute_parent_class)->activate (pda);
+  return xml;
 }
 
 static void
 psppire_dialog_action_compute_class_init (PsppireDialogActionComputeClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_compute_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_compute_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }