projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
merging works
[pspp]
/
src
/
ui
/
gui
/
psppire-dialog-action-recode-different.c
diff --git
a/src/ui/gui/psppire-dialog-action-recode-different.c
b/src/ui/gui/psppire-dialog-action-recode-different.c
index d8556cac41a77dc1086745fe72819076c02bee17..a49d05306ea1f17820d3b429a17dc2374374a505 100644
(file)
--- a/
src/ui/gui/psppire-dialog-action-recode-different.c
+++ b/
src/ui/gui/psppire-dialog-action-recode-different.c
@@
-41,8
+41,8
@@
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));
{
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;
return FALSE;
return TRUE;
@@
-57,12
+57,12
@@
dialog_state_valid (gpointer data)
{
PsppireDialogActionRecode *rd = data;
GtkTreeIter not_used;
{
PsppireDialogActionRecode *rd = data;
GtkTreeIter not_used;
-
- if (
! rd->value_map
)
+
+ if (
! rd->value_map
)
return FALSE;
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;
return FALSE;
@@
-122,7
+122,7
@@
nlp_create (const char *name, const char *label)
nlp->label = NULL;
nlp->label = NULL;
- if (
0 != strcmp ("", label))
+ if (0 != strcmp ("", label))
nlp->label = g_strdup (label);
return nlp;
nlp->label = g_strdup (label);
return nlp;
@@
-132,7
+132,7
@@
static void
nlp_destroy (gpointer data)
{
struct nlp *nlp = data ;
nlp_destroy (gpointer data)
{
struct nlp *nlp = data ;
- if (
! nlp
)
+ if (
! nlp
)
return;
g_free (nlp->name);
return;
g_free (nlp->name);
@@
-155,16
+155,18
@@
render_new_var_name (GtkTreeViewColumn *tree_column,
struct variable *var = NULL;
struct variable *var = NULL;
- gtk_tree_model_get (tree_model, iter,
+ gtk_tree_model_get (tree_model, iter,
0, &var,
-1);
nlp = g_hash_table_lookup (rdd->varmap, var);
0, &var,
-1);
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);
g_object_set (cell, "text", nlp->name, NULL);
else
g_object_set (cell, "text", "", NULL);
+
+ var_unref (var);
}
static void
}
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));
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);
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:
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);
}
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);
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;
{
/* Exactly one row is selected */
struct nlp *nlp;
@@
-243,7
+245,7
@@
on_selection_change (GtkTreeSelection *selection, gpointer data)
g_return_if_fail (ok);
gtk_tree_model_get (model, &iter,
g_return_if_fail (ok);
gtk_tree_model_get (model, &iter,
- 0, &var,
+ 0, &var,
-1);
nlp = g_hash_table_lookup (rdd->varmap, var);
-1);
nlp = g_hash_table_lookup (rdd->varmap, var);
@@
-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);
}
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);
{
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"));
gtk_window_set_title (GTK_WINDOW (pda->dialog),
_("Recode into Different Variables"));
@@
-327,7
+330,7
@@
psppire_dialog_action_recode_different_activate (PsppireDialogAction *a)
_("Recode into Different Variables: Old and New Values "));
gtk_widget_show (act->output_variable_box);
_("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);
g_signal_connect_swapped (act->old_and_new_dialog, "show",
G_CALLBACK (on_old_new_show), act);
@@
-335,6
+338,7
@@
psppire_dialog_action_recode_different_activate (PsppireDialogAction *a)
psppire_dialog_action_set_valid_predicate (pda,
dialog_state_valid);
psppire_dialog_action_set_valid_predicate (pda,
dialog_state_valid);
+ return xml;
}
static void
}
static void
@@
-346,7
+350,7
@@
append_into_clause (const PsppireDialogActionRecode *rd, struct string *dds)
GtkTreeIter iter;
ds_put_cstr (dds, "\n\tINTO ");
gboolean ok;
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))
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
+359,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);
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, " ");
}
ds_put_cstr (dds, nlp->name);
ds_put_cstr (dds, " ");
}
@@
-431,7
+435,7
@@
target_is_string (const PsppireDialogActionRecode *rd)
static void
psppire_dialog_action_recode_different_class_init (PsppireDialogActionRecodeDifferentClass *class)
{
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;
PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = diff_generate_syntax;
PSPPIRE_DIALOG_ACTION_RECODE_CLASS (class)->target_is_string = target_is_string;