Use a more reliable way of setting the initial state of PsppireDialogAction objects.
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 2 Jun 2017 08:12:15 +0000 (10:12 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 2 Jun 2017 15:28:56 +0000 (17:28 +0200)
47 files changed:
src/ui/gui/builder-wrapper.c
src/ui/gui/builder-wrapper.h
src/ui/gui/psppire-dialog-action-1sks.c
src/ui/gui/psppire-dialog-action-aggregate.c
src/ui/gui/psppire-dialog-action-autorecode.c
src/ui/gui/psppire-dialog-action-barchart.c
src/ui/gui/psppire-dialog-action-binomial.c
src/ui/gui/psppire-dialog-action-chisquare.c
src/ui/gui/psppire-dialog-action-comments.c
src/ui/gui/psppire-dialog-action-compute.c
src/ui/gui/psppire-dialog-action-correlation.c
src/ui/gui/psppire-dialog-action-count.c
src/ui/gui/psppire-dialog-action-crosstabs.c
src/ui/gui/psppire-dialog-action-descriptives.c
src/ui/gui/psppire-dialog-action-examine.c
src/ui/gui/psppire-dialog-action-factor.c
src/ui/gui/psppire-dialog-action-flip.c
src/ui/gui/psppire-dialog-action-frequencies.c
src/ui/gui/psppire-dialog-action-histogram.c
src/ui/gui/psppire-dialog-action-indep-samps.c
src/ui/gui/psppire-dialog-action-k-independent.c
src/ui/gui/psppire-dialog-action-k-related.c
src/ui/gui/psppire-dialog-action-kmeans.c
src/ui/gui/psppire-dialog-action-logistic.c
src/ui/gui/psppire-dialog-action-means.c
src/ui/gui/psppire-dialog-action-oneway.c
src/ui/gui/psppire-dialog-action-paired.c
src/ui/gui/psppire-dialog-action-rank.c
src/ui/gui/psppire-dialog-action-recode-different.c
src/ui/gui/psppire-dialog-action-recode-same.c
src/ui/gui/psppire-dialog-action-recode.c
src/ui/gui/psppire-dialog-action-recode.h
src/ui/gui/psppire-dialog-action-regression.c
src/ui/gui/psppire-dialog-action-reliability.c
src/ui/gui/psppire-dialog-action-roc.c
src/ui/gui/psppire-dialog-action-runs.c
src/ui/gui/psppire-dialog-action-scatterplot.c
src/ui/gui/psppire-dialog-action-select.c
src/ui/gui/psppire-dialog-action-sort.c
src/ui/gui/psppire-dialog-action-split.c
src/ui/gui/psppire-dialog-action-tt1s.c
src/ui/gui/psppire-dialog-action-two-sample.c
src/ui/gui/psppire-dialog-action-univariate.c
src/ui/gui/psppire-dialog-action-var-info.c
src/ui/gui/psppire-dialog-action-weight.c
src/ui/gui/psppire-dialog-action.c
src/ui/gui/psppire-dialog-action.h

index 94b1b365de8ae812753c72ae0e4b32ea1a818a60..0750158e34f977aad8be0f050426d32aa95fb4a7 100644 (file)
@@ -36,24 +36,6 @@ builder_new_real (const gchar *name)
   return builder;
 }
 
-
-GtkBuilder *
-builder_new_x (const gchar *obj_name)
-{
-  GtkBuilder *b;
-  GString *str = g_string_new (PKGDATADIR);
-  g_string_append (str, "/");
-  g_string_append (str, obj_name);
-
-  b = builder_new_real (relocate (str->str));
-
-  g_string_free (str, TRUE);
-
-  return b;
-}
-
-
-
 GObject *
 get_object_assert (GtkBuilder *builder, const gchar *name, GType type)
 {
index 43c3204e185221bd57dc34c397c615b07910bce4..db45168f32b98d3981e097b7a08665222e74442c 100644 (file)
 #include "relocatable.h"
 #include "gl/configmake.h"
 
-
 GtkBuilder *builder_new_real (const gchar *name);
 
-GtkBuilder * builder_new_x (const gchar *obj_name);
-
 #define builder_new(NAME) (builder_new_real (relocate (PKGDATADIR "/" NAME)))
 
 GObject *get_object_assert (GtkBuilder *builder, const gchar *name, GType type);
index 7f31ebac476adf716f5e44d16751def4a83d4025..3814c7dccf19faa31d692f281f84a9897d6d0ce2 100644 (file)
@@ -116,19 +116,13 @@ refresh (PsppireDialogAction *rd_)
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (fd->cb[i]), FALSE);
 }
 
-static void
-psppire_dialog_action_1sks_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_1sks_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogAction1sks *act = PSPPIRE_DIALOG_ACTION_1SKS (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("ks-one-sample.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "ks-one-sample.ui");
 
   pda->dialog = get_widget_assert   (xml, "ks-one-sample-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -142,13 +136,13 @@ psppire_dialog_action_1sks_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_1sks_class_init (PsppireDialogAction1sksClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_1sks_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_1sks_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index ac667ef822851bcbb2b8d18f591f5a74e619e569..057b6926fda8828686a010b20a8b1e15a30fc667 100644 (file)
@@ -482,124 +482,116 @@ update_arguments (PsppireDialogActionAggregate *agg)
 
 
 
-static void
-psppire_dialog_action_aggregate_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_aggregate_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionAggregate *act = PSPPIRE_DIALOG_ACTION_AGGREGATE (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("aggregate.ui");
-      g_hash_table_insert (thing, a, xml);
-
-
-      pda->dialog = get_widget_assert (xml, "aggregate-dialog");
-      pda->source = get_widget_assert (xml, "dict-view");
-
+  GtkBuilder *xml = builder_new ("aggregate.ui");
 
+  pda->dialog = get_widget_assert (xml, "aggregate-dialog");
+  pda->source = get_widget_assert (xml, "dict-view");
 
-      GtkWidget *break_selector = get_widget_assert   (xml, "break-selector");
+  GtkWidget *break_selector = get_widget_assert   (xml, "break-selector");
 
-      act->pane = get_widget_assert (xml, "hbox1");
+  act->pane = get_widget_assert (xml, "hbox1");
 
-      act->break_variables = get_widget_assert (xml, "psppire-var-view1");
-      act->filename_radiobutton = get_widget_assert (xml, "filename-radiobutton");
-      act->filename_button = get_widget_assert (xml, "filename-button");
-      act->filename_box = get_widget_assert (xml, "filename-box");
-      act->filename_label = get_widget_assert (xml, "filename-label");
-      act->replace_radiobutton = get_widget_assert (xml, "replace-radiobutton");
-      act->add_radiobutton = get_widget_assert (xml, "add-radiobutton");
-      act->function_combo = get_widget_assert (xml, "function-combo");
+  act->break_variables = get_widget_assert (xml, "psppire-var-view1");
+  act->filename_radiobutton = get_widget_assert (xml, "filename-radiobutton");
+  act->filename_button = get_widget_assert (xml, "filename-button");
+  act->filename_box = get_widget_assert (xml, "filename-box");
+  act->filename_label = get_widget_assert (xml, "filename-label");
+  act->replace_radiobutton = get_widget_assert (xml, "replace-radiobutton");
+  act->add_radiobutton = get_widget_assert (xml, "add-radiobutton");
+  act->function_combo = get_widget_assert (xml, "function-combo");
 
-      act->summary_acr = get_widget_assert (xml, "psppire-acr1");
-      act->summary_var_name_entry = get_widget_assert (xml, "summary-var-name-entry");
+  act->summary_acr = get_widget_assert (xml, "psppire-acr1");
+  act->summary_var_name_entry = get_widget_assert (xml, "summary-var-name-entry");
 
-      act->summary_arg1 = get_widget_assert (xml, "summary-arg1");
-      act->summary_arg2 = get_widget_assert (xml, "summary-arg2");
+  act->summary_arg1 = get_widget_assert (xml, "summary-arg1");
+  act->summary_arg2 = get_widget_assert (xml, "summary-arg2");
 
-      act->summary_arg1_entry = get_widget_assert (xml, "summary-arg-entry1");
-      act->summary_arg2_entry = get_widget_assert (xml, "summary-arg-entry2");
+  act->summary_arg1_entry = get_widget_assert (xml, "summary-arg-entry1");
+  act->summary_arg2_entry = get_widget_assert (xml, "summary-arg-entry2");
 
-      act->summary_var_label_entry = get_widget_assert (xml, "summary-var-label-entry");
+  act->summary_var_label_entry = get_widget_assert (xml, "summary-var-label-entry");
 
-      act->summary_sv = get_widget_assert (xml, "source-var");
-      act->summary_sv_entry = get_widget_assert (xml, "source-var-entry");
+  act->summary_sv = get_widget_assert (xml, "source-var");
+  act->summary_sv_entry = get_widget_assert (xml, "source-var-entry");
 
-      act->sorted_button = get_widget_assert (xml, "sorted-radiobutton");
-      act->needs_sort_button = get_widget_assert (xml, "needs-sort-radiobutton");
+  act->sorted_button = get_widget_assert (xml, "sorted-radiobutton");
+  act->needs_sort_button = get_widget_assert (xml, "needs-sort-radiobutton");
 
-      {
-       GtkTreeViewColumn *column ;
+  {
+    GtkTreeViewColumn *column ;
 
-       GList *l ;
+    GList *l ;
 
-       GtkCellRenderer *cell_renderer ;
+    GtkCellRenderer *cell_renderer ;
 
-       GtkListStore *list = gtk_list_store_new (6,
-                                                G_TYPE_STRING,
-                                                G_TYPE_STRING,
-                                                G_TYPE_INT,
-                                                G_TYPE_STRING,
-                                                G_TYPE_DOUBLE,
-                                                G_TYPE_DOUBLE);
+    GtkListStore *list = gtk_list_store_new (6,
+                                            G_TYPE_STRING,
+                                            G_TYPE_STRING,
+                                            G_TYPE_INT,
+                                            G_TYPE_STRING,
+                                            G_TYPE_DOUBLE,
+                                            G_TYPE_DOUBLE);
 
-       psppire_acr_set_model (PSPPIRE_ACR (act->summary_acr), list);
-       g_object_unref (list);
+    psppire_acr_set_model (PSPPIRE_ACR (act->summary_acr), list);
+    g_object_unref (list);
 
-       psppire_acr_set_get_value_func (PSPPIRE_ACR (act->summary_acr),
-                                       get_summary_spec, act);
+    psppire_acr_set_get_value_func (PSPPIRE_ACR (act->summary_acr),
+                                   get_summary_spec, act);
 
-       column = gtk_tree_view_get_column (PSPPIRE_ACR (act->summary_acr)->tv, 0);
+    column = gtk_tree_view_get_column (PSPPIRE_ACR (act->summary_acr)->tv, 0);
 
-       l = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
+    l = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT (column));
 
-       cell_renderer = l->data;
+    cell_renderer = l->data;
 
-       gtk_tree_view_column_set_cell_data_func (column,
-                                                cell_renderer,
-                                                render_summary,
-                                                act,
-                                                NULL);
+    gtk_tree_view_column_set_cell_data_func (column,
+                                            cell_renderer,
+                                            render_summary,
+                                            act,
+                                            NULL);
 
-       g_signal_connect_swapped (PSPPIRE_ACR (act->summary_acr)->tv,
-                                 "cursor-changed", G_CALLBACK (on_acr_change), act);
-      }
+    g_signal_connect_swapped (PSPPIRE_ACR (act->summary_acr)->tv,
+                             "cursor-changed", G_CALLBACK (on_acr_change), act);
+  }
 
-      g_signal_connect_swapped (act->summary_var_name_entry, "changed", G_CALLBACK (update_acr),  act);
-      g_signal_connect_swapped (act->function_combo, "changed", G_CALLBACK (update_acr),  act);
-      g_signal_connect_swapped (act->summary_sv_entry, "changed", G_CALLBACK (update_acr),  act);
-      g_signal_connect_swapped (act->summary_arg1_entry, "changed", G_CALLBACK (update_acr),  act);
-      g_signal_connect_swapped (act->summary_arg2_entry, "changed", G_CALLBACK (update_acr),  act);
+  g_signal_connect_swapped (act->summary_var_name_entry, "changed", G_CALLBACK (update_acr),  act);
+  g_signal_connect_swapped (act->function_combo, "changed", G_CALLBACK (update_acr),  act);
+  g_signal_connect_swapped (act->summary_sv_entry, "changed", G_CALLBACK (update_acr),  act);
+  g_signal_connect_swapped (act->summary_arg1_entry, "changed", G_CALLBACK (update_acr),  act);
+  g_signal_connect_swapped (act->summary_arg2_entry, "changed", G_CALLBACK (update_acr),  act);
 
 
-      g_signal_connect_swapped (act->function_combo, "changed",
-                               G_CALLBACK (update_arguments),  act);
+  g_signal_connect_swapped (act->function_combo, "changed",
+                           G_CALLBACK (update_arguments),  act);
 
-      populate_combo_model (GTK_COMBO_BOX (act->function_combo));
+  populate_combo_model (GTK_COMBO_BOX (act->function_combo));
 
 
-      psppire_selector_set_filter_func (PSPPIRE_SELECTOR (break_selector), NULL);
+  psppire_selector_set_filter_func (PSPPIRE_SELECTOR (break_selector), NULL);
 
 
-      g_signal_connect (act->filename_radiobutton, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle), act->filename_box );
+  g_signal_connect (act->filename_radiobutton, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle), act->filename_box );
 
-      g_signal_connect_swapped (act->filename_button, "clicked",
-                               G_CALLBACK (choose_filename), act);
+  g_signal_connect_swapped (act->filename_button, "clicked",
+                           G_CALLBACK (choose_filename), act);
 
-      psppire_dialog_action_set_refresh (pda, refresh);
-      psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
-    }
+  psppire_dialog_action_set_refresh (pda, refresh);
+  psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_aggregate_class_init (PsppireDialogActionAggregateClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_aggregate_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_aggregate_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index ad36dd0bc4a797eba6060118c697d544fb94e063..ef3d4d77db41a52f3ec120e8bd2df7cc5cf26ce8 100644 (file)
@@ -308,84 +308,75 @@ render_new_var_name (GtkTreeViewColumn *tree_column,
 }
 
 
-static void
-psppire_dialog_action_autorecode_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_autorecode_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionAutorecode *act = PSPPIRE_DIALOG_ACTION_AUTORECODE (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("autorecode.ui");
-      g_hash_table_insert (thing, a, xml);
-
-      pda->dialog = get_widget_assert   (xml, "autorecode-dialog");
-      pda->source = get_widget_assert   (xml, "dict-view");
-
-
+  GtkBuilder *xml = builder_new ("autorecode.ui");
 
+  pda->dialog = get_widget_assert   (xml, "autorecode-dialog");
+  pda->source = get_widget_assert   (xml, "dict-view");
 
-      act->var_view = get_widget_assert   (xml, "var-view");
+  act->var_view = get_widget_assert   (xml, "var-view");
 
-      act->new_name_entry = get_widget_assert (xml, "entry1");
-      act->change_button = get_widget_assert (xml, "button1");
-      act->ascending = get_widget_assert (xml, "radiobutton1");
-      act->group = get_widget_assert (xml, "checkbutton1");
-      act->blank = get_widget_assert (xml, "checkbutton2");
+  act->new_name_entry = get_widget_assert (xml, "entry1");
+  act->change_button = get_widget_assert (xml, "button1");
+  act->ascending = get_widget_assert (xml, "radiobutton1");
+  act->group = get_widget_assert (xml, "checkbutton1");
+  act->blank = get_widget_assert (xml, "checkbutton2");
 
-      {
-       GtkTreeSelection *sel;
-
-       GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
+  {
+    GtkTreeSelection *sel;
 
-       GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes (_("New"),
-                                                                          renderer,
-                                                                          "text", NULL,
-                                                                          NULL);
+    GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
 
-       gtk_tree_view_column_set_cell_data_func (col, renderer,
-                                                render_new_var_name,
-                                                act, NULL);
+    GtkTreeViewColumn *col = gtk_tree_view_column_new_with_attributes (_("New"),
+                                                                      renderer,
+                                                                      "text", NULL,
+                                                                      NULL);
 
-       gtk_tree_view_append_column (GTK_TREE_VIEW (act->var_view), col);
+    gtk_tree_view_column_set_cell_data_func (col, renderer,
+                                            render_new_var_name,
+                                            act, NULL);
 
+    gtk_tree_view_append_column (GTK_TREE_VIEW (act->var_view), col);
 
-       col = gtk_tree_view_get_column (GTK_TREE_VIEW (act->var_view), 0);
 
-       g_object_set (col, "title", _("Old"), NULL);
+    col = gtk_tree_view_get_column (GTK_TREE_VIEW (act->var_view), 0);
 
-       g_object_set (act->var_view, "headers-visible", TRUE, NULL);
+    g_object_set (col, "title", _("Old"), NULL);
 
-       act->varmap = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, nlp_destroy);
+    g_object_set (act->var_view, "headers-visible", TRUE, NULL);
 
+    act->varmap = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, nlp_destroy);
 
-       sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (act->var_view));
 
+    sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (act->var_view));
 
-       g_signal_connect (sel, "changed",
-                         G_CALLBACK (on_selection_change), act);
 
-       g_signal_connect (act->change_button, "clicked",
-                         G_CALLBACK (on_change_clicked),  act);
+    g_signal_connect (sel, "changed",
+                     G_CALLBACK (on_selection_change), act);
 
-       g_signal_connect_swapped (act->new_name_entry, "changed",
-                                 G_CALLBACK (on_entry_change),  act);
+    g_signal_connect (act->change_button, "clicked",
+                     G_CALLBACK (on_change_clicked),  act);
 
-      }
+    g_signal_connect_swapped (act->new_name_entry, "changed",
+                             G_CALLBACK (on_entry_change),  act);
 
-    }
+  }
 
   psppire_dialog_action_set_refresh (pda, refresh);
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_autorecode_class_init (PsppireDialogActionAutorecodeClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_autorecode_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_autorecode_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index adbd8b956bc7775523b905bce65afae2948daeff..900188fcbf7db82c4f81b0155876d2538db8ed81 100644 (file)
@@ -114,45 +114,40 @@ populate_combo_model (GtkComboBox *cb)
 }
 
 
-static void
-psppire_dialog_action_barchart_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_barchart_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionBarchart *act = PSPPIRE_DIALOG_ACTION_BARCHART (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("barchart.ui");
-      g_hash_table_insert (thing, a, xml);
+  GtkBuilder *xml = builder_new ( "barchart.ui");
 
-      pda->dialog = get_widget_assert (xml, "barchart-dialog");
-      pda->source = get_widget_assert (xml, "dict-view");
+  pda->dialog = get_widget_assert (xml, "barchart-dialog");
+  pda->source = get_widget_assert (xml, "dict-view");
 
-      act->variable_xaxis = get_widget_assert (xml, "entry1");
-      act->variable_cluster = get_widget_assert (xml, "entry3");
-      act->var = get_widget_assert (xml, "entry2");
-      act->button_freq_func[0] = get_widget_assert (xml, "radiobutton-count");
-      act->button_freq_func[1] = get_widget_assert (xml, "radiobutton-percent");
-      act->button_freq_func[2] = get_widget_assert (xml, "radiobutton-cum-count");
-      act->button_freq_func[3] = get_widget_assert (xml, "radiobutton-cum-percent");
+  act->variable_xaxis = get_widget_assert (xml, "entry1");
+  act->variable_cluster = get_widget_assert (xml, "entry3");
+  act->var = get_widget_assert (xml, "entry2");
+  act->button_freq_func[0] = get_widget_assert (xml, "radiobutton-count");
+  act->button_freq_func[1] = get_widget_assert (xml, "radiobutton-percent");
+  act->button_freq_func[2] = get_widget_assert (xml, "radiobutton-cum-count");
+  act->button_freq_func[3] = get_widget_assert (xml, "radiobutton-cum-percent");
 
-      act->button_summary_func = get_widget_assert (xml, "radiobutton3");
-      act->summary_variables = get_widget_assert (xml, "hbox1");
-      act->combobox = get_widget_assert (xml, "combobox1");
+  act->button_summary_func = get_widget_assert (xml, "radiobutton3");
+  act->summary_variables = get_widget_assert (xml, "hbox1");
+  act->combobox = get_widget_assert (xml, "combobox1");
 
-      populate_combo_model (GTK_COMBO_BOX(act->combobox));
+  populate_combo_model (GTK_COMBO_BOX(act->combobox));
 
-      g_signal_connect_swapped (act->button_summary_func, "toggled",
-                               G_CALLBACK (on_summary_toggle), act);
+  g_signal_connect_swapped (act->button_summary_func, "toggled",
+                           G_CALLBACK (on_summary_toggle), act);
 
-      psppire_dialog_action_set_refresh (pda, refresh);
+  psppire_dialog_action_set_refresh (pda, refresh);
 
-      psppire_dialog_action_set_valid_predicate (pda,
-                                                dialog_state_valid);
-    }
+  psppire_dialog_action_set_valid_predicate (pda,
+                                            dialog_state_valid);
 
+  return xml;
 }
 
 static char *
@@ -229,7 +224,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_barchart_class_init (PsppireDialogActionBarchartClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_barchart_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_barchart_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 6ca3905c3a166f2f49e89ed1590702872a570d8b..0a9f171f240c0e39cb2cdf4bef7ebb8b1a417122 100644 (file)
@@ -96,19 +96,13 @@ refresh (PsppireDialogAction *da)
 }
 
 
-static void
-psppire_dialog_action_binomial_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_binomial_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionBinomial *act = PSPPIRE_DIALOG_ACTION_BINOMIAL (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("binomial.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "binomial.ui");
 
   pda->dialog = get_widget_assert   (xml, "binomial-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -126,8 +120,8 @@ psppire_dialog_action_binomial_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_refresh (pda, refresh);
 
   psppire_dialog_action_set_valid_predicate (pda,
-                                       dialog_state_valid);
-
+                                            dialog_state_valid);
+  return xml;
 }
 
 
@@ -168,7 +162,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_binomial_class_init (PsppireDialogActionBinomialClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_binomial_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_binomial_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index a8dc856b77c2f0c3a0418ecd3b248ff5768513d1..57f8250078c081022a6a7bb5d802e34de51158fa 100644 (file)
@@ -128,19 +128,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_entry_set_text (GTK_ENTRY (csd->value_upper), "");
 }
 
-static void
-psppire_dialog_action_chisquare_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_chisquare_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionChisquare *act = PSPPIRE_DIALOG_ACTION_CHISQUARE (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("chi-square.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "chi-square.ui");
 
   GtkWidget *range_table = get_widget_assert   (xml, "range-table");
   GtkWidget *values_acr = get_widget_assert   (xml, "psppire-acr1");
@@ -183,13 +177,13 @@ psppire_dialog_action_chisquare_activate (PsppireDialogAction *a)
 
   psppire_acr_set_model(PSPPIRE_ACR (values_acr), act->expected_list);
 
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_chisquare_class_init (PsppireDialogActionChisquareClass *class)
 {
-  psppire_dialog_action_set_activation (class,  psppire_dialog_action_chisquare_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_chisquare_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index dcbe4ddaca898d586d454bc8fc1b760cc975f515..ca7ad41bfa73182eff89112b714b9f105c86b47f 100644 (file)
@@ -167,100 +167,94 @@ wrap_line (GtkTextBuffer *buffer,
 }
 
 
-static void
-psppire_dialog_action_comments_activate (PsppireDialogAction *pda)
+static GtkBuilder *
+psppire_dialog_action_comments_activate (PsppireDialogAction *pda, GVariant *param)
 {
   PsppireDialogActionComments *act = PSPPIRE_DIALOG_ACTION_COMMENTS (pda);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, pda);
-  if (!xml)
-    {
-      GtkTextIter iter;
+  GtkBuilder *xml = builder_new ( "comments.ui");
 
-      xml = builder_new ("comments.ui");
-      g_hash_table_insert (thing, pda, xml);
+  pda->dialog = get_widget_assert (xml, "comments-dialog");
+  act->textview = get_widget_assert (xml, "comments-textview1");
+  GtkWidget *label = get_widget_assert (xml, "column-number-label");
+  GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (act->textview));
+  act->check = get_widget_assert (xml, "comments-checkbutton1");
 
-      pda->dialog = get_widget_assert (xml, "comments-dialog");
-      act->textview = get_widget_assert (xml, "comments-textview1");
-      GtkWidget *label = get_widget_assert (xml, "column-number-label");
-      GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (act->textview));
-      act->check = get_widget_assert (xml, "comments-checkbutton1");
+  g_signal_connect_swapped (pda->dialog, "show", G_CALLBACK (retrieve_comments), pda);
 
-      g_signal_connect_swapped (pda->dialog, "show", G_CALLBACK (retrieve_comments), pda);
+  {
+    PangoContext * context ;
+    PangoLayout *  layout ;
+    PangoRectangle rect;
 
-      {
-       PangoContext * context ;
-       PangoLayout *  layout ;
-       PangoRectangle rect;
 
+    /* Since we're going to truncate lines to 80 chars,
+       we need a monospaced font otherwise it'll look silly */
+    PangoFontDescription *font_desc =
+      pango_font_description_from_string ("monospace");
+    {
+      GtkStyleContext *style = gtk_widget_get_style_context (GTK_WIDGET (act->textview));
+      GtkCssProvider *cssp = gtk_css_provider_new ();
+
+      gchar *str = pango_font_description_to_string (font_desc);
+      gchar *css =
+       g_strdup_printf ("* {font: %s}", str);
+      g_free (str);
 
-       /* Since we're going to truncate lines to 80 chars,
-          we need a monospaced font otherwise it'll look silly */
-       PangoFontDescription *font_desc =
-         pango_font_description_from_string ("monospace");
+      GError *err = NULL;
+      gtk_css_provider_load_from_data (cssp, css, -1, &err);
+      if (err)
        {
-         GtkStyleContext *style = gtk_widget_get_style_context (GTK_WIDGET (act->textview));
-         GtkCssProvider *cssp = gtk_css_provider_new ();
-
-         gchar *str = pango_font_description_to_string (font_desc);
-         gchar *css =
-           g_strdup_printf ("* {font: %s}", str);
-         g_free (str);
-
-         GError *err = NULL;
-         gtk_css_provider_load_from_data (cssp, css, -1, &err);
-         if (err)
-           {
-             g_warning ("Failed to load font css \"%s\": %s", css, err->message);
-             g_error_free (err);
-           }
-         g_free (css);
-
-         gtk_style_context_add_provider (style,
-                                         GTK_STYLE_PROVIDER (cssp),
-                                         GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-         g_object_unref (cssp);
+         g_warning ("Failed to load font css \"%s\": %s", css, err->message);
+         g_error_free (err);
        }
+      g_free (css);
 
-       /* And let's just make sure that a complete line fits into the
-          widget's width */
-       context = gtk_widget_create_pango_context (act->textview);
-       layout = pango_layout_new (context);
+      gtk_style_context_add_provider (style,
+                                     GTK_STYLE_PROVIDER (cssp),
+                                     GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+      g_object_unref (cssp);
+    }
 
-       pango_layout_set_text (layout, "M", 1);
+    /* And let's just make sure that a complete line fits into the
+       widget's width */
+    context = gtk_widget_create_pango_context (act->textview);
+    layout = pango_layout_new (context);
 
-       pango_layout_set_font_description (layout, font_desc);
+    pango_layout_set_text (layout, "M", 1);
 
-       pango_layout_get_extents (layout, NULL, &rect);
+    pango_layout_set_font_description (layout, font_desc);
 
-       g_object_set (act->textview, "width-request",
-                     PANGO_PIXELS (rect.width) * DOC_LINE_LENGTH + 20, NULL);
+    pango_layout_get_extents (layout, NULL, &rect);
 
-       g_object_unref (G_OBJECT (layout));
-       g_object_unref (G_OBJECT (context));
+    g_object_set (act->textview, "width-request",
+                 PANGO_PIXELS (rect.width) * DOC_LINE_LENGTH + 20, NULL);
 
-       pango_font_description_free (font_desc);
-      }
+    g_object_unref (G_OBJECT (layout));
+    g_object_unref (G_OBJECT (context));
 
-      g_signal_connect (buffer, "mark-set",
-                       G_CALLBACK (set_column_number), label);
+    pango_font_description_free (font_desc);
+  }
+  GtkTextIter iter;
+  g_signal_connect (buffer, "mark-set",
+                   G_CALLBACK (set_column_number), label);
 
-      g_signal_connect_after (buffer, "insert-text",
-                             G_CALLBACK (wrap_line), NULL);
+  g_signal_connect_after (buffer, "insert-text",
+                         G_CALLBACK (wrap_line), NULL);
 
-      gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
-      gtk_text_buffer_place_cursor (buffer, &iter);
-    }
+  gtk_text_buffer_get_iter_at_offset (buffer, &iter, 0);
+  gtk_text_buffer_place_cursor (buffer, &iter);
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
+
+  return xml;
 }
 
 static void
 psppire_dialog_action_comments_class_init (PsppireDialogActionCommentsClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_comments_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate  = psppire_dialog_action_comments_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 18292cec9397e5a2bb03669156ee3de4e0bc35c9..2a9b68906593cf69b6549062087d62cab86cd0aa 100644 (file)
@@ -454,85 +454,79 @@ insert_function_into_syntax_area (GtkTreeIter iter,
 }
 
 
-
-static void
-psppire_dialog_action_compute_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_compute_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionCompute *act = PSPPIRE_DIALOG_ACTION_COMPUTE (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("compute.ui");
-      g_hash_table_insert (thing, a, xml);
+  GtkBuilder *xml = builder_new ( "compute.ui");
 
-      pda->dialog = get_widget_assert   (xml, "compute-variable-dialog");
-      pda->source = get_widget_assert   (xml, "compute-treeview1");
+  pda->dialog = get_widget_assert   (xml, "compute-variable-dialog");
+  pda->source = get_widget_assert   (xml, "compute-treeview1");
 
-      act->textview = get_widget_assert (xml, "compute-textview1");
-      act->entry =
-       get_widget_assert (xml, "type-and-label-label-entry");
+  act->textview = get_widget_assert (xml, "compute-textview1");
+  act->entry =
+    get_widget_assert (xml, "type-and-label-label-entry");
 
-      act->width_entry =
-       get_widget_assert (xml, "type-and-label-width");
+  act->width_entry =
+    get_widget_assert (xml, "type-and-label-width");
 
-      act->functions = get_widget_assert (xml, "compute-treeview2");
-      act->keypad    = get_widget_assert (xml, "psppire-keypad1");
-      act->target    = get_widget_assert (xml, "compute-entry1");
-      act->var_selector = get_widget_assert (xml, "compute-selector1");
-      act->func_selector = get_widget_assert (xml, "compute-selector2");
-      act->type_and_label = get_widget_assert (xml, "compute-button1");
+  act->functions = get_widget_assert (xml, "compute-treeview2");
+  act->keypad    = get_widget_assert (xml, "psppire-keypad1");
+  act->target    = get_widget_assert (xml, "compute-entry1");
+  act->var_selector = get_widget_assert (xml, "compute-selector1");
+  act->func_selector = get_widget_assert (xml, "compute-selector2");
+  act->type_and_label = get_widget_assert (xml, "compute-button1");
 
-      act->subdialog = get_widget_assert (xml, "type-and-label-dialog");
+  act->subdialog = get_widget_assert (xml, "type-and-label-dialog");
 
-      act->numeric_target = get_widget_assert (xml, "radio-button-numeric");
-      act->expression = get_widget_assert (xml, "radio-button-expression-label");
-      act->user_label  = get_widget_assert (xml, "radio-button-user-label");
-      act->str_btn    = get_widget_assert (xml, "radio-button-string");
+  act->numeric_target = get_widget_assert (xml, "radio-button-numeric");
+  act->expression = get_widget_assert (xml, "radio-button-expression-label");
+  act->user_label  = get_widget_assert (xml, "radio-button-user-label");
+  act->str_btn    = get_widget_assert (xml, "radio-button-string");
 
-      g_signal_connect (act->expression, "toggled",
-                       G_CALLBACK (on_expression_toggle), pda);
+  g_signal_connect (act->expression, "toggled",
+                   G_CALLBACK (on_expression_toggle), pda);
 
-      g_signal_connect (act->str_btn, "toggled",
-                       G_CALLBACK (on_type_toggled), pda);
+  g_signal_connect (act->str_btn, "toggled",
+                   G_CALLBACK (on_type_toggled), pda);
 
 
-      g_object_set (pda->source,
-                   "selection-mode", GTK_SELECTION_SINGLE,
-                   NULL);
+  g_object_set (pda->source,
+               "selection-mode", GTK_SELECTION_SINGLE,
+               NULL);
 
-      psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->var_selector),
-                                       insert_source_row_into_text_view, NULL);
+  psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->var_selector),
+                                   insert_source_row_into_text_view, NULL);
 
 
-      function_list_populate (GTK_TREE_VIEW (act->functions));
+  function_list_populate (GTK_TREE_VIEW (act->functions));
 
-      psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->func_selector),
-                                       insert_function_into_syntax_area, NULL);
+  psppire_selector_set_select_func (PSPPIRE_SELECTOR (act->func_selector),
+                                   insert_function_into_syntax_area, NULL);
 
-      g_signal_connect (act->target, "changed", G_CALLBACK (on_target_change), act);
+  g_signal_connect (act->target, "changed", G_CALLBACK (on_target_change), act);
 
-      g_signal_connect (act->keypad, "insert-syntax",
-                       G_CALLBACK (on_keypad_button),  act);
+  g_signal_connect (act->keypad, "insert-syntax",
+                   G_CALLBACK (on_keypad_button),  act);
 
-      g_signal_connect (act->keypad, "erase",
-                       G_CALLBACK (erase),  act);
+  g_signal_connect (act->keypad, "erase",
+                   G_CALLBACK (erase),  act);
 
-      g_signal_connect (act->type_and_label, "clicked",
-                       G_CALLBACK (run_type_label_dialog),  pda);
+  g_signal_connect (act->type_and_label, "clicked",
+                   G_CALLBACK (run_type_label_dialog),  pda);
 
-      psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
-      psppire_dialog_action_set_refresh (pda, refresh);
-    }
+  psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
+  psppire_dialog_action_set_refresh (pda, refresh);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_compute_class_init (PsppireDialogActionComputeClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_compute_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_compute_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 676f13e6aaed6a29638d89bf3a5c6516b9144fe7..30c3b05bc771aa134b217ca7826c9f7f97ef8139 100644 (file)
@@ -91,19 +91,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->two_tailed), TRUE);
 }
 
-static void
-psppire_dialog_action_correlation_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_correlation_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionCorrelation *act = PSPPIRE_DIALOG_ACTION_CORRELATION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("correlation.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "correlation.ui");
 
   pda->dialog = get_widget_assert (xml, "correlation-dialog");
   pda->source = get_widget_assert (xml, "dict-view");
@@ -115,12 +109,13 @@ psppire_dialog_action_correlation_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_correlation_class_init (PsppireDialogActionCorrelationClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_correlation_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_correlation_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 8f9a9281efdc3d56c7db679cc6745636b293ce9a..0f5fc87fbef64eeb63d7b34ea91759fd939ff418 100644 (file)
@@ -144,19 +144,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_list_store_clear (GTK_LIST_STORE (cnt->value_list));
 }
 
-static void
-psppire_dialog_action_count_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_count_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionCount *act = PSPPIRE_DIALOG_ACTION_COUNT (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("count.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "count.ui");
 
   GtkWidget *selector = get_widget_assert (xml, "count-selector1");
   GtkWidget *button = get_widget_assert (xml, "button1");
@@ -178,12 +172,13 @@ psppire_dialog_action_count_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_count_class_init (PsppireDialogActionCountClass *class)
 {
-  psppire_dialog_action_set_activation (class,psppire_dialog_action_count_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_count_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 8c1891d918cc72ba07e1efac05123c2a636529a4..79baec16dc7cc4e2bfee5e0a9e92f787711fe895 100644 (file)
@@ -202,70 +202,65 @@ on_statistics_clicked (PsppireDialogActionCrosstabs *cd)
 }
 
 
-static void
-psppire_dialog_action_crosstabs_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_crosstabs_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionCrosstabs *act = PSPPIRE_DIALOG_ACTION_CROSSTABS (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("crosstabs.ui");
-      g_hash_table_insert (thing, a, xml);
+  GtkBuilder *xml = builder_new ( "crosstabs.ui");
 
-      pda->dialog = get_widget_assert   (xml, "crosstabs-dialog");
-      pda->source = get_widget_assert   (xml, "dict-treeview");
+  pda->dialog = get_widget_assert   (xml, "crosstabs-dialog");
+  pda->source = get_widget_assert   (xml, "dict-treeview");
 
-      act->dest_rows =   get_widget_assert   (xml, "rows");
-      act->dest_cols =   get_widget_assert   (xml, "cols");
-      act->format_button = get_widget_assert (xml, "format-button");
-      act->stat_button = get_widget_assert (xml, "stats-button");
-      act->cell_button = get_widget_assert (xml, "cell-button");
-      act->stat_view =   get_widget_assert (xml, "stats-view");
-      act->cell_view =   get_widget_assert (xml, "cell-view");
-      act->cell_dialog = get_widget_assert (xml, "cell-dialog");
-      act->stat_dialog = get_widget_assert (xml, "stat-dialog");
-      act->format_dialog = get_widget_assert (xml, "format-dialog");
+  act->dest_rows =   get_widget_assert   (xml, "rows");
+  act->dest_cols =   get_widget_assert   (xml, "cols");
+  act->format_button = get_widget_assert (xml, "format-button");
+  act->stat_button = get_widget_assert (xml, "stats-button");
+  act->cell_button = get_widget_assert (xml, "cell-button");
+  act->stat_view =   get_widget_assert (xml, "stats-view");
+  act->cell_view =   get_widget_assert (xml, "cell-view");
+  act->cell_dialog = get_widget_assert (xml, "cell-dialog");
+  act->stat_dialog = get_widget_assert (xml, "stat-dialog");
+  act->format_dialog = get_widget_assert (xml, "format-dialog");
 
-      act->avalue_button = get_widget_assert (xml, "ascending");
-      act->table_button = get_widget_assert (xml, "print-tables");
-      act->pivot_button = get_widget_assert (xml, "pivot");
+  act->avalue_button = get_widget_assert (xml, "ascending");
+  act->table_button = get_widget_assert (xml, "print-tables");
+  act->pivot_button = get_widget_assert (xml, "pivot");
 
-      act->format_options_avalue = TRUE;
-      act->format_options_table = TRUE;
-      act->format_options_pivot = TRUE;
+  act->format_options_avalue = TRUE;
+  act->format_options_table = TRUE;
+  act->format_options_pivot = TRUE;
 
-      psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->cell_view),
-                                         B_CS_CELL_DEFAULT,
-                                         N_CROSSTABS_CELLS,
-                                         cells);
+  psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->cell_view),
+                                     B_CS_CELL_DEFAULT,
+                                     N_CROSSTABS_CELLS,
+                                     cells);
 
-      act->cell = gtk_tree_view_get_model (GTK_TREE_VIEW (act->cell_view));
+  act->cell = gtk_tree_view_get_model (GTK_TREE_VIEW (act->cell_view));
 
-      psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->stat_view),
-                                         B_CS_STATS_DEFAULT,
-                                         N_CROSSTABS_STATS,
-                                         stats);
+  psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->stat_view),
+                                     B_CS_STATS_DEFAULT,
+                                     N_CROSSTABS_STATS,
+                                     stats);
 
-      act->stat = gtk_tree_view_get_model (GTK_TREE_VIEW (act->stat_view));
+  act->stat = gtk_tree_view_get_model (GTK_TREE_VIEW (act->stat_view));
 
-      psppire_dialog_action_set_refresh (pda, refresh);
+  psppire_dialog_action_set_refresh (pda, refresh);
 
-      psppire_dialog_action_set_valid_predicate (pda,
-                                                dialog_state_valid);
+  psppire_dialog_action_set_valid_predicate (pda,
+                                            dialog_state_valid);
 
-      g_signal_connect_swapped (act->cell_button, "clicked",
-                               G_CALLBACK (on_cell_clicked), act);
+  g_signal_connect_swapped (act->cell_button, "clicked",
+                           G_CALLBACK (on_cell_clicked), act);
 
-      g_signal_connect_swapped (act->stat_button, "clicked",
-                               G_CALLBACK (on_statistics_clicked), act);
+  g_signal_connect_swapped (act->stat_button, "clicked",
+                           G_CALLBACK (on_statistics_clicked), act);
 
-      g_signal_connect_swapped (act->format_button, "clicked",
-                               G_CALLBACK (on_format_clicked), act);
+  g_signal_connect_swapped (act->format_button, "clicked",
+                           G_CALLBACK (on_format_clicked), act);
 
-    }
+  return xml;
 }
 
 
@@ -378,7 +373,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_crosstabs_class_init (PsppireDialogActionCrosstabsClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_crosstabs_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_crosstabs_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
@@ -387,4 +382,3 @@ static void
 psppire_dialog_action_crosstabs_init (PsppireDialogActionCrosstabs *act)
 {
 }
-
index 1acaaaecc68c09ccbf0ee7a0db6125a6da7a5015..5d2f4b7c5cd75537bba902f5ba2949fe4c8d726c 100644 (file)
@@ -193,26 +193,20 @@ dialog_refresh (PsppireDialogAction *scd_)
 }
 
 
-static void
-psppire_dialog_action_descriptives_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_descriptives_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionDescriptives *act = PSPPIRE_DIALOG_ACTION_DESCRIPTIVES (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("descriptives.ui");
-      g_hash_table_insert (thing, a, xml);
-
-      GtkWidget *stats_treeview = get_widget_assert (xml, "statistics");
-      psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (stats_treeview),
-                                         B_DS_DEFAULT,
-                                         N_DESCRIPTIVE_STATS, stats);
-      act->stats = gtk_tree_view_get_model (GTK_TREE_VIEW (stats_treeview));
-    }
+  GtkBuilder *xml = builder_new ( "descriptives.ui");
 
+  GtkWidget *stats_treeview = get_widget_assert (xml, "statistics");
+  psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (stats_treeview),
+                                     B_DS_DEFAULT,
+                                     N_DESCRIPTIVE_STATS, stats);
+  act->stats = gtk_tree_view_get_model (GTK_TREE_VIEW (stats_treeview));
+  
   pda->dialog = get_widget_assert   (xml, "descriptives-dialog");
   pda->source = get_widget_assert   (xml, "all-variables");
   act->variables =   get_widget_assert   (xml, "stat-variables");
@@ -231,12 +225,14 @@ psppire_dialog_action_descriptives_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
+
+  return xml;
 }
 
 static void
 psppire_dialog_action_descriptives_class_init (PsppireDialogActionDescriptivesClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_descriptives_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_descriptives_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 0bce847e243ca684f0e6aa5813db3540e3f998fa..2bafe67952e065a94bba665f1b01f329df9c974c 100644 (file)
@@ -197,29 +197,23 @@ dialog_refresh (PsppireDialogAction *da)
   dae->opts = OPT_LISTWISE;
 }
 
-static void
-psppire_dialog_action_examine_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_examine_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionExamine *act = PSPPIRE_DIALOG_ACTION_EXAMINE (a);
 
-  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");
-
-      g_signal_connect_swapped (stats_button, "clicked",
-                               G_CALLBACK (run_stats_dialog), act);
-
-      g_signal_connect_swapped (opts_button, "clicked",
-                               G_CALLBACK (run_opts_dialog), act);
-    }
-
+  GtkBuilder *xml = builder_new ("examine.ui");
+
+  GtkWidget *stats_button = get_widget_assert (xml, "stats-button");
+  GtkWidget *opts_button = get_widget_assert (xml, "opts-button");
+  
+  g_signal_connect_swapped (stats_button, "clicked",
+                           G_CALLBACK (run_stats_dialog), act);
+  
+  g_signal_connect_swapped (opts_button, "clicked",
+                           G_CALLBACK (run_opts_dialog), act);
+  
   GtkWidget *dep_sel = get_widget_assert (xml, "psppire-selector1");
   GtkWidget *dep_sel2 = get_widget_assert (xml, "psppire-selector2");
   GtkWidget *dep_sel3 = get_widget_assert (xml, "psppire-selector3");
@@ -259,13 +253,13 @@ psppire_dialog_action_examine_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_examine_class_init (PsppireDialogActionExamineClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_examine_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_examine_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 1debfc674a3cd260725d28b183157fc28c58f711..4c5d927e287cbb57eb2c210ceb47b47d7c6525b7 100644 (file)
@@ -293,89 +293,82 @@ run_rotations_subdialog (PsppireDialogActionFactor *act)
     }
 }
 
-static void
-psppire_dialog_action_factor_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_factor_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionFactor *act = PSPPIRE_DIALOG_ACTION_FACTOR (a);
   GtkWidget *extraction_button ;
   GtkWidget *rotation_button ;
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("factor.ui");
-      g_hash_table_insert (thing, a, xml);
-
-
-      pda->dialog = get_widget_assert   (xml, "factor-dialog");
-      pda->source = get_widget_assert   (xml, "dict-view");
+  GtkBuilder *xml = builder_new ( "factor.ui");
 
-      extraction_button = get_widget_assert (xml, "button-extractions");
-      rotation_button = get_widget_assert (xml, "button-rotations");
+  pda->dialog = get_widget_assert   (xml, "factor-dialog");
+  pda->source = get_widget_assert   (xml, "dict-view");
 
-      act->extraction_dialog = get_widget_assert (xml, "extractions-dialog");
-      act->rotation_dialog = get_widget_assert (xml, "rotations-dialog");
+  extraction_button = get_widget_assert (xml, "button-extractions");
+  rotation_button = get_widget_assert (xml, "button-rotations");
 
-      act->variables = get_widget_assert   (xml, "psppire-var-view1");
+  act->extraction_dialog = get_widget_assert (xml, "extractions-dialog");
+  act->rotation_dialog = get_widget_assert (xml, "rotations-dialog");
 
-      {
-       GtkWidget *hbox = get_widget_assert (xml, "hbox6");
-       GtkWidget *eigenvalue_extraction ;
+  act->variables = get_widget_assert   (xml, "psppire-var-view1");
 
-       act->mineigen_toggle = get_widget_assert (xml, "mineigen-radiobutton");
+  {
+    GtkWidget *hbox = get_widget_assert (xml, "hbox6");
+    GtkWidget *eigenvalue_extraction ;
 
-       eigenvalue_extraction = psppire_scanf_new (_("_Eigenvalues over %4.2f times the mean eigenvalue"), &act->mineigen);
+    act->mineigen_toggle = get_widget_assert (xml, "mineigen-radiobutton");
 
-       g_object_set (eigenvalue_extraction,
-                     "use-underline", TRUE,
-                     "mnemonic-widget", act->mineigen_toggle,
-                     NULL);
+    eigenvalue_extraction = psppire_scanf_new (_("_Eigenvalues over %4.2f times the mean eigenvalue"), &act->mineigen);
 
-       act->nfactors_toggle = get_widget_assert (xml, "nfactors-radiobutton");
-       act->n_factors = get_widget_assert (xml, "spinbutton-nfactors");
-       act->extract_iterations = get_widget_assert (xml, "spinbutton-extract-iterations");
-       act->covariance_toggle = get_widget_assert (xml,  "covariance-radiobutton");
-       act->correlation_toggle = get_widget_assert (xml, "correlations-radiobutton");
+    g_object_set (eigenvalue_extraction,
+                 "use-underline", TRUE,
+                 "mnemonic-widget", act->mineigen_toggle,
+                 NULL);
 
-       act->scree_button = get_widget_assert (xml, "scree-button");
-       act->unrotated_button = get_widget_assert (xml, "unrotated-button");
-       act->extraction_combo = get_widget_assert (xml, "combobox1");
+    act->nfactors_toggle = get_widget_assert (xml, "nfactors-radiobutton");
+    act->n_factors = get_widget_assert (xml, "spinbutton-nfactors");
+    act->extract_iterations = get_widget_assert (xml, "spinbutton-extract-iterations");
+    act->covariance_toggle = get_widget_assert (xml,  "covariance-radiobutton");
+    act->correlation_toggle = get_widget_assert (xml, "correlations-radiobutton");
 
-       gtk_container_add (GTK_CONTAINER (hbox), eigenvalue_extraction);
+    act->scree_button = get_widget_assert (xml, "scree-button");
+    act->unrotated_button = get_widget_assert (xml, "unrotated-button");
+    act->extraction_combo = get_widget_assert (xml, "combobox1");
 
-       g_signal_connect (act->nfactors_toggle, "toggled", G_CALLBACK (on_extract_toggle), act);
+    gtk_container_add (GTK_CONTAINER (hbox), eigenvalue_extraction);
 
-       gtk_widget_show_all (eigenvalue_extraction);
-      }
+    g_signal_connect (act->nfactors_toggle, "toggled", G_CALLBACK (on_extract_toggle), act);
 
-      {
-       act->rotate_iterations = get_widget_assert (xml, "spinbutton-rot-iterations");
+    gtk_widget_show_all (eigenvalue_extraction);
+  }
 
-       act->display_rotated_solution = get_widget_assert (xml, "checkbutton-rotated-solution");
+  {
+    act->rotate_iterations = get_widget_assert (xml, "spinbutton-rot-iterations");
 
-       act->rotation_none      = get_widget_assert (xml, "radiobutton-none");
-       act->rotation_varimax   = get_widget_assert (xml, "radiobutton-varimax");
-       act->rotation_quartimax = get_widget_assert (xml, "radiobutton-quartimax");
-       act->rotation_equimax   = get_widget_assert (xml, "radiobutton-equimax");
-      }
+    act->display_rotated_solution = get_widget_assert (xml, "checkbutton-rotated-solution");
 
-      g_signal_connect_swapped (extraction_button, "clicked",
-                               G_CALLBACK (run_extractions_subdialog), act);
-      g_signal_connect_swapped (rotation_button, "clicked", G_CALLBACK (run_rotations_subdialog), act);
+    act->rotation_none      = get_widget_assert (xml, "radiobutton-none");
+    act->rotation_varimax   = get_widget_assert (xml, "radiobutton-varimax");
+    act->rotation_quartimax = get_widget_assert (xml, "radiobutton-quartimax");
+    act->rotation_equimax   = get_widget_assert (xml, "radiobutton-equimax");
+  }
 
-    }
+  g_signal_connect_swapped (extraction_button, "clicked",
+                           G_CALLBACK (run_extractions_subdialog), act);
+  g_signal_connect_swapped (rotation_button, "clicked", G_CALLBACK (run_rotations_subdialog), act);
 
   psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_factor_class_init (PsppireDialogActionFactorClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_factor_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_factor_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 1c823eddbed18f1edeba3ca2055eba244748aa5c..99947f773f0d95ea0b3a0e33499a7339cbe23045 100644 (file)
@@ -89,20 +89,14 @@ refresh (PsppireDialogAction *rd_)
   gtk_entry_set_text (GTK_ENTRY (rd->entry), "");
 }
 
-static void
-psppire_dialog_action_flip_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_flip_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionFlip *act = PSPPIRE_DIALOG_ACTION_FLIP (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("transpose.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
-
+  GtkBuilder *xml = builder_new ( "transpose.ui");
+  
   pda->dialog = get_widget_assert   (xml, "transpose-dialog");
   pda->source = get_widget_assert   (xml, "source-treeview");
 
@@ -112,12 +106,13 @@ psppire_dialog_action_flip_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_flip_class_init (PsppireDialogActionFlipClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_flip_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_flip_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 272723c2d7e05ef68bf060c6e020179fc3d4e073..adca915816cd0973edc8599e215aeb6ed6c15058 100644 (file)
@@ -251,103 +251,94 @@ refresh (PsppireDialogAction * fdx)
                         (B_FS_DEFAULT & (1u << i)) ? true : false, -1);
 }
 
-
-
-static void
-psppire_dialog_action_frequencies_activate (PsppireDialogAction * a)
+static GtkBuilder *
+psppire_dialog_action_frequencies_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionFrequencies *act = PSPPIRE_DIALOG_ACTION_FREQUENCIES (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("frequencies.ui");
-      g_hash_table_insert (thing, a, xml);
+  GtkBuilder *xml = builder_new ( "frequencies.ui");
 
-      GtkWidget *stats_treeview = get_widget_assert (xml, "stats-treeview");
+  GtkWidget *stats_treeview = get_widget_assert (xml, "stats-treeview");
 
-      psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (stats_treeview),
-                                         B_FS_DEFAULT, N_FREQUENCY_STATS, stats);
+  psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (stats_treeview),
+                                     B_FS_DEFAULT, N_FREQUENCY_STATS, stats);
 
-      act->stats = gtk_tree_view_get_model (GTK_TREE_VIEW (stats_treeview));
+  act->stats = gtk_tree_view_get_model (GTK_TREE_VIEW (stats_treeview));
 
-      GtkWidget *tables_button = get_widget_assert (xml, "tables-button");
-      GtkWidget *charts_button = get_widget_assert (xml, "charts-button");
+  GtkWidget *tables_button = get_widget_assert (xml, "tables-button");
+  GtkWidget *charts_button = get_widget_assert (xml, "charts-button");
 
-      pda->dialog = get_widget_assert (xml, "frequencies-dialog");
-      pda->source = get_widget_assert (xml, "dict-treeview");
+  pda->dialog = get_widget_assert (xml, "frequencies-dialog");
+  pda->source = get_widget_assert (xml, "dict-treeview");
 
-      act->stat_vars = get_widget_assert (xml, "var-treeview");
+  act->stat_vars = get_widget_assert (xml, "var-treeview");
 
+  act->include_missing = get_widget_assert (xml, "include_missing");
+  act->tables_dialog = get_widget_assert (xml, "tables-dialog");
+  act->charts_dialog = get_widget_assert (xml, "charts-dialog");
+  act->always = get_widget_assert (xml, "always");
+  act->never = get_widget_assert (xml, "never");
+  act->limit = get_widget_assert (xml, "limit");
+  act->limit_spinbutton = get_widget_assert (xml, "limit-spin");
 
-      act->include_missing = get_widget_assert (xml, "include_missing");
+  g_signal_connect (act->limit, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle),
+                   act->limit_spinbutton);
 
+  act->avalue = get_widget_assert (xml, "avalue");
+  act->dvalue = get_widget_assert (xml, "dvalue");
+  act->afreq = get_widget_assert (xml, "afreq");
+  act->dfreq = get_widget_assert (xml, "dfreq");
 
-      act->tables_dialog = get_widget_assert (xml, "tables-dialog");
-      act->charts_dialog = get_widget_assert (xml, "charts-dialog");
-      act->always = get_widget_assert (xml, "always");
-      act->never = get_widget_assert (xml, "never");
-      act->limit = get_widget_assert (xml, "limit");
-      act->limit_spinbutton = get_widget_assert (xml, "limit-spin");
+  act->charts_opts_use_min = false;
+  act->charts_opts_min = 0;
+  act->charts_opts_use_max = false;
+  act->charts_opts_max = 100;
+  act->charts_opts_draw_hist = false;
+  act->charts_opts_draw_normal = false;
+  act->charts_opts_scale = FRQ_FREQ;
+  act->charts_opts_draw_pie = false;
+  act->charts_opts_draw_bar = false;
+  act->charts_opts_pie_include_missing = false;
 
-      g_signal_connect (act->limit, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle),
-                       act->limit_spinbutton);
+  act->freqs = get_widget_assert (xml, "freqs");
+  act->percents = get_widget_assert (xml, "percents");
 
-      act->avalue = get_widget_assert (xml, "avalue");
-      act->dvalue = get_widget_assert (xml, "dvalue");
-      act->afreq = get_widget_assert (xml, "afreq");
-      act->dfreq = get_widget_assert (xml, "dfreq");
+  act->min = get_widget_assert (xml, "min");
+  act->min_spin = get_widget_assert (xml, "min-spin");
+  g_signal_connect (act->min, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle), act->min_spin);
+  act->max = get_widget_assert (xml, "max");
+  act->max_spin = get_widget_assert (xml, "max-spin");
+  g_signal_connect (act->max, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle), act->max_spin);
 
-      act->charts_opts_use_min = false;
-      act->charts_opts_min = 0;
-      act->charts_opts_use_max = false;
-      act->charts_opts_max = 100;
-      act->charts_opts_draw_hist = false;
-      act->charts_opts_draw_normal = false;
-      act->charts_opts_scale = FRQ_FREQ;
-      act->charts_opts_draw_pie = false;
-      act->charts_opts_draw_bar = false;
-      act->charts_opts_pie_include_missing = false;
+  act->hist = get_widget_assert (xml, "hist");
+  act->normal = get_widget_assert (xml, "normal");
+  g_signal_connect (act->hist, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle), act->normal);
 
-      act->freqs = get_widget_assert (xml, "freqs");
-      act->percents = get_widget_assert (xml, "percents");
+  act->pie =  (get_widget_assert (xml, "pie"));
+  act->pie_include_missing = get_widget_assert (xml, "pie-include-missing");
 
-      act->min = get_widget_assert (xml, "min");
-      act->min_spin = get_widget_assert (xml, "min-spin");
-      g_signal_connect (act->min, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle), act->min_spin);
-      act->max = get_widget_assert (xml, "max");
-      act->max_spin = get_widget_assert (xml, "max-spin");
-      g_signal_connect (act->max, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle), act->max_spin);
+  act->bar =  (get_widget_assert (xml, "bar"));
 
-      act->hist = get_widget_assert (xml, "hist");
-      act->normal = get_widget_assert (xml, "normal");
-      g_signal_connect (act->hist, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle), act->normal);
+  act->tables_opts_order = FRQ_AVALUE;
+  act->tables_opts_table = FRQ_TABLE;
+  act->tables_opts_limit = 50;
 
-      act->pie =  (get_widget_assert (xml, "pie"));
-      act->pie_include_missing = get_widget_assert (xml, "pie-include-missing");
+  g_signal_connect_swapped (tables_button, "clicked",
+                           G_CALLBACK (on_tables_clicked),  act);
 
-      act->bar =  (get_widget_assert (xml, "bar"));
+  g_signal_connect_swapped (charts_button, "clicked",
+                           G_CALLBACK (on_charts_clicked),  act);
 
-      act->tables_opts_order = FRQ_AVALUE;
-      act->tables_opts_table = FRQ_TABLE;
-      act->tables_opts_limit = 50;
+  psppire_dialog_action_set_refresh (pda, refresh);
 
-      g_signal_connect_swapped (tables_button, "clicked",
-                               G_CALLBACK (on_tables_clicked),  act);
+  psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
 
-      g_signal_connect_swapped (charts_button, "clicked",
-                               G_CALLBACK (on_charts_clicked),  act);
-
-      psppire_dialog_action_set_refresh (pda, refresh);
-
-      psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
-    }
+  return xml;
 }
 
 static char *
@@ -497,12 +488,12 @@ generate_syntax (const PsppireDialogAction * a)
 static void
 psppire_dialog_action_frequencies_class_init (PsppireDialogActionFrequenciesClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_frequencies_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_frequencies_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
 
 static void
-psppire_dialog_action_frequencies_init (PsppireDialogActionFrequencies * act)
+psppire_dialog_action_frequencies_init (PsppireDialogActionFrequencies *act)
 {
 }
index bd0c8ea1f9612ebf807b34c47f82032a4bc4b3a3..3949886c92fe076b3396695be8bc74b5a3d248df 100644 (file)
@@ -58,19 +58,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_entry_set_text (GTK_ENTRY (rd->variable), "");
 }
 
-static void
-psppire_dialog_action_histogram_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_histogram_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionHistogram *act = PSPPIRE_DIALOG_ACTION_HISTOGRAM (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("histogram.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "histogram.ui");
 
   pda->dialog = get_widget_assert (xml, "histogram-dialog");
   pda->source = get_widget_assert (xml, "dict-view");
@@ -83,6 +77,7 @@ psppire_dialog_action_histogram_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_valid_predicate (pda,
                                        dialog_state_valid);
 
+  return xml;
 }
 
 
@@ -115,7 +110,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_histogram_class_init (PsppireDialogActionHistogramClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_histogram_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_histogram_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index b13c444c5b9713967eb42eec1b9fd2752d9b335d..7a2511ad6ea7f91780c4245a8bf9c945e48049c8 100644 (file)
@@ -293,19 +293,13 @@ set_group_criterion_type (GtkToggleButton *button,
 }
 
 
-static void
-psppire_dialog_action_indep_samps_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_indep_samps_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionIndepSamps *act = PSPPIRE_DIALOG_ACTION_INDEP_SAMPS (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("indep-samples.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "indep-samples.ui");
 
   pda->dialog = get_widget_assert (xml,"independent-samples-dialog");
   pda->source = get_widget_assert (xml, "indep-samples-treeview1");
@@ -353,6 +347,8 @@ psppire_dialog_action_indep_samps_activate (PsppireDialogAction *a)
                    G_CALLBACK (on_grp_var_change), act);
 
   on_grp_var_change (GTK_ENTRY (act->group_var_entry), act);
+
+  return xml;
 }
 
 
@@ -423,7 +419,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_indep_samps_class_init (PsppireDialogActionIndepSampsClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_indep_samps_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_indep_samps_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index ba2934a55df2e384a3186e712b262d1c404e9e2e..9027fdd0a4f8b71294b519cc17b2608176257d68 100644 (file)
@@ -169,51 +169,47 @@ set_value_entry_variable (PsppireDialogActionKIndependent *kid, GtkEntry *entry)
 }
 
 
-static void
-psppire_dialog_action_k_independent_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_k_independent_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionKIndependent *kid = PSPPIRE_DIALOG_ACTION_K_INDEPENDENT (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("k-independent.ui");
-      g_hash_table_insert (thing, a, xml);
+  GtkBuilder *xml = builder_new ( "k-independent.ui");
 
-      pda->dialog = get_widget_assert   (xml, "k-independent-dialog");
-      pda->source = get_widget_assert   (xml, "k-independent-treeview1");
+  pda->dialog = get_widget_assert   (xml, "k-independent-dialog");
+  pda->source = get_widget_assert   (xml, "k-independent-treeview1");
 
-      kid->vars_treeview =  get_widget_assert (xml, "k-independent-treeview2");
-      kid->groupvar_entry = get_widget_assert (xml, "k-independent-entry");
+  kid->vars_treeview =  get_widget_assert (xml, "k-independent-treeview2");
+  kid->groupvar_entry = get_widget_assert (xml, "k-independent-entry");
 
-      kid->subdialog = get_widget_assert (xml, "define-groups-dialog");
+  kid->subdialog = get_widget_assert (xml, "define-groups-dialog");
 
-      kid->lower_limit_entry = get_widget_assert (xml, "lower-limit-entry");
-      kid->upper_limit_entry = get_widget_assert (xml, "upper-limit-entry");
+  kid->lower_limit_entry = get_widget_assert (xml, "lower-limit-entry");
+  kid->upper_limit_entry = get_widget_assert (xml, "upper-limit-entry");
 
-      kid->checkbutton[KID_KRUSKAL_WALLIS] = get_widget_assert (xml,
-                                                               "kruskal-wallis");
+  kid->checkbutton[KID_KRUSKAL_WALLIS] = get_widget_assert (xml,
+                                                           "kruskal-wallis");
 
-      kid->checkbutton[KID_MEDIAN] = get_widget_assert (xml, "median");
+  kid->checkbutton[KID_MEDIAN] = get_widget_assert (xml, "median");
 
-      g_signal_connect_swapped (get_widget_assert (xml, "define-groups-button"),
-                               "clicked",
-                               G_CALLBACK (run_define_groups_dialog), kid);
+  g_signal_connect_swapped (get_widget_assert (xml, "define-groups-button"),
+                           "clicked",
+                           G_CALLBACK (run_define_groups_dialog), kid);
 
-      g_signal_connect_swapped (kid->groupvar_entry, "changed",
-                               G_CALLBACK (set_value_entry_variable), kid);
-    }
+  g_signal_connect_swapped (kid->groupvar_entry, "changed",
+                           G_CALLBACK (set_value_entry_variable), kid);
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
+
+  return xml;
 }
 
 static void
 psppire_dialog_action_k_independent_class_init (PsppireDialogActionKIndependentClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_k_independent_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_k_independent_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 87c34c1665f2fe3d659964384f2b36ad4a542a57..8c088f81ebbcb451789b99606c19d0ec24727f18 100644 (file)
@@ -104,19 +104,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (krd->cochran), FALSE);
 }
 
-static void
-psppire_dialog_action_k_related_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_k_related_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionKRelated *act = PSPPIRE_DIALOG_ACTION_K_RELATED (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("k-related.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "k-related.ui");
 
   pda->dialog = get_widget_assert   (xml, "k-related-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -133,12 +127,13 @@ psppire_dialog_action_k_related_activate (PsppireDialogAction *a)
                "predicate", var_is_numeric,
                NULL);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_k_related_class_init (PsppireDialogActionKRelatedClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_k_related_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_k_related_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index b25ecd475ab1a258271777c0b92a09312e173b80..24f9c60479aaaf3ccfc82664ff2dd5d8e3ce6a7c 100644 (file)
@@ -52,8 +52,6 @@ generate_syntax (const PsppireDialogAction *act)
   return text;
 }
 
-
-
 static gboolean
 dialog_state_valid (gpointer user_data)
 {
@@ -81,19 +79,13 @@ refresh (PsppireDialogAction *fd_)
   gtk_entry_set_text (GTK_ENTRY (fd->entry), "");
 }
 
-static void
-psppire_dialog_action_kmeans_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_kmeans_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionKmeans *act = PSPPIRE_DIALOG_ACTION_KMEANS (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("k-means.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "k-means.ui");
 
   pda->dialog = get_widget_assert   (xml, "k-means-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -104,12 +96,13 @@ psppire_dialog_action_kmeans_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_refresh (pda, refresh);
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_kmeans_class_init (PsppireDialogActionKmeansClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_kmeans_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_kmeans_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index e4887352ca9a19e20a73e899e9d34cdba832029e..de3e4793baf36125c088a75cb675c7d8fe47c318 100644 (file)
@@ -95,20 +95,14 @@ on_opts_clicked (PsppireDialogActionLogistic *act)
 }
 
 
-static void
-psppire_dialog_action_logistic_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_logistic_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionLogistic *act = PSPPIRE_DIALOG_ACTION_LOGISTIC (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   GtkWidget *opts_button;
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("logistic.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "logistic.ui");
 
   pda->dialog = get_widget_assert   (xml, "logistic-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -145,6 +139,7 @@ psppire_dialog_action_logistic_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_valid_predicate (pda,
                                        dialog_state_valid);
 
+  return xml;
 }
 
 
@@ -226,7 +221,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_logistic_class_init (PsppireDialogActionLogisticClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_logistic_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_logistic_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index ee45e84854e7ceee4da630a5b7054c3221e84f51..5b5a72f54a32f1a2dad2a90499e38b04d07ea760 100644 (file)
@@ -91,25 +91,19 @@ dialog_refresh (PsppireDialogAction *da)
   psppire_means_layer_clear (PSPPIRE_MEANS_LAYER (pdm->layer));
 }
 
-static void
-psppire_dialog_action_means_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_means_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionMeans *act = PSPPIRE_DIALOG_ACTION_MEANS (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("means.ui");
-      g_hash_table_insert (thing, a, xml);
-
-      GtkWidget *vb =   get_widget_assert (xml, "frame2");
-      act->layer = psppire_means_layer_new ();
-      gtk_container_add (GTK_CONTAINER (vb), act->layer);
-      gtk_widget_show (act->layer);
-    }
+  GtkBuilder *xml = builder_new ( "means.ui");
 
+  GtkWidget *vb =   get_widget_assert (xml, "frame2");
+  act->layer = psppire_means_layer_new ();
+  gtk_container_add (GTK_CONTAINER (vb), act->layer);
+  gtk_widget_show (act->layer);
+  
   GtkWidget *selector = get_widget_assert (xml, "layer-selector");
 
   pda->dialog = get_widget_assert (xml, "means-dialog");
@@ -126,13 +120,13 @@ psppire_dialog_action_means_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_means_class_init (PsppireDialogActionMeansClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_means_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_means_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 81a632d9eaff6cea65f1143e8d931798db15b590..77512977a9049f230bd393be8d108bb99da4566d 100644 (file)
@@ -218,21 +218,13 @@ clone_contrasts_array (GArray *src_array)
 }
 
 
-
-
-static void
-psppire_dialog_action_oneway_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_oneway_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionOneway *act = PSPPIRE_DIALOG_ACTION_ONEWAY (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("oneway.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "oneway.ui");
 
   GtkWidget *contrasts_button =
     get_widget_assert (xml, "contrasts-button");
@@ -272,13 +264,13 @@ psppire_dialog_action_oneway_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_oneway_class_init (PsppireDialogActionOnewayClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_oneway_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_oneway_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index e0102b1405f7ca5ebbadc06a137fcc81c4f9d57f..8f3394fa7001198ec1f3e1ea725a857ec1ed33e0 100644 (file)
@@ -149,54 +149,48 @@ generate_syntax (const PsppireDialogAction *pda)
   return text;
 }
 
-static void
-psppire_dialog_action_paired_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_paired_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionPaired *act = PSPPIRE_DIALOG_ACTION_PAIRED (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("paired-samples.ui");
-      g_hash_table_insert (thing, a, xml);
-
-      GtkWidget *selector = get_widget_assert (xml, "psppire-selector3");
-      GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
-      GtkWidget *button = gtk_button_new_with_mnemonic (_("O_ptions..."));
-      GtkWidget *box = get_widget_assert (xml, "dynamic-populate");
+  GtkBuilder *xml = builder_new ( "paired-samples.ui");
+  
+  GtkWidget *selector = get_widget_assert (xml, "psppire-selector3");
+  GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+  GtkWidget *button = gtk_button_new_with_mnemonic (_("O_ptions..."));
+  GtkWidget *box = get_widget_assert (xml, "dynamic-populate");
 
-      pda->dialog = get_widget_assert   (xml, "t-test-paired-samples-dialog");
-      pda->source = get_widget_assert   (xml, "paired-samples-t-test-treeview1");
+  pda->dialog = get_widget_assert   (xml, "t-test-paired-samples-dialog");
+  pda->source = get_widget_assert   (xml, "paired-samples-t-test-treeview1");
 
-      gtk_window_set_title (GTK_WINDOW (pda->dialog), _("Paired Samples T Test"));
+  gtk_window_set_title (GTK_WINDOW (pda->dialog), _("Paired Samples T Test"));
 
-      act->pairs_treeview = get_widget_assert (xml, "paired-samples-t-test-treeview2");
-      act->list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (act->pairs_treeview)));
+  act->pairs_treeview = get_widget_assert (xml, "paired-samples-t-test-treeview2");
+  act->list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (act->pairs_treeview)));
 
-      act->opt = tt_options_dialog_create (GTK_WINDOW (pda->toplevel));
+  act->opt = tt_options_dialog_create (GTK_WINDOW (pda->toplevel));
 
-      g_signal_connect_swapped (button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opt);
+  g_signal_connect_swapped (button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opt);
 
 
-      gtk_box_pack_start (GTK_BOX (bb), button, TRUE, TRUE, 5);
-      gtk_box_pack_start (GTK_BOX (box), bb, FALSE, FALSE, 5);
-      gtk_widget_show_all (box);
+  gtk_box_pack_start (GTK_BOX (bb), button, TRUE, TRUE, 5);
+  gtk_box_pack_start (GTK_BOX (box), bb, FALSE, FALSE, 5);
+  gtk_widget_show_all (box);
 
 
-      psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
-      psppire_dialog_action_set_refresh (pda, refresh);
+  psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
+  psppire_dialog_action_set_refresh (pda, refresh);
 
-      g_object_set (pda->source,
-                   "predicate", var_is_numeric,
-                   NULL);
-
-      psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
-                                       select_as_pair_member,
-                                       act);
-    }
+  g_object_set (pda->source,
+               "predicate", var_is_numeric,
+               NULL);
 
+  psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
+                                   select_as_pair_member,
+                                   act);
+  return xml;
 }
 
 static void
@@ -210,7 +204,7 @@ static void
 psppire_dialog_action_paired_class_init (PsppireDialogActionPairedClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_paired_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_paired_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 
   object_class->finalize = psppire_dialog_action_paired_finalize;
index 16adb9f707b2ffeb390eb98b9ef8538776a2eada..8b9a5bb5c9ccbb889c75768f3d9e6d4d4197b748 100644 (file)
@@ -206,20 +206,13 @@ set_sensitivity (PsppireDialogActionRank *dar)
   gtk_widget_set_sensitive (dar->formula_box, sens);
 }
 
-static void
-psppire_dialog_action_rank_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_rank_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionRank *act = PSPPIRE_DIALOG_ACTION_RANK (a);
 
-  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);
-    }
-
+  GtkBuilder *xml = builder_new ( "rank.ui");
   GtkWidget *types_button = get_widget_assert (xml, "button1");
   GtkWidget *ties_button = get_widget_assert (xml, "button2");
 
@@ -298,12 +291,13 @@ psppire_dialog_action_rank_activate (PsppireDialogAction *a)
   psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, dialog_refresh);
 
+  return xml;
 }
 
 static void
 psppire_dialog_action_rank_class_init (PsppireDialogActionRankClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_rank_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_rank_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 9a41596d3bb3830c48a7b79e4c1c961a4adaf8fa..251e5999e03b0079dfef7fdfaa082d06abcfca75 100644 (file)
@@ -312,13 +312,14 @@ populate_treeview (PsppireDialogActionRecode *act)
 }
 
 
-static void
-psppire_dialog_action_recode_different_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_recode_different_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionRecode *act = PSPPIRE_DIALOG_ACTION_RECODE (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  psppire_dialog_action_recode_pre_activate (act, populate_treeview);
+  GtkBuilder *xml = psppire_dialog_action_recode_pre_activate (act,
+                                                              populate_treeview);
 
   gtk_window_set_title (GTK_WINDOW (pda->dialog),
                        _("Recode into Different Variables"));
@@ -335,6 +336,7 @@ psppire_dialog_action_recode_different_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda,
                                             dialog_state_valid);
+  return xml;
 }
 
 static void
@@ -431,7 +433,7 @@ target_is_string (const PsppireDialogActionRecode *rd)
 static void
 psppire_dialog_action_recode_different_class_init (PsppireDialogActionRecodeDifferentClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_recode_different_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_recode_different_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = diff_generate_syntax;
   PSPPIRE_DIALOG_ACTION_RECODE_CLASS (class)->target_is_string = target_is_string;
index f0e31c795e23809e24f04a70b0a15c210dc9da49..af10448b1bfc5a60597129ed843219fee8089d3f 100644 (file)
@@ -96,13 +96,13 @@ on_old_new_show (PsppireDialogActionRecode *rd)
   gtk_widget_hide (rd->strings_box);
 }
 
-static void
-psppire_dialog_action_recode_same_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_recode_same_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionRecode *act = PSPPIRE_DIALOG_ACTION_RECODE (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  psppire_dialog_action_recode_pre_activate (act, NULL);
+  GtkBuilder *xml = psppire_dialog_action_recode_pre_activate (act, NULL);
 
   gtk_window_set_title (GTK_WINDOW (pda->dialog),
                        _("Recode into Same Variables"));
@@ -119,6 +119,8 @@ psppire_dialog_action_recode_same_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda,
                                        dialog_state_valid);
+
+  return xml;
 }
 
 static void
@@ -142,7 +144,7 @@ target_is_string (const PsppireDialogActionRecode *rd)
 static void
 psppire_dialog_action_recode_same_class_init (PsppireDialogActionRecodeSameClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_recode_same_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_recode_same_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = same_generate_syntax;
   PSPPIRE_DIALOG_ACTION_RECODE_CLASS (class)->target_is_string = target_is_string;
index 7abe51df64c6f3e01a1150b745924046b648b41d..221e90f2301cfe4a6a4a6fbbbef9b89f1f3eb927 100644 (file)
@@ -440,123 +440,119 @@ psppire_dialog_action_recode_refresh (PsppireDialogAction *rd_)
 }
 
 
-void
-psppire_dialog_action_recode_pre_activate (PsppireDialogActionRecode *act, void (*populate_treeview) (PsppireDialogActionRecode *))
+GtkBuilder *
+psppire_dialog_action_recode_pre_activate (PsppireDialogActionRecode *act,
+                                          void (*populate_treeview) (PsppireDialogActionRecode *))
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (act);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, act);
-  if (!xml)
-    {
-      xml = builder_new ("recode.ui");
-      g_hash_table_insert (thing, act, xml);
-
-      pda->dialog = get_widget_assert   (xml, "recode-dialog");
-      pda->source = get_widget_assert   (xml, "treeview1");
+  GtkBuilder *xml = builder_new ("recode.ui");
+  
+  pda->dialog = get_widget_assert   (xml, "recode-dialog");
+  pda->source = get_widget_assert   (xml, "treeview1");
 
 
-      GtkWidget *selector = get_widget_assert (xml, "psppire-selector1");
-      GtkWidget *oldandnew = get_widget_assert (xml, "button1");
+  GtkWidget *selector = get_widget_assert (xml, "psppire-selector1");
+  GtkWidget *oldandnew = get_widget_assert (xml, "button1");
 
 
-      act->output_variable_box = get_widget_assert (xml,"frame4");
+  act->output_variable_box = get_widget_assert (xml,"frame4");
 
-      act->change_button = get_widget_assert (xml, "change-button");
-      act->variable_treeview =   get_widget_assert (xml, "treeview2");
-      act->new_name_entry = get_widget_assert (xml, "dest-name-entry");
-      act->new_label_entry = get_widget_assert (xml, "dest-label-entry");
+  act->change_button = get_widget_assert (xml, "change-button");
+  act->variable_treeview =   get_widget_assert (xml, "treeview2");
+  act->new_name_entry = get_widget_assert (xml, "dest-name-entry");
+  act->new_label_entry = get_widget_assert (xml, "dest-label-entry");
 
-      act->value_map = gtk_list_store_new (2,
-                                          old_value_get_type (),
-                                          new_value_get_type ());
+  act->value_map = gtk_list_store_new (2,
+                                      old_value_get_type (),
+                                      new_value_get_type ());
 
-      if (populate_treeview)
-       populate_treeview (act);
+  if (populate_treeview)
+    populate_treeview (act);
 
-      psppire_selector_set_allow (PSPPIRE_SELECTOR (selector), homogeneous_types);
+  psppire_selector_set_allow (PSPPIRE_SELECTOR (selector), homogeneous_types);
 
-      /* Set up the Old & New Values subdialog */
-      {
-       act->string_button = get_widget_assert (xml, "checkbutton1");
-       act->width_entry   = get_widget_assert (xml, "spinbutton1");
+  /* Set up the Old & New Values subdialog */
+  {
+    act->string_button = get_widget_assert (xml, "checkbutton1");
+    act->width_entry   = get_widget_assert (xml, "spinbutton1");
 
-       act->convert_button = get_widget_assert (xml, "checkbutton2");
+    act->convert_button = get_widget_assert (xml, "checkbutton2");
 
-       act->old_value_chooser = get_widget_assert (xml, "val-chooser");
+    act->old_value_chooser = get_widget_assert (xml, "val-chooser");
 
-       act->new_value_entry = get_widget_assert (xml, "entry1");
+    act->new_value_entry = get_widget_assert (xml, "entry1");
 
 
-       act->toggle[BUTTON_NEW_VALUE]  = get_widget_assert (xml, "radiobutton1");
-       act->toggle[BUTTON_NEW_SYSMIS] = get_widget_assert (xml, "radiobutton2");
-       act->toggle[BUTTON_NEW_COPY]   = get_widget_assert (xml, "radiobutton3");
+    act->toggle[BUTTON_NEW_VALUE]  = get_widget_assert (xml, "radiobutton1");
+    act->toggle[BUTTON_NEW_SYSMIS] = get_widget_assert (xml, "radiobutton2");
+    act->toggle[BUTTON_NEW_COPY]   = get_widget_assert (xml, "radiobutton3");
 
-       act->new_copy_label = get_widget_assert (xml, "label3");
-       act->strings_box    = get_widget_assert (xml, "table3");
+    act->new_copy_label = get_widget_assert (xml, "label3");
+    act->strings_box    = get_widget_assert (xml, "table3");
 
-       act->old_and_new_dialog =
-         PSPPIRE_DIALOG (get_widget_assert (xml, "old-new-values-dialog"));
+    act->old_and_new_dialog =
+      PSPPIRE_DIALOG (get_widget_assert (xml, "old-new-values-dialog"));
 
-       act->acr = get_widget_assert (xml, "psppire-acr1");
+    act->acr = get_widget_assert (xml, "psppire-acr1");
 
-       g_signal_connect_swapped (act->toggle[BUTTON_NEW_VALUE], "toggled",
-                                 G_CALLBACK (set_acr), act);
+    g_signal_connect_swapped (act->toggle[BUTTON_NEW_VALUE], "toggled",
+                             G_CALLBACK (set_acr), act);
 
-       g_signal_connect_after (act->toggle[BUTTON_NEW_VALUE], "toggled",
-                               G_CALLBACK (focus_value_entry), act);
+    g_signal_connect_after (act->toggle[BUTTON_NEW_VALUE], "toggled",
+                           G_CALLBACK (focus_value_entry), act);
 
-       g_signal_connect_swapped (act->new_value_entry, "changed",
-                                 G_CALLBACK (set_acr), act);
+    g_signal_connect_swapped (act->new_value_entry, "changed",
+                             G_CALLBACK (set_acr), act);
 
-       {
-         GtkTreeSelection *sel;
-         /* Remove the ACR's default column.  We don't like it */
-         GtkTreeViewColumn *column = gtk_tree_view_get_column (PSPPIRE_ACR(act->acr)->tv, 0);
-         gtk_tree_view_remove_column (PSPPIRE_ACR (act->acr)->tv, column);
+    {
+      GtkTreeSelection *sel;
+      /* Remove the ACR's default column.  We don't like it */
+      GtkTreeViewColumn *column = gtk_tree_view_get_column (PSPPIRE_ACR(act->acr)->tv, 0);
+      gtk_tree_view_remove_column (PSPPIRE_ACR (act->acr)->tv, column);
 
 
-         column =
-           gtk_tree_view_column_new_with_attributes (_("Old"),
-                                                     gtk_cell_renderer_text_new (),
-                                                     "text", 0,
-                                                     NULL);
+      column =
+       gtk_tree_view_column_new_with_attributes (_("Old"),
+                                                 gtk_cell_renderer_text_new (),
+                                                 "text", 0,
+                                                 NULL);
 
-         gtk_tree_view_append_column (PSPPIRE_ACR (act->acr)->tv, column);
+      gtk_tree_view_append_column (PSPPIRE_ACR (act->acr)->tv, column);
 
-         column =
-           gtk_tree_view_column_new_with_attributes (_("New"),
-                                                     gtk_cell_renderer_text_new (),
-                                                     "text", 1,
-                                                     NULL);
+      column =
+       gtk_tree_view_column_new_with_attributes (_("New"),
+                                                 gtk_cell_renderer_text_new (),
+                                                 "text", 1,
+                                                 NULL);
 
-         gtk_tree_view_append_column (PSPPIRE_ACR(act->acr)->tv, column);
-         g_object_set (PSPPIRE_ACR (act->acr)->tv, "headers-visible", TRUE, NULL);
+      gtk_tree_view_append_column (PSPPIRE_ACR(act->acr)->tv, column);
+      g_object_set (PSPPIRE_ACR (act->acr)->tv, "headers-visible", TRUE, NULL);
 
 
-         sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (PSPPIRE_ACR(act->acr)->tv));
-         g_signal_connect (sel, "changed",
-                           G_CALLBACK (on_acr_selection_change), act);
-       }
+      sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (PSPPIRE_ACR(act->acr)->tv));
+      g_signal_connect (sel, "changed",
+                       G_CALLBACK (on_acr_selection_change), act);
+    }
 
 
-       g_signal_connect_swapped (oldandnew, "clicked",
-                                 G_CALLBACK (run_old_and_new_dialog), act);
+    g_signal_connect_swapped (oldandnew, "clicked",
+                             G_CALLBACK (run_old_and_new_dialog), act);
 
 
-       g_signal_connect (act->toggle[BUTTON_NEW_VALUE], "toggled",
-                         G_CALLBACK (toggle_sensitivity), act->new_value_entry);
+    g_signal_connect (act->toggle[BUTTON_NEW_VALUE], "toggled",
+                     G_CALLBACK (toggle_sensitivity), act->new_value_entry);
 
-       g_signal_connect (act->string_button, "toggled",
-                         G_CALLBACK (toggle_sensitivity), act->width_entry);
+    g_signal_connect (act->string_button, "toggled",
+                     G_CALLBACK (toggle_sensitivity), act->width_entry);
 
-       g_signal_connect (act->string_button, "toggled",
-                         G_CALLBACK (on_string_toggled), act);
+    g_signal_connect (act->string_button, "toggled",
+                     G_CALLBACK (on_string_toggled), act);
 
-       g_signal_connect (act->convert_button, "toggled",
-                         G_CALLBACK (on_convert_toggled), act);
-      }
+    g_signal_connect (act->convert_button, "toggled",
+                     G_CALLBACK (on_convert_toggled), act);
     }
+  return xml;
 }
 
 /* Generate a syntax fragment for NV and append it to STR */
index 8b67e425d913f0e56b5ae4dbd6f9a5c354804b95..06c527e72f11f617a89f54144340da84efed8aa6 100644 (file)
@@ -107,7 +107,8 @@ GType psppire_dialog_action_recode_get_type (void) ;
 
 void psppire_dialog_action_recode_refresh (PsppireDialogAction *);
 
-void psppire_dialog_action_recode_pre_activate (PsppireDialogActionRecode *act, void (*populate_treeview) (PsppireDialogActionRecode *) );
+GtkBuilder * psppire_dialog_action_recode_pre_activate (PsppireDialogActionRecode *act,
+                                                       void (*populate_treeview) (PsppireDialogActionRecode *) );
 
 
 GType new_value_get_type (void);
index 0cfadb14012188922071185ee19a71d73a7024b9..b475ebb0dfb6a9b5be6a855ee43cefaf3ea0eef3 100644 (file)
@@ -141,20 +141,14 @@ on_save_clicked (PsppireDialogActionRegression *rd)
 }
 
 
-static void
-psppire_dialog_action_regression_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_regression_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionRegression *act = PSPPIRE_DIALOG_ACTION_REGRESSION (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  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);
-    }
-
+  GtkBuilder *xml = builder_new ( "regression.ui");
+  
   GtkWidget *stat_button = get_widget_assert (xml, "stat-button");
   GtkWidget *save_button = get_widget_assert (xml, "save-button");
 
@@ -185,7 +179,7 @@ psppire_dialog_action_regression_activate (PsppireDialogAction *a)
   g_signal_connect_swapped (save_button, "clicked",
                            G_CALLBACK (on_save_clicked),  act);
 
-
+  return xml;
 }
 
 
@@ -259,7 +253,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_regression_class_init (PsppireDialogActionRegressionClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_regression_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_regression_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index 0ee1af8e61fbd3012103b9027faf3d8b21e59750..9082025f7d43e0d2a170ae287180fde260f664cc 100644 (file)
@@ -119,20 +119,14 @@ refresh (PsppireDialogAction *pda_)
                                FALSE);
 }
 
-static void
-psppire_dialog_action_reliability_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_reliability_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionReliability *act = PSPPIRE_DIALOG_ACTION_RELIABILITY (a);
   GtkTreeModel *liststore ;
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("reliability.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "reliability.ui");
 
   pda->dialog = get_widget_assert   (xml, "reliability-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -164,14 +158,14 @@ psppire_dialog_action_reliability_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_refresh (pda, refresh);
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_reliability_class_init (PsppireDialogActionReliabilityClass *class)
 {
   PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class);
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_reliability_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_reliability_activate;
 
   pdac->generate_syntax = generate_syntax;
 }
index 694effb7b888512556a2a229b230cf6827537d8f..448d44f2b4ebd00dacbea5bcc6d5a7bffc82fa0e 100644 (file)
@@ -120,20 +120,13 @@ on_state_var_changed (PsppireDialogAction *a)
   psppire_value_entry_set_variable (PSPPIRE_VALUE_ENTRY (act->state_value), var);
 }
 
-static void
-psppire_dialog_action_roc_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_roc_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionRoc *act = PSPPIRE_DIALOG_ACTION_ROC (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("roc.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
-
+  GtkBuilder *xml = builder_new ( "roc.ui");
 
   pda->dialog = get_widget_assert   (xml, "roc-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -157,7 +150,7 @@ psppire_dialog_action_roc_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda,
                                        dialog_state_valid);
-
+  return xml;
 }
 
 
@@ -242,7 +235,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_roc_class_init (PsppireDialogActionRocClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_roc_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_roc_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index a0e9e30357410839736e64a1f318ddbe794577da..40afd8e7623ebec984c96bdceeae4fe233cd17d8 100644 (file)
@@ -127,19 +127,13 @@ refresh (PsppireDialogAction *rd_)
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->cb[i]), FALSE);
 }
 
-static void
-psppire_dialog_action_runs_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_runs_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionRuns *act = PSPPIRE_DIALOG_ACTION_RUNS (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("runs.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "runs.ui");
 
   pda->dialog = get_widget_assert   (xml, "runs-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -153,13 +147,13 @@ psppire_dialog_action_runs_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_runs_class_init (PsppireDialogActionRunsClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_runs_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_runs_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 891dbf019bf482c14c8b787ed93845cf3457dd75..041c857b73a03e40fa5c1938588bf99cda23a6b9 100644 (file)
@@ -90,20 +90,13 @@ refresh (PsppireDialogAction *rd_)
 
 
 
-static void
-psppire_dialog_action_scatterplot_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_scatterplot_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionScatterplot *act = PSPPIRE_DIALOG_ACTION_SCATTERPLOT (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("scatterplot.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
-
+  GtkBuilder *xml = builder_new ( "scatterplot.ui");
   pda->dialog = get_widget_assert   (xml, "scatterplot-dialog");
   pda->source = get_widget_assert   (xml, "scatterplot-treeview1");
 
@@ -112,13 +105,13 @@ psppire_dialog_action_scatterplot_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_scatterplot_class_init (PsppireDialogActionScatterplotClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_scatterplot_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_scatterplot_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index a524de63d933003697664c10b0ad51fbf7935eb4..e5d777dadac61363493c3801121fd00f57ddb9f3 100644 (file)
@@ -255,111 +255,103 @@ consistency (GtkSpinButton *spin, PsppireDialogActionSelect *act)
     }
 }
 
-static void
-psppire_dialog_action_select_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_select_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogActionSelect *act = PSPPIRE_DIALOG_ACTION_SELECT (a);
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
+  
+  GtkBuilder *xml = builder_new ( "select-cases.ui");
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("select-cases.ui");
-      g_hash_table_insert (thing, a, xml);
-
-
-      pda->dialog = get_widget_assert (xml, "select-cases-dialog");
-      pda->source = get_widget_assert   (xml, "select-cases-treeview");
+  pda->dialog = get_widget_assert (xml, "select-cases-dialog");
+  pda->source = get_widget_assert   (xml, "select-cases-treeview");
 
-      g_object_set (pda->source,
-                   "selection-mode", GTK_SELECTION_SINGLE,
-                   NULL);
-
-      act->entry = get_widget_assert (xml, "filter-variable-entry");
+  g_object_set (pda->source,
+               "selection-mode", GTK_SELECTION_SINGLE,
+               NULL);
 
-      GtkWidget *selector = get_widget_assert (xml, "psppire-selector-filter");
-      psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector),
-                                       is_currently_in_entry);
+  act->entry = get_widget_assert (xml, "filter-variable-entry");
 
-      act->rsample_dialog = get_widget_assert (xml, "select-cases-random-sample-dialog");
-      act->percent = get_widget_assert (xml, "radiobutton-sample-percent");
-      act->sample_n_cases = get_widget_assert (xml, "radiobutton-sample-n-cases");
-      act->table = get_widget_assert (xml, "select-cases-random-sample-table");
+  GtkWidget *selector = get_widget_assert (xml, "psppire-selector-filter");
+  psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector),
+                                   is_currently_in_entry);
 
-      act->l0 = get_widget_assert (xml, "random-sample-label");;
+  act->rsample_dialog = get_widget_assert (xml, "select-cases-random-sample-dialog");
+  act->percent = get_widget_assert (xml, "radiobutton-sample-percent");
+  act->sample_n_cases = get_widget_assert (xml, "radiobutton-sample-n-cases");
+  act->table = get_widget_assert (xml, "select-cases-random-sample-table");
 
-      act->radiobutton_range = get_widget_assert (xml, "radiobutton-range");
-      act->range_subdialog = get_widget_assert (xml, "select-cases-range-dialog");
+  act->l0 = get_widget_assert (xml, "random-sample-label");;
 
-      act->first = get_widget_assert (xml, "range-dialog-first");
-      act->last = get_widget_assert (xml, "range-dialog-last");
+  act->radiobutton_range = get_widget_assert (xml, "radiobutton-range");
+  act->range_subdialog = get_widget_assert (xml, "select-cases-range-dialog");
 
-      g_signal_connect (act->first, "value-changed", G_CALLBACK (consistency), act);
-      g_signal_connect (act->last, "value-changed", G_CALLBACK (consistency), act);
+  act->first = get_widget_assert (xml, "range-dialog-first");
+  act->last = get_widget_assert (xml, "range-dialog-last");
 
-      act->l1 = get_widget_assert (xml, "range-sample-label");
-      act->radiobutton_sample =  get_widget_assert (xml, "radiobutton-sample");
+  g_signal_connect (act->first, "value-changed", G_CALLBACK (consistency), act);
+  g_signal_connect (act->last, "value-changed", G_CALLBACK (consistency), act);
 
-      act->radiobutton_all = get_widget_assert (xml, "radiobutton-all");
-      act->radiobutton_filter_variable =  get_widget_assert (xml, "radiobutton-filter-variable");
+  act->l1 = get_widget_assert (xml, "range-sample-label");
+  act->radiobutton_sample =  get_widget_assert (xml, "radiobutton-sample");
 
-      act->radiobutton_filter =  get_widget_assert (xml, "radiobutton-filter");
-      act->radiobutton_delete = get_widget_assert (xml,   "radiobutton-delete");
+  act->radiobutton_all = get_widget_assert (xml, "radiobutton-all");
+  act->radiobutton_filter_variable =  get_widget_assert (xml, "radiobutton-filter-variable");
 
+  act->radiobutton_filter =  get_widget_assert (xml, "radiobutton-filter");
+  act->radiobutton_delete = get_widget_assert (xml,   "radiobutton-delete");
 
-      GtkWidget        *button_range = get_widget_assert (xml, "button-range");
-      GtkWidget *button_sample = get_widget_assert (xml, "button-sample");
 
-      GtkWidget *button_if =get_widget_assert (xml, "button-if");
+  GtkWidget    *button_range = get_widget_assert (xml, "button-range");
+  GtkWidget *button_sample = get_widget_assert (xml, "button-sample");
 
-      GtkWidget *radiobutton_if = get_widget_assert (xml, "radiobutton-if");
+  GtkWidget *button_if =get_widget_assert (xml, "button-if");
 
-      GtkWidget *sample_label = get_widget_assert (xml, "random-sample-label");
+  GtkWidget *radiobutton_if = get_widget_assert (xml, "radiobutton-if");
 
-      g_signal_connect (act->radiobutton_all, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle_invert),
-                       get_widget_assert (xml, "filter-delete-button-box"));
+  GtkWidget *sample_label = get_widget_assert (xml, "random-sample-label");
 
-      g_signal_connect (button_if, "clicked",
-                       G_CALLBACK (set_radiobutton), radiobutton_if);
+  g_signal_connect (act->radiobutton_all, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle_invert),
+                   get_widget_assert (xml, "filter-delete-button-box"));
 
-      g_signal_connect (button_sample, "clicked",
-                       G_CALLBACK (set_radiobutton), act->radiobutton_sample);
+  g_signal_connect (button_if, "clicked",
+                   G_CALLBACK (set_radiobutton), radiobutton_if);
 
-      g_signal_connect (button_range,  "clicked",
-                       G_CALLBACK (set_radiobutton), act->radiobutton_range);
+  g_signal_connect (button_sample, "clicked",
+                   G_CALLBACK (set_radiobutton), act->radiobutton_sample);
 
-      g_signal_connect (selector, "clicked",
-                       G_CALLBACK (set_radiobutton), act->radiobutton_filter_variable);
+  g_signal_connect (button_range,  "clicked",
+                   G_CALLBACK (set_radiobutton), act->radiobutton_range);
 
-      g_signal_connect (selector, "selected",
-                       G_CALLBACK (set_radiobutton), act->radiobutton_filter_variable);
+  g_signal_connect (selector, "clicked",
+                   G_CALLBACK (set_radiobutton), act->radiobutton_filter_variable);
 
-      g_signal_connect (act->radiobutton_range, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle),
-                       act->l1);
+  g_signal_connect (selector, "selected",
+                   G_CALLBACK (set_radiobutton), act->radiobutton_filter_variable);
 
-      g_signal_connect (act->radiobutton_sample, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle),
-                       sample_label);
+  g_signal_connect (act->radiobutton_range, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle),
+                   act->l1);
 
-      g_signal_connect (act->radiobutton_filter_variable, "toggled",
-                       G_CALLBACK (set_sensitivity_from_toggle),
-                       act->entry);
+  g_signal_connect (act->radiobutton_sample, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle),
+                   sample_label);
 
-      g_signal_connect (button_range,
-                       "clicked", G_CALLBACK (range_subdialog), act);
+  g_signal_connect (act->radiobutton_filter_variable, "toggled",
+                   G_CALLBACK (set_sensitivity_from_toggle),
+                   act->entry);
 
-      g_signal_connect (button_sample,
-                       "clicked", G_CALLBACK (sample_subdialog), act);
-    }
+  g_signal_connect (button_range,
+                   "clicked", G_CALLBACK (range_subdialog), act);
 
+  g_signal_connect (button_sample,
+                   "clicked", G_CALLBACK (sample_subdialog), act);
   psppire_dialog_action_set_refresh (pda, refresh);
 
   psppire_dialog_action_set_valid_predicate (pda,
-                                       dialog_state_valid);
-
+                                            dialog_state_valid);
+  return xml;
 }
 
 
@@ -560,7 +552,7 @@ generate_syntax (const PsppireDialogAction *a)
 static void
 psppire_dialog_action_select_class_init (PsppireDialogActionSelectClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_select_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_select_activate;
 
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
index ecfffe536b8883628b3c5b8684902a61325e8bbf..f59cc42589396502a5ac26349659be4b7b0df110 100644 (file)
@@ -89,19 +89,13 @@ dialog_state_valid (gpointer act)
 }
 
 
-static void
-psppire_dialog_action_sort_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_sort_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionSort *act = PSPPIRE_DIALOG_ACTION_SORT (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("sort.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "sort.ui");
 
   pda->dialog = get_widget_assert (xml, "sort-cases-dialog");
   pda->source = get_widget_assert (xml, "sort-cases-treeview1");
@@ -113,16 +107,16 @@ psppire_dialog_action_sort_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda,
                                      dialog_state_valid);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_sort_class_init (PsppireDialogActionSortClass *class)
 {
  PsppireDialogActionClass *pdac = PSPPIRE_DIALOG_ACTION_CLASS (class);
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_sort_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_sort_activate;
 
 pdac->generate_syntax = generate_syntax;
+ pdac->generate_syntax = generate_syntax;
 }
 
 
index 410b2d106f772ad840f69055c1d773dc67bd56f6..5a0026e2133334e8782198eb9d3ca7e121fe1ed2 100644 (file)
@@ -136,48 +136,41 @@ on_off_toggled (GtkToggleButton *togglebutton,
   gtk_widget_set_sensitive (act->source, state);
 }
 
-static void
-psppire_dialog_action_split_activate (PsppireDialogAction *pda)
+static GtkBuilder *
+psppire_dialog_action_split_activate (PsppireDialogAction *pda, GVariant *param)
 {
   PsppireDialogActionSplit *act = PSPPIRE_DIALOG_ACTION_SPLIT (pda);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, pda);
-  if (!xml)
-    {
-      xml = builder_new ("split-file.ui");
-      g_hash_table_insert (thing, pda, xml);
+  GtkBuilder *xml = builder_new ( "split-file.ui");
 
-      pda->dialog = get_widget_assert   (xml, "split-file-dialog");
-      pda->source = get_widget_assert   (xml, "split-file-dict-treeview");
-      act->selector = get_widget_assert (xml, "split-file-selector");
+  pda->dialog = get_widget_assert   (xml, "split-file-dialog");
+  pda->source = get_widget_assert   (xml, "split-file-dict-treeview");
+  act->selector = get_widget_assert (xml, "split-file-selector");
 
-      act->dest =   get_widget_assert (xml, "split-file-grouping-vars");
-      act->source = get_widget_assert (xml, "split-file-dict-treeview");
-      act->sort = get_widget_assert (xml, "split-sort");
+  act->dest =   get_widget_assert (xml, "split-file-grouping-vars");
+  act->source = get_widget_assert (xml, "split-file-dict-treeview");
+  act->sort = get_widget_assert (xml, "split-sort");
 
-      act->off = get_widget_assert   (xml, "split-off");
-      act->layered = get_widget_assert   (xml, "split-layered");
+  act->off = get_widget_assert   (xml, "split-off");
+  act->layered = get_widget_assert   (xml, "split-layered");
 
-      act->tv = get_widget_assert (xml, "split-file-grouping-vars");
+  act->tv = get_widget_assert (xml, "split-file-grouping-vars");
 
-      g_signal_connect (act->off, "toggled", G_CALLBACK (on_off_toggled), pda);
-      g_signal_connect_swapped (pda->dialog, "show", G_CALLBACK (refresh), pda);
-    }
+  g_signal_connect (act->off, "toggled", G_CALLBACK (on_off_toggled), pda);
+  g_signal_connect_swapped (pda->dialog, "show", G_CALLBACK (refresh), pda);
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_split_class_init (PsppireDialogActionSplitClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_split_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_split_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
-
 static void
 psppire_dialog_action_split_init (PsppireDialogActionSplit *act)
 {
index f9d8bfa608b6ba5cdbaf733b59eecde566e35997..9fa30913e1345a27d32c2570846b560fc2ddc4dd 100644 (file)
@@ -102,20 +102,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_list_store_clear (GTK_LIST_STORE (model));
 }
 
-static void
-psppire_dialog_action_tt1s_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_tt1s_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionTt1s *act = PSPPIRE_DIALOG_ACTION_TT1S (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("t-test.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
-
+  GtkBuilder *xml = builder_new ( "t-test.ui");
   GtkWidget *options_button = get_widget_assert (xml, "button1");
 
   pda->dialog = get_widget_assert (xml, "t-test-one-sample-dialog");
@@ -134,7 +127,7 @@ psppire_dialog_action_tt1s_activate (PsppireDialogAction *a)
 
   g_signal_connect_swapped (options_button, "clicked",
                            G_CALLBACK (tt_options_dialog_run), act->opt);
-
+  return xml;
 }
 
 static void
@@ -148,7 +141,7 @@ static void
 psppire_dialog_action_tt1s_class_init (PsppireDialogActionTt1sClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_tt1s_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_tt1s_activate;
 
   object_class->finalize = psppire_dialog_action_tt1s_finalize;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
index 1d8d92ca50b55f266b57fa7b99ac4fd76ea9ad76..2ad9b5ce134d17be80c19e84c2e9dfdb1da7b049 100644 (file)
@@ -168,44 +168,38 @@ generate_syntax (const PsppireDialogAction *pda)
   return text;
 }
 
-static void
-psppire_dialog_action_two_sample_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_two_sample_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionTwoSample *act = PSPPIRE_DIALOG_ACTION_TWO_SAMPLE (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("paired-samples.ui");
-      g_hash_table_insert (thing, a, xml);
+  GtkBuilder *xml = builder_new ( "paired-samples.ui");
 
+  /* NPAR Specific options */
+  GtkWidget *frame = gtk_frame_new (_("Test Type"));
+  GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
+  GtkWidget *box = get_widget_assert (xml, "dynamic-populate");
 
-      /* NPAR Specific options */
-      GtkWidget *frame = gtk_frame_new (_("Test Type"));
-      GtkWidget *bb = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
-      GtkWidget *box = get_widget_assert (xml, "dynamic-populate");
 
+  strcpy (act->nts[NT_WILCOXON].syntax, "/WILCOXON");
+  strcpy (act->nts[NT_SIGN].syntax, "/SIGN");
+  strcpy (act->nts[NT_MCNEMAR].syntax, "/MCNEMAR");
 
-      strcpy (act->nts[NT_WILCOXON].syntax, "/WILCOXON");
-      strcpy (act->nts[NT_SIGN].syntax, "/SIGN");
-      strcpy (act->nts[NT_MCNEMAR].syntax, "/MCNEMAR");
+  act->nts[NT_WILCOXON].button = gtk_check_button_new_with_mnemonic (_("_Wilcoxon"));
+  act->nts[NT_SIGN].button = gtk_check_button_new_with_mnemonic (_("_Sign"));
+  act->nts[NT_MCNEMAR].button = gtk_check_button_new_with_mnemonic (_("_McNemar"));
 
-      act->nts[NT_WILCOXON].button = gtk_check_button_new_with_mnemonic (_("_Wilcoxon"));
-      act->nts[NT_SIGN].button = gtk_check_button_new_with_mnemonic (_("_Sign"));
-      act->nts[NT_MCNEMAR].button = gtk_check_button_new_with_mnemonic (_("_McNemar"));
+  gtk_box_pack_start (GTK_BOX (bb), act->nts[NT_WILCOXON].button, FALSE, FALSE, 5);
+  gtk_box_pack_start (GTK_BOX (bb), act->nts[NT_SIGN].button,     FALSE, FALSE, 5);
+  gtk_box_pack_start (GTK_BOX (bb), act->nts[NT_MCNEMAR].button,  FALSE, FALSE, 5);
 
-      gtk_box_pack_start (GTK_BOX (bb), act->nts[NT_WILCOXON].button, FALSE, FALSE, 5);
-      gtk_box_pack_start (GTK_BOX (bb), act->nts[NT_SIGN].button,     FALSE, FALSE, 5);
-      gtk_box_pack_start (GTK_BOX (bb), act->nts[NT_MCNEMAR].button,  FALSE, FALSE, 5);
+  gtk_container_add (GTK_CONTAINER (frame), bb);
 
-      gtk_container_add (GTK_CONTAINER (frame), bb);
+  gtk_widget_show_all (frame);
 
-      gtk_widget_show_all (frame);
+  gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE,  5);
 
-      gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE,  5);
-    }
 
   GtkWidget *selector = get_widget_assert (xml, "psppire-selector3");
 
@@ -228,13 +222,13 @@ psppire_dialog_action_two_sample_activate (PsppireDialogAction *a)
   psppire_selector_set_select_func (PSPPIRE_SELECTOR (selector),
                                    select_as_pair_member,
                                    act);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_two_sample_class_init (PsppireDialogActionTwoSampleClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_two_sample_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_two_sample_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 6b6d41dd38d79e21c7795648e6a9b967670aab13..1e998105c7396b3802baed5e9d0a4276d5e1a8e9 100644 (file)
@@ -82,19 +82,13 @@ refresh (PsppireDialogAction *rd_)
   gtk_list_store_clear (GTK_LIST_STORE (liststore));
 }
 
-static void
-psppire_dialog_action_univariate_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_univariate_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionUnivariate *act = PSPPIRE_DIALOG_ACTION_UNIVARIATE (a);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("univariate.ui");
-      g_hash_table_insert (thing, a, xml);
-    }
+  GtkBuilder *xml = builder_new ( "univariate.ui");
 
   pda->dialog = get_widget_assert   (xml, "univariate-dialog");
   pda->source = get_widget_assert   (xml, "dict-view");
@@ -104,13 +98,13 @@ psppire_dialog_action_univariate_activate (PsppireDialogAction *a)
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_univariate_class_init (PsppireDialogActionUnivariateClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_univariate_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_univariate_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index b4fa39e4ac3bf2dbe66bb3a222bc5ae650572e02..9c7d4fd3e2b374d6632408aa42362afecf115977 100644 (file)
@@ -165,46 +165,42 @@ jump_to (PsppireDialog *d, gint response, gpointer data)
   g_free (vars);
 }
 
-static void
-psppire_dialog_action_var_info_activate (PsppireDialogAction *a)
+static GtkBuilder *
+psppire_dialog_action_var_info_activate (PsppireDialogAction *a, GVariant *param)
 {
   PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
   PsppireDialogActionVarInfo *act = PSPPIRE_DIALOG_ACTION_VAR_INFO (pda);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, a);
-  if (!xml)
-    {
-      xml = builder_new ("variable-info.ui");
-      g_hash_table_insert (thing, a, xml);
+  GtkBuilder *xml = builder_new ( "variable-info.ui");
 
-      act->output =
-       psppire_output_view_new (GTK_LAYOUT (get_widget_assert (xml, "layout1")),
-                                NULL);
+  act->output =
+    psppire_output_view_new (GTK_LAYOUT (get_widget_assert (xml, "layout1")),
+                            NULL);
 
-      pda->dialog = get_widget_assert (xml, "variable-info-dialog");
-      pda->source = get_widget_assert (xml, "treeview2");
+  pda->dialog = get_widget_assert (xml, "variable-info-dialog");
+  pda->source = get_widget_assert (xml, "treeview2");
 
-      g_object_set (pda->source,
-                   "selection-mode", GTK_SELECTION_MULTIPLE,
-                   NULL);
+  g_object_set (pda->source,
+               "selection-mode", GTK_SELECTION_MULTIPLE,
+               NULL);
 
-      g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (pda->source)),
-                       "changed", G_CALLBACK (populate_output),
-                       act);
+  g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (pda->source)),
+                   "changed", G_CALLBACK (populate_output),
+                   act);
 
-      g_signal_connect (pda->dialog, "response", G_CALLBACK (jump_to),
-                       pda);
+  g_signal_connect (pda->dialog, "response", G_CALLBACK (jump_to),
+                   pda);
 
-      psppire_dialog_action_set_valid_predicate (pda,
-                                                treeview_item_selected);
-    }
+  psppire_dialog_action_set_valid_predicate (pda,
+                                            treeview_item_selected);
+
+  return xml;
 }
 
 static void
 psppire_dialog_action_var_info_class_init (PsppireDialogActionVarInfoClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_var_info_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate =  psppire_dialog_action_var_info_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index ec604ec97c2a32e5784e97e484cc366dd8f937ec..280d3c3c483ef4d28755f654c40dd7452ad1af5f 100644 (file)
@@ -119,49 +119,43 @@ on_toggle (GtkToggleButton *off, gpointer data)
 }
 
 
-static void
-psppire_dialog_action_weight_activate (PsppireDialogAction *pda)
+static GtkBuilder *
+psppire_dialog_action_weight_activate (PsppireDialogAction *pda, GVariant *param)
 {
   PsppireDialogActionWeight *act = PSPPIRE_DIALOG_ACTION_WEIGHT (pda);
 
-  GHashTable *thing = psppire_dialog_action_get_hash_table (pda);
-  GtkBuilder *xml = g_hash_table_lookup (thing, pda);
-  if (!xml)
-    {
-      xml = builder_new ("weight.ui");
-      g_hash_table_insert (thing, pda, xml);
+  GtkBuilder *xml = builder_new ( "weight.ui");
 
-      pda->dialog = get_widget_assert   (xml, "weight-cases-dialog");
-      pda->source = get_widget_assert   (xml, "weight-cases-treeview");
+  pda->dialog = get_widget_assert   (xml, "weight-cases-dialog");
+  pda->source = get_widget_assert   (xml, "weight-cases-treeview");
 
-      act->entry = get_widget_assert (xml, "weight-cases-entry");
-      act->off = get_widget_assert (xml,"weight-cases-radiobutton1");
-      act->on = get_widget_assert (xml, "radiobutton2");
-      act->status  = get_widget_assert (xml, "weight-status-label");
-      GtkWidget *selector = get_widget_assert (xml, "weight-cases-selector");
+  act->entry = get_widget_assert (xml, "weight-cases-entry");
+  act->off = get_widget_assert (xml,"weight-cases-radiobutton1");
+  act->on = get_widget_assert (xml, "radiobutton2");
+  act->status  = get_widget_assert (xml, "weight-status-label");
+  GtkWidget *selector = get_widget_assert (xml, "weight-cases-selector");
 
-      g_signal_connect (selector, "selected", G_CALLBACK (on_select), act);
-      g_signal_connect (selector, "de-selected", G_CALLBACK (on_deselect), act);
-      g_signal_connect (act->off, "toggled", G_CALLBACK (on_toggle), act);
+  g_signal_connect (selector, "selected", G_CALLBACK (on_select), act);
+  g_signal_connect (selector, "de-selected", G_CALLBACK (on_deselect), act);
+  g_signal_connect (act->off, "toggled", G_CALLBACK (on_toggle), act);
 
-      g_object_set (pda->source,
-                   "selection-mode", GTK_SELECTION_SINGLE,
-                   "predicate", var_is_numeric,
-                   NULL);
+  g_object_set (pda->source,
+               "selection-mode", GTK_SELECTION_SINGLE,
+               "predicate", var_is_numeric,
+               NULL);
 
-      psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector),
-                                       is_currently_in_entry);
-    }
+  psppire_selector_set_filter_func (PSPPIRE_SELECTOR (selector),
+                                   is_currently_in_entry);
 
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
+  return xml;
 }
 
 static void
 psppire_dialog_action_weight_class_init (PsppireDialogActionWeightClass *class)
 {
-  psppire_dialog_action_set_activation (class, psppire_dialog_action_weight_activate);
+  PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_weight_activate;
   PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax;
 }
 
index 70a5a9d4aa93cc805c202b1529a57afac077c6c2..9eeed98d8dd608fe8b101159017cd5a1ea269ad6 100644 (file)
@@ -22,6 +22,7 @@
 #include "executor.h"
 #include "helper.h"
 #include "psppire-data-window.h"
+#include "builder-wrapper.h"
 
 static void psppire_dialog_action_init            (PsppireDialogAction      *act);
 static void psppire_dialog_action_class_init      (PsppireDialogActionClass *class);
@@ -216,6 +217,14 @@ psppire_dialog_action_get_hash_table (PsppireDialogAction *act)
   return t;
 }
 
+GtkBuilder *
+psppire_dialog_action_get_xml (PsppireDialogAction *da)
+{
+  GHashTable *thing = psppire_dialog_action_get_hash_table (da);
+  GtkBuilder *xml = g_hash_table_lookup (thing, da);
+  return xml;
+}
+
 
 static void
 psppire_dialog_action_activate (PsppireDialogAction *act, GVariant *parameter)
@@ -230,9 +239,25 @@ psppire_dialog_action_activate (PsppireDialogAction *act, GVariant *parameter)
   wl = g_slist_prepend (wl, act->dialog);
   g_object_set_data (G_OBJECT (act->toplevel), "widget-list", wl);
 
-  if (class->activate)
-    class->activate (act, parameter);
+  if (class->initial_activate)
+    {
+      GHashTable *thing = psppire_dialog_action_get_hash_table (act);
+      GtkBuilder *xml = g_hash_table_lookup (thing, act);
+      if (xml == NULL)
+       {
+         xml = class->initial_activate (act, parameter);
+         g_hash_table_insert (thing, act, xml);
+       }
+    }
 
+  if (class->activate)
+    {
+      GHashTable *thing = psppire_dialog_action_get_hash_table (act);
+      GtkBuilder *xml = g_hash_table_lookup (thing, act);
+      if (xml != NULL)
+       class->activate (act, parameter);
+    }
+  
   gtk_window_set_transient_for (GTK_WINDOW (act->dialog),
                                GTK_WINDOW (act->toplevel));
 
@@ -285,8 +310,6 @@ psppire_dialog_action_class_init (PsppireDialogActionClass *class)
 
   class->generate_syntax = NULL;
 
-  class->activate = psppire_dialog_action_activate;
-
   g_object_class_install_property (object_class,
                                    PROP_TOPLEVEL,
                                    toplevel_spec);
@@ -322,11 +345,3 @@ psppire_dialog_action_set_refresh (PsppireDialogAction *pda,
 {
   g_signal_connect_swapped (pda->dialog, "refresh", G_CALLBACK (refresh),  pda);
 }
-
-
-void
-psppire_dialog_action_set_activation (gpointer class, activation activate)
-{
-  PSPPIRE_DIALOG_ACTION_CLASS (class)->activate = (void (*)(PsppireDialogAction *, GVariant *)) activate;
-}
-
index 1d613e1b6f8a1fab093df71c52b852bbb53c0fd7..8f79acc4c0dedd9dbec693543c5f1a60ded6dbd9 100644 (file)
@@ -83,6 +83,7 @@ struct _PsppireDialogAction
 struct _PsppireDialogActionClass
 {
   GObjectClass parent_class;
+  GtkBuilder * (*initial_activate) (PsppireDialogAction *, GVariant *);
   void   (*activate) (PsppireDialogAction *, GVariant *);
   char * (*generate_syntax) (const PsppireDialogAction *);
 };
@@ -97,15 +98,11 @@ void psppire_dialog_action_set_refresh (PsppireDialogAction *pda,
 void psppire_dialog_action_set_valid_predicate (PsppireDialogAction *act,
                                                ContentsAreValid dialog_state_valid);
 
-typedef void (*activation) (PsppireDialogAction *);
+GtkBuilder * psppire_dialog_action_get_xml (PsppireDialogAction *da);
 
-void psppire_dialog_action_set_activation (gpointer class, activation a);
-
-GHashTable *psppire_dialog_action_get_hash_table (PsppireDialogAction *act);
 
 void psppire_dialog_action_activate_null (PsppireDialogAction *act);
 
-
 G_END_DECLS
 
 #endif /* __PSPPIRE_DIALOG_ACTION_H__ */