X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-dialog-action-recode-different.c;h=251e5999e03b0079dfef7fdfaa082d06abcfca75;hb=a965acea74a93eba5c78c17c6595eef9a776a464;hp=d8556cac41a77dc1086745fe72819076c02bee17;hpb=258cbd9cdf386687122b0854274923acafc786d4;p=pspp diff --git a/src/ui/gui/psppire-dialog-action-recode-different.c b/src/ui/gui/psppire-dialog-action-recode-different.c index d8556cac41..251e5999e0 100644 --- a/src/ui/gui/psppire-dialog-action-recode-different.c +++ b/src/ui/gui/psppire-dialog-action-recode-different.c @@ -41,7 +41,7 @@ difx_variable_treeview_is_populated (PsppireDialogActionRecode *rd) { PsppireDialogActionRecodeDifferent *rdd = PSPPIRE_DIALOG_ACTION_RECODE_DIFFERENT (rd); GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (rd->variable_treeview)); - + if (g_hash_table_size (rdd->varmap) != gtk_tree_model_iter_n_children (model, NULL) ) return FALSE; @@ -57,7 +57,7 @@ dialog_state_valid (gpointer data) { PsppireDialogActionRecode *rd = data; GtkTreeIter not_used; - + if ( ! rd->value_map ) return FALSE; @@ -155,7 +155,7 @@ render_new_var_name (GtkTreeViewColumn *tree_column, struct variable *var = NULL; - gtk_tree_model_get (tree_model, iter, + gtk_tree_model_get (tree_model, iter, 0, &var, -1); @@ -243,7 +243,7 @@ on_selection_change (GtkTreeSelection *selection, gpointer data) g_return_if_fail (ok); gtk_tree_model_get (model, &iter, - 0, &var, + 0, &var, -1); nlp = g_hash_table_lookup (rdd->varmap, var); @@ -312,13 +312,14 @@ populate_treeview (PsppireDialogActionRecode *act) } -static void -psppire_dialog_action_recode_different_activate (PsppireDialogAction *a) +static GtkBuilder * +psppire_dialog_action_recode_different_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogActionRecode *act = PSPPIRE_DIALOG_ACTION_RECODE (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); - psppire_dialog_action_recode_pre_activate (act, populate_treeview); + GtkBuilder *xml = psppire_dialog_action_recode_pre_activate (act, + populate_treeview); gtk_window_set_title (GTK_WINDOW (pda->dialog), _("Recode into Different Variables")); @@ -327,7 +328,7 @@ psppire_dialog_action_recode_different_activate (PsppireDialogAction *a) _("Recode into Different Variables: Old and New Values ")); gtk_widget_show (act->output_variable_box); - + g_signal_connect_swapped (act->old_and_new_dialog, "show", G_CALLBACK (on_old_new_show), act); @@ -335,6 +336,7 @@ psppire_dialog_action_recode_different_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); + return xml; } static void @@ -346,7 +348,7 @@ append_into_clause (const PsppireDialogActionRecode *rd, struct string *dds) GtkTreeIter iter; ds_put_cstr (dds, "\n\tINTO "); gboolean ok; - + for (ok = psppire_var_view_get_iter_first (PSPPIRE_VAR_VIEW (rd->variable_treeview), &iter); ok; ok = psppire_var_view_get_iter_next (PSPPIRE_VAR_VIEW (rd->variable_treeview), &iter)) @@ -355,7 +357,7 @@ append_into_clause (const PsppireDialogActionRecode *rd, struct string *dds) const struct variable *var = psppire_var_view_get_variable (PSPPIRE_VAR_VIEW (rd->variable_treeview), 0, &iter); nlp = g_hash_table_lookup (rdd->varmap, var); - + ds_put_cstr (dds, nlp->name); ds_put_cstr (dds, " "); } @@ -431,7 +433,7 @@ target_is_string (const PsppireDialogActionRecode *rd) static void psppire_dialog_action_recode_different_class_init (PsppireDialogActionRecodeDifferentClass *class) { - psppire_dialog_action_set_activation (class, psppire_dialog_action_recode_different_activate); + PSPPIRE_DIALOG_ACTION_CLASS (class)->initial_activate = psppire_dialog_action_recode_different_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = diff_generate_syntax; PSPPIRE_DIALOG_ACTION_RECODE_CLASS (class)->target_is_string = target_is_string;