* A Russian localisation has been contributed.
- * The graphic user interface now has a Graphs menu to access the GRAPH
- command.
-
* The GRAPH command now has a /BAR subcommand to draw barcharts.
- * The graphical user interface uses Gtk+ version 3 instead of version 2.
- Accordingly, it has a somewhat different look and feel.
+ * The graphical user interface (psppire) has been changed as follows:
+
+ - It now uses Gtk+ version 3 instead of version 2. Accordingly, it has a
+ somewhat different look and feel.
+
+ - There is now has a Graphs menu to access the GRAPH command.
+
+ - The status of dialog box widgets are now preserved between calls
+ to the same dialog box for the same dataset.
* The pspp-convert utility can now decrypt encrypted syntax files.
The encrypted syntax file format is unacceptably insecure, so to
G_TYPE_STRING));
gtk_tree_view_set_model (GTK_TREE_VIEW (cbtv), cbtv->list);
- g_object_unref (cbtv->list);
+ // g_object_unref (cbtv->list);
treeview_checkbox_populate (GTK_TREE_VIEW (cbtv));
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogAction1sks *act = PSPPIRE_DIALOG_ACTION_1SKS (a);
- GtkBuilder *xml = builder_new ("ks-one-sample.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (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);
+ }
+
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);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_1sks_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_1sks_parent_class)->activate (pda);
}
PsppireDialogActionBarchart *act = PSPPIRE_DIALOG_ACTION_BARCHART (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("barchart.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("barchart.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
pda->dialog = get_widget_assert (xml, "barchart-dialog");
pda->source = get_widget_assert (xml, "dict-view");
populate_combo_model (GTK_COMBO_BOX(act->combobox));
- g_object_unref (xml);
-
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_valid_predicate (pda,
- dialog_state_valid);
+ dialog_state_valid);
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_barchart_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_barchart_parent_class)->activate (pda);
PsppireDialogActionBinomial *act = PSPPIRE_DIALOG_ACTION_BINOMIAL (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("binomial.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("binomial.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml, "binomial-dialog");
pda->source = get_widget_assert (xml, "dict-view");
act->cutpoint_entry = get_widget_assert (xml, "cutpoint-entry");
act->cutpoint_button = get_widget_assert (xml, "radiobutton4");
- g_object_unref (xml);
-
-
g_signal_connect (act->cutpoint_button, "toggled", G_CALLBACK (set_sensitivity_from_toggle),
act->cutpoint_entry);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionChisquare *act = PSPPIRE_DIALOG_ACTION_CHISQUARE (a);
- GtkBuilder *xml = builder_new ("chi-square.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("chi-square.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
GtkWidget *range_table = get_widget_assert (xml, "range-table");
GtkWidget *values_acr = get_widget_assert (xml, "psppire-acr1");
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
g_signal_connect (act->range_button, "toggled",
G_CALLBACK (set_sensitivity_from_toggle),
range_table);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionCompute *act = PSPPIRE_DIALOG_ACTION_COMPUTE (a);
- GtkBuilder *xml = builder_new ("compute.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("compute.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
pda->dialog = get_widget_assert (xml, "compute-variable-dialog");
pda->source = get_widget_assert (xml, "compute-treeview1");
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_compute_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_compute_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionCorrelation *act = PSPPIRE_DIALOG_ACTION_CORRELATION (a);
- GtkBuilder *xml = builder_new ("correlation.ui");
- pda->dialog = get_widget_assert (xml, "correlation-dialog");
- pda->source = get_widget_assert (xml, "dict-view");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("correlation.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
+ pda->dialog = get_widget_assert (xml, "correlation-dialog");
+ pda->source = get_widget_assert (xml, "dict-view");
act->variables = get_widget_assert (xml, "psppire-var-view1");
act->significant = get_widget_assert (xml, "button-flag-significants");
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_correlation_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_correlation_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionCount *act = PSPPIRE_DIALOG_ACTION_COUNT (a);
- GtkBuilder *xml = builder_new ("count.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("count.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
GtkWidget *selector = get_widget_assert (xml, "count-selector1");
GtkWidget *button = get_widget_assert (xml, "button1");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (values_dialog), act);
-
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_count_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_count_parent_class)->activate (pda);
}
PsppireDialogActionCrosstabs *act = PSPPIRE_DIALOG_ACTION_CROSSTABS (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("crosstabs.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("crosstabs.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml, "crosstabs-dialog");
pda->source = get_widget_assert (xml, "dict-treeview");
act->table_button = get_widget_assert (xml, "print-tables");
act->pivot_button = get_widget_assert (xml, "pivot");
-
- g_object_unref (xml);
-
act->format_options_avalue = TRUE;
act->format_options_table = TRUE;
act->format_options_pivot = TRUE;
gtk_toggle_button_set_active (scd->save_z_scores, false);
}
+
static void
psppire_dialog_action_descriptives_activate (GtkAction *a)
{
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionDescriptives *act = PSPPIRE_DIALOG_ACTION_DESCRIPTIVES (a);
- GtkBuilder *xml = builder_new ("descriptives.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (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");
+ GtkWidget *stats_treeview = get_widget_assert (xml, "statistics");
pda->dialog = get_widget_assert (xml, "descriptives-dialog");
pda->source = get_widget_assert (xml, "all-variables");
act->variables = get_widget_assert (xml, "stat-variables");
g_object_set (pda->source,
- "predicate", var_is_numeric, NULL);
+ "predicate", var_is_numeric, NULL);
psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (stats_treeview),
B_DS_DEFAULT,
psppire_dialog_action_set_refresh (pda, dialog_refresh);
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_descriptives_parent_class)->activate (pda);
-
- g_object_unref (xml);
}
static void
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionExamine *act = PSPPIRE_DIALOG_ACTION_EXAMINE (a);
- GtkBuilder *xml = builder_new ("examine.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (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");
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_examine_parent_class)->activate (pda);
-
g_list_free (list);
- g_object_unref (xml);
}
static void
GtkWidget *extraction_button ;
GtkWidget *rotation_button ;
- GtkBuilder *xml = builder_new ("factor.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (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");
psppire_dialog_action_set_refresh (pda, dialog_refresh);
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_factor_parent_class)->activate (pda);
-
- g_object_unref (xml);
}
static void
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionFlip *act = PSPPIRE_DIALOG_ACTION_FLIP (a);
- GtkBuilder *xml = builder_new ("psppire.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("psppire.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
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);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_flip_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_flip_parent_class)->activate (pda);
}
PsppireDialogActionFrequencies *act = PSPPIRE_DIALOG_ACTION_FREQUENCIES (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("frequencies.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("frequencies.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
GtkWidget *stats_treeview = get_widget_assert (xml, "stats-treeview");
GtkWidget *tables_button = get_widget_assert (xml, "tables-button");
act->bar = (get_widget_assert (xml, "bar"));
-
- g_object_unref (xml);
-
-
act->tables_opts_order = FRQ_AVALUE;
act->tables_opts_table = FRQ_TABLE;
act->tables_opts_limit = 50;
PsppireDialogActionHistogram *act = PSPPIRE_DIALOG_ACTION_HISTOGRAM (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("histogram.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("histogram.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
pda->dialog = get_widget_assert (xml, "histogram-dialog");
pda->source = get_widget_assert (xml, "dict-view");
act->variable = get_widget_assert (xml, "entry1");
act->curve = get_widget_assert (xml, "curve");
- g_object_unref (xml);
-
psppire_dialog_action_set_refresh (pda, refresh);
psppire_dialog_action_set_valid_predicate (pda,
PsppireDialogActionIndepSamps *act = PSPPIRE_DIALOG_ACTION_INDEP_SAMPS (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("indep-samples.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("indep-samples.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml,"independent-samples-dialog");
pda->source = get_widget_assert (xml, "indep-samples-treeview1");
g_signal_connect (act->dg_values_toggle_button, "toggled",
G_CALLBACK (set_group_criterion_type), act);
-
- g_object_unref (xml);
-
psppire_dialog_action_set_refresh (pda, refresh);
psppire_dialog_action_set_valid_predicate (pda,
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionKRelated *act = PSPPIRE_DIALOG_ACTION_K_RELATED (a);
- GtkBuilder *xml = builder_new ("k-related.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("k-related.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
pda->dialog = get_widget_assert (xml, "k-related-dialog");
pda->source = get_widget_assert (xml, "dict-view");
"predicate", var_is_numeric,
NULL);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_k_related_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_k_related_parent_class)->activate (pda);
}
{
PsppireDialogActionKmeans *act = PSPPIRE_DIALOG_ACTION_KMEANS (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("k-means.ui");
+
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("k-means.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml, "k-means-dialog");
pda->source = get_widget_assert (xml, "dict-view");
act->variables = get_widget_assert (xml, "psppire-var-view1");
psppire_dialog_action_set_refresh (pda, refresh);
-
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_kmeans_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_kmeans_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
GtkWidget *opts_button;
- GtkBuilder *xml = builder_new ("logistic.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("logistic.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml, "logistic-dialog");
pda->source = get_widget_assert (xml, "dict-view");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(act->conf_checkbox), TRUE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(act->conf_checkbox), FALSE);
- g_object_unref (xml);
-
psppire_dialog_action_set_refresh (pda, refresh);
psppire_dialog_action_set_valid_predicate (pda,
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionMeans *act = PSPPIRE_DIALOG_ACTION_MEANS (a);
- GtkBuilder *xml = builder_new ("means.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (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, "alignment3");
- GtkWidget *selector = get_widget_assert (xml, "layer-selector");
+ GtkWidget *vb = get_widget_assert (xml, "alignment3");
+ GtkWidget *selector = get_widget_assert (xml, "layer-selector");
act->layer = psppire_means_layer_new ();
gtk_container_add (GTK_CONTAINER (vb), act->layer);
gtk_widget_show (act->layer);
- pda->dialog = get_widget_assert (xml, "means-dialog");
- pda->source = get_widget_assert (xml, "all-variables");
- act->variables = get_widget_assert (xml, "stat-variables");
+ pda->dialog = get_widget_assert (xml, "means-dialog");
+ pda->source = get_widget_assert (xml, "all-variables");
+ act->variables = get_widget_assert (xml, "stat-variables");
g_object_set (pda->source,
"predicate", var_is_numeric,
"dest-widget", act->layer,
NULL);
-
psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid);
psppire_dialog_action_set_refresh (pda, dialog_refresh);
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_means_parent_class)->activate (pda);
-
- g_object_unref (xml);
}
static void
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionOneway *act = PSPPIRE_DIALOG_ACTION_ONEWAY (a);
- GtkBuilder *xml = builder_new ("oneway.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("oneway.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
GtkWidget *contrasts_button =
get_widget_assert (xml, "contrasts-button");
GtkEntry *entry = GTK_ENTRY (get_widget_assert (xml, "entry1"));
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_oneway_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_oneway_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionPaired *act = PSPPIRE_DIALOG_ACTION_PAIRED (a);
- GtkBuilder *xml = builder_new ("paired-samples.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (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..."));
select_as_pair_member,
act);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_paired_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_paired_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionRank *act = PSPPIRE_DIALOG_ACTION_RANK (a);
- GtkBuilder *xml = builder_new ("rank.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("rank.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
GtkWidget *types_button = get_widget_assert (xml, "button1");
GtkWidget *ties_button = get_widget_assert (xml, "button2");
psppire_dialog_action_set_refresh (pda, dialog_refresh);
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_rank_parent_class)->activate (pda);
-
- g_object_unref (xml);
}
static void
PsppireDialogActionRegression *act = PSPPIRE_DIALOG_ACTION_REGRESSION (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("regression.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("regression.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
GtkWidget *stat_button = get_widget_assert (xml, "stat-button");
GtkWidget *save_button = get_widget_assert (xml, "save-button");
act->pred_button = get_widget_assert (xml, "pred-button");
act->resid_button = get_widget_assert (xml, "resid-button");
- g_object_unref (xml);
-
psppire_checkbox_treeview_populate (PSPPIRE_CHECKBOX_TREEVIEW (act->stat_view),
B_RG_STATS_DEFAULT,
N_REGRESSION_STATS,
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionReliability *act = PSPPIRE_DIALOG_ACTION_RELIABILITY (a);
GtkTreeModel *liststore ;
- GtkBuilder *xml = builder_new ("reliability.ui");
+
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("reliability.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
pda->dialog = get_widget_assert (xml, "reliability-dialog");
pda->source = get_widget_assert (xml, "dict-view");
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_reliability_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_reliability_parent_class)->activate (pda);
-
- g_object_unref (xml);
}
static void
PsppireDialogActionRoc *act = PSPPIRE_DIALOG_ACTION_ROC (a);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
- GtkBuilder *xml = builder_new ("roc.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("roc.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
+
pda->dialog = get_widget_assert (xml, "roc-dialog");
pda->source = get_widget_assert (xml, "dict-view");
g_signal_connect_swapped (act->state_variable, "changed",
G_CALLBACK (on_state_var_changed), act);
- g_object_unref (xml);
-
g_signal_connect (act->curve, "toggled",
G_CALLBACK (on_curve_button_toggle), act);
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionRuns *act = PSPPIRE_DIALOG_ACTION_RUNS (a);
- GtkBuilder *xml = builder_new ("runs.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("runs.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
pda->dialog = get_widget_assert (xml, "runs-dialog");
pda->source = get_widget_assert (xml, "dict-view");
act->cb[CB_CUSTOM] = get_widget_assert (xml, "checkbutton3");
act->variables = get_widget_assert (xml, "psppire-var-view1");
-
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_runs_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_runs_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionScatterplot *act = PSPPIRE_DIALOG_ACTION_SCATTERPLOT (a);
- GtkBuilder *xml = builder_new ("scatterplot.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("scatterplot.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
pda->dialog = get_widget_assert (xml, "scatterplot-dialog");
pda->source = get_widget_assert (xml, "scatterplot-treeview1");
psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
psppire_dialog_action_set_refresh (pda, refresh);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_scatterplot_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_scatterplot_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionSort *act = PSPPIRE_DIALOG_ACTION_SORT (a);
- GtkBuilder *xml = builder_new ("sort.ui");
- pda->dialog = get_widget_assert (xml, "sort-cases-dialog");
- pda->source = get_widget_assert (xml, "sort-cases-treeview1");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("sort.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
+ pda->dialog = get_widget_assert (xml, "sort-cases-dialog");
+ pda->source = get_widget_assert (xml, "sort-cases-treeview1");
- act->variables = get_widget_assert (xml, "sort-cases-treeview2");
+ act->variables = get_widget_assert (xml, "sort-cases-treeview2");
act->ascending = get_widget_assert (xml, "sort-cases-radiobutton0");
psppire_dialog_action_set_refresh (pda, reset);
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate (pda);
-
- g_object_unref (xml);
}
static void
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionTt1s *act = PSPPIRE_DIALOG_ACTION_TT1S (a);
- GtkBuilder *xml = builder_new ("t-test.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("t-test.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
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);
-
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_tt1s_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_tt1s_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionTwoSample *act = PSPPIRE_DIALOG_ACTION_TWO_SAMPLE (a);
- GtkBuilder *xml = builder_new ("paired-samples.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (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");
pda->dialog = get_widget_assert (xml, "t-test-paired-samples-dialog");
select_as_pair_member,
act);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_two_sample_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_two_sample_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionUnivariate *act = PSPPIRE_DIALOG_ACTION_UNIVARIATE (a);
- GtkBuilder *xml = builder_new ("univariate.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("univariate.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
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);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_univariate_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_univariate_parent_class)->activate (pda);
}
PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a);
PsppireDialogActionVarInfo *act = PSPPIRE_DIALOG_ACTION_VAR_INFO (pda);
- GtkBuilder *xml = builder_new ("variable-info.ui");
+ GHashTable *thing = psppire_dialog_action_get_pointer (pda);
+ GtkBuilder *xml = g_hash_table_lookup (thing, a);
+ if (!xml)
+ {
+ xml = builder_new ("variable-info.ui");
+ g_hash_table_insert (thing, a, xml);
+ }
+
act->output = psppire_output_view_new (
GTK_LAYOUT (get_widget_assert (xml, "layout1")), NULL, NULL, NULL);
"changed", G_CALLBACK (populate_output),
act);
-
g_signal_connect (pda->dialog, "response", G_CALLBACK (jump_to),
pda);
psppire_dialog_action_set_valid_predicate (pda,
treeview_item_selected);
- g_object_unref (xml);
-
if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_var_info_parent_class)->activate)
PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_var_info_parent_class)->activate (pda);
}
}
+static void
+set_toplevel (PsppireDialogAction *act)
+{
+ if (act->toplevel)
+ return;
+
+ GSList *sl = gtk_ui_manager_get_toplevels (act->uim, GTK_UI_MANAGER_MENUBAR | GTK_UI_MANAGER_TOOLBAR);
+ g_return_if_fail (sl);
+
+ act->toplevel = gtk_widget_get_toplevel (GTK_WIDGET (sl->data));
+ g_slist_free (sl);
+}
+
+static void
+on_destroy_dataset (GObject *w)
+{
+ GHashTable *t = g_object_get_data (w, "thing-table");
+ GSList *dl = g_object_get_data (w, "widget-list");
+
+ g_slist_free_full (dl, (GDestroyNotify) gtk_widget_destroy);
+ g_hash_table_unref (t);
+}
+
+GHashTable *
+psppire_dialog_action_get_pointer (PsppireDialogAction *act)
+{
+ set_toplevel (act);
+
+ GHashTable *thing = g_object_get_data (G_OBJECT (act->toplevel), "thing-table");
+ if (thing == NULL)
+ {
+ thing = g_hash_table_new_full (g_direct_hash, g_direct_equal, 0, g_object_unref);
+ g_object_set_data (G_OBJECT (act->toplevel), "thing-table", thing);
+ g_object_set_data (G_OBJECT (act->toplevel), "widget-list", NULL);
+ g_signal_connect (act->toplevel, "destroy", G_CALLBACK (on_destroy_dataset), NULL);
+ }
+
+ return thing;
+}
+
static void
psppire_dialog_action_activate (PsppireDialogAction *act)
{
PsppireDialogActionClass *class = PSPPIRE_DIALOG_ACTION_GET_CLASS (act);
- GSList *sl = gtk_ui_manager_get_toplevels (act->uim, GTK_UI_MANAGER_MENUBAR | GTK_UI_MANAGER_TOOLBAR);
- g_return_if_fail (sl);
+ gboolean first_time = ! act->toplevel;
- act->toplevel = gtk_widget_get_toplevel (GTK_WIDGET (sl->data));
- g_slist_free (sl);
+ set_toplevel (act);
act->dict = PSPPIRE_DATA_WINDOW(act->toplevel)->dict;
g_object_set (act->source, "model", act->dict, NULL);
-
- gtk_window_set_transient_for (GTK_WINDOW (act->dialog), GTK_WINDOW (act->toplevel));
+ GSList *wl = g_object_get_data (G_OBJECT (act->toplevel), "widget-list");
+ wl = g_slist_prepend (wl, act->dialog);
+ g_object_set_data (G_OBJECT (act->toplevel), "widget-list", wl);
+
+ gtk_window_set_transient_for (GTK_WINDOW (act->dialog), GTK_WINDOW (act->toplevel));
if (GTK_ACTION_CLASS (psppire_dialog_action_parent_class)->activate)
GTK_ACTION_CLASS (psppire_dialog_action_parent_class)->activate ( GTK_ACTION (act));
gtk_widget_grab_focus (act->source);
+ if (first_time)
+ psppire_dialog_reload (PSPPIRE_DIALOG (act->dialog));
+
response = psppire_dialog_run (PSPPIRE_DIALOG (act->dialog));
if ( class->generate_syntax )
break;
}
}
-
- gtk_widget_destroy (act->dialog);
}
static void
void psppire_dialog_action_set_activation (gpointer class, activation a);
+GHashTable *psppire_dialog_action_get_pointer (PsppireDialogAction *act);
if (title == NULL)
g_warning ("PsppireDialog %s has no title", gtk_widget_get_name (GTK_WIDGET (dialog)));
-
+
if ( dialog->contents_are_valid != NULL )
gtk_container_foreach (GTK_CONTAINER (gtk_bin_get_child(GTK_BIN(dialog))),
connect_notify_signal,
dialog->loop = g_main_loop_new (NULL, FALSE);
gtk_widget_show (GTK_WIDGET (dialog));
-
- if ( dialog->contents_are_valid != NULL)
- g_signal_emit (dialog, signals [VALIDITY_CHANGED], 0, FALSE);
-
- g_signal_emit (dialog, signals [DIALOG_REFRESH], 0);
+ psppire_dialog_notify_change (dialog);
g_main_loop_run (dialog->loop);