PsppireDialogAction (generate_syntax): Change signature.
[pspp] / src / ui / gui / psppire-dialog-action-regression.c
index 5a64162993231405f85a672d79df514638a93bc5..58d183e63ff123ca1b5ab82f8f0ac90dc999ef35 100644 (file)
@@ -142,12 +142,19 @@ on_save_clicked (PsppireDialogActionRegression *rd)
 
 
 static void
-psppire_dialog_action_regression_activate (GtkAction *a)
+psppire_dialog_action_regression_activate (PsppireDialogAction *a)
 {
   PsppireDialogActionRegression *act = PSPPIRE_DIALOG_ACTION_REGRESSION (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GtkBuilder *xml = builder_new ("regression.ui");
+  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
+  GtkBuilder *xml = g_hash_table_lookup (thing, a);
+  if (!xml)
+    {
+      xml = builder_new ("regression.ui");
+      g_hash_table_insert (thing, a, xml);
+    }
+
   GtkWidget *stat_button = get_widget_assert (xml, "stat-button");
   GtkWidget *save_button = get_widget_assert (xml, "save-button");
 
@@ -162,8 +169,6 @@ psppire_dialog_action_regression_activate (GtkAction *a)
   act->pred_button = get_widget_assert (xml, "pred-button");
   act->resid_button = get_widget_assert (xml, "resid-button");
 
-  g_object_unref (xml);
-
   psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->stat_view),
                                  B_RG_STATS_DEFAULT,
                                  N_REGRESSION_STATS,
@@ -188,7 +193,7 @@ psppire_dialog_action_regression_activate (GtkAction *a)
 
 
 static char *
-generate_syntax (PsppireDialogAction *a)
+generate_syntax (const PsppireDialogAction *a)
 {
   PsppireDialogActionRegression *rd = PSPPIRE_DIALOG_ACTION_REGRESSION (a);
   gchar *text = NULL;