Rename psppire_dialog_action_get_pointer -> psppire_dialog_action_get_hash_table
[pspp] / src / ui / gui / psppire-dialog-action-logistic.c
index 1908bd98c79c2532fecb0827ecec0f8ce16a4594..15f7d6b9e5bf1eafd728e936ca999bdd940161c7 100644 (file)
@@ -102,7 +102,13 @@ psppire_dialog_action_logistic_activate (GtkAction *a)
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   GtkWidget *opts_button;
 
-  GtkBuilder *xml = builder_new ("logistic.ui");
+  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
+  GtkBuilder *xml = g_hash_table_lookup (thing, a);
+  if (!xml)
+    {
+      xml = builder_new ("logistic.ui");
+      g_hash_table_insert (thing, a, xml);
+    }
 
   pda->dialog = get_widget_assert   (xml, "logistic-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -134,8 +140,6 @@ psppire_dialog_action_logistic_activate (GtkAction *a)
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(act->conf_checkbox), TRUE);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(act->conf_checkbox), FALSE);
 
-  g_object_unref (xml);
-
   psppire_dialog_action_set_refresh (pda, refresh);
 
   psppire_dialog_action_set_valid_predicate (pda,
@@ -191,9 +195,7 @@ generate_syntax (PsppireDialogAction *a)
 static void
 psppire_dialog_action_logistic_class_init (PsppireDialogActionLogisticClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_logistic_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_logistic_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }