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)
{
#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);
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");
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;
}
-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;
}
}
-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;
}
}
-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 *
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;
}
}
-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");
psppire_dialog_action_set_refresh (pda, refresh);
psppire_dialog_action_set_valid_predicate (pda,
- dialog_state_valid);
-
+ dialog_state_valid);
+ return xml;
}
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;
}
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");
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;
}
}
-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;
}
}
-
-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;
}
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");
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;
}
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");
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;
}
}
-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;
}
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;
}
psppire_dialog_action_crosstabs_init (PsppireDialogActionCrosstabs *act)
{
}
-
}
-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");
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;
}
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");
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;
}
}
}
-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;
}
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");
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;
}
(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 *
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)
{
}
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");
psppire_dialog_action_set_valid_predicate (pda,
dialog_state_valid);
+ return xml;
}
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;
}
}
-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");
G_CALLBACK (on_grp_var_change), act);
on_grp_var_change (GTK_ENTRY (act->group_var_entry), act);
+
+ return xml;
}
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;
}
}
-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;
}
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");
"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;
}
return text;
}
-
-
static gboolean
dialog_state_valid (gpointer user_data)
{
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");
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;
}
}
-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");
psppire_dialog_action_set_valid_predicate (pda,
dialog_state_valid);
+ return xml;
}
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;
}
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");
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;
}
}
-
-
-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");
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;
}
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
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;
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");
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;
}
}
-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"));
psppire_dialog_action_set_valid_predicate (pda,
dialog_state_valid);
+ return xml;
}
static void
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;
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"));
psppire_dialog_action_set_valid_predicate (pda,
dialog_state_valid);
+
+ return xml;
}
static void
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;
}
-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 */
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);
}
-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");
g_signal_connect_swapped (save_button, "clicked",
G_CALLBACK (on_save_clicked), act);
-
+ return xml;
}
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;
}
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");
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;
}
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");
psppire_dialog_action_set_valid_predicate (pda,
dialog_state_valid);
-
+ return xml;
}
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;
}
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");
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;
}
-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");
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;
}
}
}
-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;
}
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;
}
}
-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");
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;
}
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)
{
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");
g_signal_connect_swapped (options_button, "clicked",
G_CALLBACK (tt_options_dialog_run), act->opt);
-
+ return xml;
}
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;
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");
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;
}
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");
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;
}
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;
}
}
-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;
}
#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);
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)
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));
class->generate_syntax = NULL;
- class->activate = psppire_dialog_action_activate;
-
g_object_class_install_property (object_class,
PROP_TOPLEVEL,
toplevel_spec);
{
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;
-}
-
struct _PsppireDialogActionClass
{
GObjectClass parent_class;
+ GtkBuilder * (*initial_activate) (PsppireDialogAction *, GVariant *);
void (*activate) (PsppireDialogAction *, GVariant *);
char * (*generate_syntax) (const PsppireDialogAction *);
};
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__ */