PsppireDialogAction (generate_syntax): Change signature.
[pspp] / src / ui / gui / psppire-dialog-action-rank.c
index eb7d7d20d1e88ad9b9d7bb3a371febe9325d3bae..e5bce45e8cda74747d21073f8e2dd2b29a90df69 100644 (file)
@@ -36,7 +36,7 @@ G_DEFINE_TYPE (PsppireDialogActionRank, psppire_dialog_action_rank, PSPPIRE_TYPE
 
 
 static char *
-generate_syntax (PsppireDialogAction *act)
+generate_syntax (const PsppireDialogAction *act)
 {
   PsppireDialogActionRank *rd  = PSPPIRE_DIALOG_ACTION_RANK (act);
 
@@ -207,12 +207,18 @@ set_sensitivity (PsppireDialogActionRank *dar)
 }
 
 static void
-psppire_dialog_action_rank_activate (GtkAction *a)
+psppire_dialog_action_rank_activate (PsppireDialogAction *a)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionRank *act = PSPPIRE_DIALOG_ACTION_RANK (a);
 
-  GtkBuilder *xml = builder_new ("rank.ui");
+  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
+  GtkBuilder *xml = g_hash_table_lookup (thing, a);
+  if (!xml)
+    {
+      xml = builder_new ("rank.ui");
+      g_hash_table_insert (thing, a, xml);
+    }
 
   GtkWidget *types_button = get_widget_assert (xml, "button1");
   GtkWidget *ties_button = get_widget_assert (xml, "button2");
@@ -293,8 +299,6 @@ psppire_dialog_action_rank_activate (GtkAction *a)
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
 
   PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_rank_parent_class)->activate (pda);
-  
-  g_object_unref (xml);
 }
 
 static void