Persist dialog box widget settings.
[pspp] / src / ui / gui / psppire-dialog-action-frequencies.c
index 78400effcf5dd33ab1c0005a7a334c70544565d9..490a735f53b7cd7cbda8739b802f04c518887123 100644 (file)
@@ -259,7 +259,13 @@ psppire_dialog_action_frequencies_activate (GtkAction * a)
   PsppireDialogActionFrequencies *act = PSPPIRE_DIALOG_ACTION_FREQUENCIES (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GtkBuilder *xml = builder_new ("frequencies.ui");
+  GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+  GtkBuilder *xml = g_hash_table_lookup (thing, a);
+  if (!xml)
+    {
+      xml = builder_new ("frequencies.ui");
+      g_hash_table_insert (thing, a, xml);
+    }
 
   GtkWidget *stats_treeview = get_widget_assert (xml, "stats-treeview");
   GtkWidget *tables_button = get_widget_assert (xml, "tables-button");
@@ -327,10 +333,6 @@ psppire_dialog_action_frequencies_activate (GtkAction * a)
 
   act->bar =  (get_widget_assert (xml, "bar"));
 
-
-  g_object_unref (xml);
-
-
   act->tables_opts_order = FRQ_AVALUE;
   act->tables_opts_table = FRQ_TABLE;
   act->tables_opts_limit = 50;
@@ -498,10 +500,7 @@ generate_syntax (PsppireDialogAction * a)
 static void
 psppire_dialog_action_frequencies_class_init (PsppireDialogActionFrequenciesClass *class)
 {
-  GtkActionClass *action_class = GTK_ACTION_CLASS (class);
-
-  action_class->activate = psppire_dialog_action_frequencies_activate;
-
+  psppire_dialog_action_set_activation (class, psppire_dialog_action_frequencies_activate);
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }