PsppireDialogAction (generate_syntax): Change signature.
[pspp] / src / ui / gui / psppire-dialog-action-examine.c
index 4a1dcd6cd5b4f0ec22d19dbebd8390af90aeb65f..51d3e7fd8477b31e8a28009830191f813ec83a81 100644 (file)
@@ -107,7 +107,7 @@ run_opts_dialog (PsppireDialogActionExamine *ed)
 
 
 static char *
-generate_syntax (PsppireDialogAction *act)
+generate_syntax (const PsppireDialogAction *act)
 {
   PsppireDialogActionExamine *ed  = PSPPIRE_DIALOG_ACTION_EXAMINE (act);
 
@@ -198,12 +198,18 @@ dialog_refresh (PsppireDialogAction *da)
 }
 
 static void
-psppire_dialog_action_examine_activate (GtkAction *a)
+psppire_dialog_action_examine_activate (PsppireDialogAction *a)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionExamine *act = PSPPIRE_DIALOG_ACTION_EXAMINE (a);
 
-  GtkBuilder *xml = builder_new ("examine.ui");
+  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
+  GtkBuilder *xml = g_hash_table_lookup (thing, a);
+  if (!xml)
+    {
+      xml = builder_new ("examine.ui");
+      g_hash_table_insert (thing, a, xml);
+    }
 
   GtkWidget *stats_button = get_widget_assert (xml, "stats-button");
   GtkWidget *opts_button = get_widget_assert (xml, "opts-button");
@@ -255,15 +261,13 @@ psppire_dialog_action_examine_activate (GtkAction *a)
  
   PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_examine_parent_class)->activate (pda);
 
-
   g_list_free (list);
-  g_object_unref (xml);
 }
 
 static void
 psppire_dialog_action_examine_class_init (PsppireDialogActionExamineClass *class)
 {
-  GTK_ACTION_CLASS (class)->activate = psppire_dialog_action_examine_activate;
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_examine_activate);
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }