Persist dialog box widget settings.
[pspp] / src / ui / gui / psppire-dialog-action-scatterplot.c
index 64017df7c9935d6e9b9933176d04724c360d5827..3b89d443a37013327cbeeda0afe54893d2dcb900 100644 (file)
@@ -96,7 +96,13 @@ psppire_dialog_action_scatterplot_activate (GtkAction *a)
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionScatterplot *act = PSPPIRE_DIALOG_ACTION_SCATTERPLOT (a);
 
-  GtkBuilder *xml = builder_new ("scatterplot.ui");
+  GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+  GtkBuilder *xml = g_hash_table_lookup (thing, a);
+  if (!xml)
+    {
+      xml = builder_new ("scatterplot.ui");
+      g_hash_table_insert (thing, a, xml);
+    }
 
   pda->dialog = get_widget_assert   (xml, "scatterplot-dialog");
   pda->source = get_widget_assert   (xml, "scatterplot-treeview1");
@@ -107,8 +113,6 @@ psppire_dialog_action_scatterplot_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_scatterplot_parent_class)->activate)
     PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_scatterplot_parent_class)->activate (pda);
 }