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=a49d05306ea1f17820d3b429a17dc2374374a505;hb=f814726c9e2aecebf9f7da423f6990263b3dedf9;hp=9a41596d3bb3830c48a7b79e4c1c961a4adaf8fa;hpb=3dd0f6ae0d5eb73a2270a243e443c4ae03c2c16e;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 9a41596d3b..a49d05306e 100644 --- a/src/ui/gui/psppire-dialog-action-recode-different.c +++ b/src/ui/gui/psppire-dialog-action-recode-different.c @@ -42,7 +42,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) ) + if (g_hash_table_size (rdd->varmap) != gtk_tree_model_iter_n_children (model, NULL)) return FALSE; return TRUE; @@ -58,11 +58,11 @@ dialog_state_valid (gpointer data) PsppireDialogActionRecode *rd = data; GtkTreeIter not_used; - if ( ! rd->value_map ) + if (! rd->value_map) return FALSE; - if ( ! gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->value_map), - ¬_used) ) + if (! gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->value_map), + ¬_used)) return FALSE; @@ -122,7 +122,7 @@ nlp_create (const char *name, const char *label) nlp->label = NULL; - if ( 0 != strcmp ("", label)) + if (0 != strcmp ("", label)) nlp->label = g_strdup (label); return nlp; @@ -132,7 +132,7 @@ static void nlp_destroy (gpointer data) { struct nlp *nlp = data ; - if ( ! nlp ) + if (! nlp) return; g_free (nlp->name); @@ -161,10 +161,12 @@ render_new_var_name (GtkTreeViewColumn *tree_column, nlp = g_hash_table_lookup (rdd->varmap, var); - if ( nlp ) + if (nlp) g_object_set (cell, "text", nlp->name, NULL); else g_object_set (cell, "text", "", NULL); + + var_unref (var); } static void @@ -190,7 +192,7 @@ on_change_clicked (GObject *obj, gpointer data) const gchar *dest_var_label = gtk_entry_get_text (GTK_ENTRY (rd->new_label_entry)); - if ( NULL == rows || rows->next != NULL) + if (NULL == rows || rows->next != NULL) goto finish; gtk_tree_model_get_iter (model, &iter, rows->data); @@ -206,7 +208,7 @@ on_change_clicked (GObject *obj, gpointer data) gtk_tree_model_row_changed (model, rows->data, &iter); finish: - g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (rows, GFUNC_COMPAT_CAST (gtk_tree_path_free), NULL); g_list_free (rows); } @@ -227,7 +229,7 @@ on_selection_change (GtkTreeSelection *selection, gpointer data) GList *rows = gtk_tree_selection_get_selected_rows (selection, &model); - if ( rows && !rows->next) + if (rows && !rows->next) { /* Exactly one row is selected */ struct nlp *nlp; @@ -270,7 +272,7 @@ on_selection_change (GtkTreeSelection *selection, gpointer data) } - g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (rows, GFUNC_COMPAT_CAST (gtk_tree_path_free), NULL); g_list_free (rows); } @@ -312,13 +314,14 @@ populate_treeview (PsppireDialogActionRecode *act) } -static void -psppire_dialog_action_recode_different_activate (PsppireDialogAction *a) +static GtkBuilder * +psppire_dialog_action_recode_different_activate (PsppireDialogAction *a, GVariant *param) { PsppireDialogActionRecode *act = PSPPIRE_DIALOG_ACTION_RECODE (a); PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); - psppire_dialog_action_recode_pre_activate (act, populate_treeview); + GtkBuilder *xml = psppire_dialog_action_recode_pre_activate (act, + populate_treeview); gtk_window_set_title (GTK_WINDOW (pda->dialog), _("Recode into Different Variables")); @@ -335,6 +338,7 @@ psppire_dialog_action_recode_different_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); + return xml; } static void @@ -431,7 +435,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;