X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-regression.c;h=183301d02f01d006212bd7376c4f9663e483f422;hb=48b5268f2d9da96af106f09efd73ddddd96e5b09;hp=876a7651fa1d7904e44413ef3b4c9ac2fe309cb6;hpb=2a71889bf86463fb752bcbab248da47b25b4fd9a;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-regression.c b/src/ui/gui/psppire-dialog-action-regression.c index 876a7651fa..183301d02f 100644 --- a/src/ui/gui/psppire-dialog-action-regression.c +++ b/src/ui/gui/psppire-dialog-action-regression.c @@ -142,12 +142,19 @@ on_save_clicked (PsppireDialogActionRegression *rd) static void -psppire_dialog_action_regression_activate (GtkAction *a) +psppire_dialog_action_regression_activate (PsppireDialogAction *a) { 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_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); + } + GtkWidget *stat_button = get_widget_assert (xml, "stat-button"); GtkWidget *save_button = get_widget_assert (xml, "save-button"); @@ -162,8 +169,6 @@ psppire_dialog_action_regression_activate (GtkAction *a) 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, @@ -181,14 +186,12 @@ psppire_dialog_action_regression_activate (GtkAction *a) G_CALLBACK (on_save_clicked), act); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_regression_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_regression_parent_class)->activate (pda); } static char * -generate_syntax (PsppireDialogAction *a) +generate_syntax (const PsppireDialogAction *a) { PsppireDialogActionRegression *rd = PSPPIRE_DIALOG_ACTION_REGRESSION (a); gchar *text = NULL; @@ -205,9 +208,10 @@ generate_syntax (PsppireDialogAction *a) g_string_append (string, "\n\t/VARIABLES="); psppire_var_view_append_names (PSPPIRE_VAR_VIEW (rd->indep_vars), 0, string); - g_string_append (string, "\n\t/DEPENDENT=\t"); + g_string_append (string, "\n\t/DEPENDENT="); psppire_var_view_append_names (PSPPIRE_VAR_VIEW (rd->dep_vars), 0, string); - + g_string_append (string, "\n\t/METHOD=ENTER"); + selected = 0; for (i = 0, ok = gtk_tree_model_get_iter_first (model, &iter); ok; i++, ok = gtk_tree_model_iter_next (model, &iter))