From: John Darrington Date: Sun, 15 Nov 2009 21:30:18 +0000 (+0100) Subject: PsppireSelector: new properties: "source-widget" and "dest-widget". X-Git-Tag: sid-i386-build122~23 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c2fa3735ac1115b6c1ad4b5e0613673de2faf4c;p=pspp-builds.git PsppireSelector: new properties: "source-widget" and "dest-widget". Previously, a function psppire_selector_set_subjects was used to set the destination and source widgets of a PsppireSelector. This change adds two new properties, and sets them in the GtkBuilder definitions instead of in the C code. --- diff --git a/glade/psppire.xml b/glade/psppire.xml index 50a03661..5673d677 100644 --- a/glade/psppire.xml +++ b/glade/psppire.xml @@ -173,8 +173,9 @@ - - + + + diff --git a/src/ui/gui/compute-dialog.c b/src/ui/gui/compute-dialog.c index c09c7571..34f68616 100644 --- a/src/ui/gui/compute-dialog.c +++ b/src/ui/gui/compute-dialog.c @@ -403,7 +403,6 @@ compute_dialog (GObject *o, gpointer data) NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (var_selector), - dict_view, syntax_area, insert_source_row_into_text_view, NULL, NULL); @@ -412,7 +411,6 @@ compute_dialog (GObject *o, gpointer data) function_list_populate (GTK_TREE_VIEW (functions)); psppire_selector_set_subjects (PSPPIRE_SELECTOR (func_selector), - functions, syntax_area, insert_function_into_syntax_area, NULL, NULL); diff --git a/src/ui/gui/crosstabs-dialog.c b/src/ui/gui/crosstabs-dialog.c index 019d8c36..1fa3bff2 100644 --- a/src/ui/gui/crosstabs-dialog.c +++ b/src/ui/gui/crosstabs-dialog.c @@ -430,15 +430,11 @@ crosstabs_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (dest_cols), dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (row_selector), - source, - dest_rows, insert_source_row_into_tree_view, NULL, NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (col_selector), - source, - dest_cols, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/crosstabs.ui b/src/ui/gui/crosstabs.ui index c556c478..cb90d3cc 100644 --- a/src/ui/gui/crosstabs.ui +++ b/src/ui/gui/crosstabs.ui @@ -173,6 +173,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + dict-treeview + rows 1 @@ -188,6 +190,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + dict-treeview + cols 1 diff --git a/src/ui/gui/descriptives-dialog.c b/src/ui/gui/descriptives-dialog.c index 318646f8..1b49d921 100644 --- a/src/ui/gui/descriptives-dialog.c +++ b/src/ui/gui/descriptives-dialog.c @@ -232,8 +232,6 @@ descriptives_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (dest), dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - dest, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/descriptives.ui b/src/ui/gui/descriptives.ui index f5dc93f2..f43ed495 100644 --- a/src/ui/gui/descriptives.ui +++ b/src/ui/gui/descriptives.ui @@ -56,6 +56,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + all-variables + stat-variables diff --git a/src/ui/gui/dict-display.c b/src/ui/gui/dict-display.c index 1665d7ff..b06fcb4b 100644 --- a/src/ui/gui/dict-display.c +++ b/src/ui/gui/dict-display.c @@ -125,7 +125,12 @@ is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter, gint dict_index; gint *indeces; GtkTreePath *path; - const gchar *text = gtk_entry_get_text (GTK_ENTRY (selector->dest)); + GtkWidget *entry = NULL; + const gchar *text = NULL; + + g_object_get (selector, "dest-widget", &entry, NULL); + + text = gtk_entry_get_text (GTK_ENTRY (entry)); get_base_model (model, iter, &dict, &dict_iter); diff --git a/src/ui/gui/examine-dialog.c b/src/ui/gui/examine-dialog.c index 470c4dbb..85505f72 100644 --- a/src/ui/gui/examine-dialog.c +++ b/src/ui/gui/examine-dialog.c @@ -286,8 +286,6 @@ examine_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (dep_selector), - source, - ex_d.dep_list, insert_source_row_into_tree_view, NULL, NULL); @@ -298,15 +296,11 @@ examine_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (fct_selector), - source, - ex_d.fct_list, insert_source_row_into_tree_view, NULL, NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (id_selector), - source, - ex_d.id_entry, insert_source_row_into_entry, NULL, NULL); diff --git a/src/ui/gui/examine.ui b/src/ui/gui/examine.ui index 273c19bc..e2acfc3f 100644 --- a/src/ui/gui/examine.ui +++ b/src/ui/gui/examine.ui @@ -160,6 +160,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + treeview1 + entry1 1 @@ -177,6 +179,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + treeview1 + treeview3 1 @@ -194,6 +198,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + treeview1 + treeview2 1 diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 11ec0603..608a4d18 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -247,8 +247,6 @@ find_dialog (GObject *o, gpointer data) NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - fd.variable_entry, insert_source_row_into_entry, is_currently_in_entry, NULL diff --git a/src/ui/gui/frequencies-dialog.c b/src/ui/gui/frequencies-dialog.c index 8706f3a4..2f74e9d2 100644 --- a/src/ui/gui/frequencies-dialog.c +++ b/src/ui/gui/frequencies-dialog.c @@ -341,8 +341,6 @@ frequencies_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - dest, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/frequencies.ui b/src/ui/gui/frequencies.ui index 47e25d49..1a246578 100644 --- a/src/ui/gui/frequencies.ui +++ b/src/ui/gui/frequencies.ui @@ -56,6 +56,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 5 + dict-treeview + var-treeview diff --git a/src/ui/gui/oneway-anova-dialog.c b/src/ui/gui/oneway-anova-dialog.c index 1814dd67..ea390c33 100644 --- a/src/ui/gui/oneway-anova-dialog.c +++ b/src/ui/gui/oneway-anova-dialog.c @@ -177,14 +177,12 @@ oneway_anova_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1), - dict_view, ow.vars_treeview, insert_source_row_into_tree_view, NULL, NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2), - dict_view, ow.factor_entry, insert_source_row_into_entry, is_currently_in_entry, NULL); diff --git a/src/ui/gui/oneway.ui b/src/ui/gui/oneway.ui index 6ec3120f..a0f79145 100644 --- a/src/ui/gui/oneway.ui +++ b/src/ui/gui/oneway.ui @@ -109,6 +109,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + oneway-anova-treeview1 + oneway-anova-entry 1 @@ -126,6 +128,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + oneway-anova-treeview1 + oneway-anova-treeview2 1 diff --git a/src/ui/gui/psppire-selector.c b/src/ui/gui/psppire-selector.c index d6ea3375..8e0be3a3 100644 --- a/src/ui/gui/psppire-selector.c +++ b/src/ui/gui/psppire-selector.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation + Copyright (C) 2007, 2009 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -112,22 +112,49 @@ psppire_selector_get_type (void) return psppire_selector_type; } +static GObjectClass * parent_class = NULL; static void -psppire_selector_finalize (GObject *object) +psppire_selector_finalize (GObject *obj) { + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->finalize (obj); } + +static void +psppire_selector_dispose (GObject *obj) +{ + PsppireSelector *sel = PSPPIRE_SELECTOR (obj); + + if (sel->dispose_has_run) + return; + + /* Make sure dispose does not run twice. */ + sel->dispose_has_run = TRUE; + + g_object_unref (sel->dest); + g_object_unref (sel->source); + + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->dispose (obj); +} + + /* Properties */ enum { PROP_0, - PROP_ORIENTATION + PROP_ORIENTATION, + PROP_SOURCE_WIDGET, + PROP_DEST_WIDGET }; static void on_activate (PsppireSelector *selector, gpointer data); +static void update_subjects (PsppireSelector *selector); + static void psppire_selector_set_property (GObject *object, @@ -143,6 +170,14 @@ psppire_selector_set_property (GObject *object, selector->orientation = g_value_get_enum (value); set_direction (selector, selector->direction); break; + case PROP_SOURCE_WIDGET: + selector->source = g_value_dup_object (value); + update_subjects (selector); + break; + case PROP_DEST_WIDGET: + selector->dest = g_value_dup_object (value); + update_subjects (selector); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -163,6 +198,12 @@ psppire_selector_get_property (GObject *object, case PROP_ORIENTATION: g_value_set_enum (value, selector->orientation); break; + case PROP_SOURCE_WIDGET: + g_value_take_object (value, selector->source); + break; + case PROP_DEST_WIDGET: + g_value_take_object (value, selector->dest); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -183,6 +224,20 @@ psppire_selector_class_init (PsppireSelectorClass *class) PSPPIRE_SELECT_SOURCE_BEFORE_DEST /* default value */, G_PARAM_CONSTRUCT_ONLY |G_PARAM_READWRITE); + GParamSpec *source_widget_spec = + g_param_spec_object ("source-widget", + "Source Widget", + "The widget to be used as the source for this selector", + GTK_TYPE_WIDGET, + G_PARAM_READWRITE); + + GParamSpec *dest_widget_spec = + g_param_spec_object ("dest-widget", + "Destination Widget", + "The widget to be used as the destination for this selector", + GTK_TYPE_WIDGET, + G_PARAM_READWRITE); + object_class->set_property = psppire_selector_set_property; object_class->get_property = psppire_selector_get_property; @@ -191,6 +246,16 @@ psppire_selector_class_init (PsppireSelectorClass *class) PROP_ORIENTATION, orientation_spec); + g_object_class_install_property (object_class, + PROP_SOURCE_WIDGET, + source_widget_spec); + + g_object_class_install_property (object_class, + PROP_DEST_WIDGET, + dest_widget_spec); + + parent_class = g_type_class_peek_parent (class); + signals [SELECTED] = g_signal_new ("selected", G_TYPE_FROM_CLASS (class), @@ -219,6 +284,7 @@ psppire_selector_base_init (PsppireSelectorClass *class) GObjectClass *object_class = G_OBJECT_CLASS (class); object_class->finalize = psppire_selector_finalize; + object_class->dispose = psppire_selector_dispose; class->source_hash = g_hash_table_new (g_direct_hash, g_direct_equal); } @@ -251,6 +317,10 @@ psppire_selector_init (PsppireSelector *selector) g_signal_connect_swapped (selector->action, "activate", G_CALLBACK (on_activate), selector); selector->selecting = FALSE; + + selector->source = NULL; + selector->dest = NULL; + selector->dispose_has_run = FALSE; } @@ -682,7 +752,17 @@ on_dest_data_delete (GtkTreeModel *tree_model, } +static void +xxx (PsppireSelector *selector) +{ + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector->dest)); + + g_signal_connect (model, "row-changed", G_CALLBACK (on_dest_data_change), + selector); + g_signal_connect (model, "row-deleted", G_CALLBACK (on_dest_data_delete), + selector); +} /* Set the destination widget to DEST */ static void @@ -690,18 +770,16 @@ set_tree_view_dest (PsppireSelector *selector, GtkTreeView *dest) { GtkTreeSelection* selection = gtk_tree_view_get_selection (dest); - GtkTreeModel *model = gtk_tree_view_get_model (dest); + gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); g_signal_connect (selection, "changed", G_CALLBACK (on_dest_treeview_select), selector); - g_signal_connect (model, "row-changed", G_CALLBACK (on_dest_data_change), - selector); - g_signal_connect (model, "row-deleted", G_CALLBACK (on_dest_data_delete), - selector); + g_signal_connect_swapped (dest, "notify::model", + G_CALLBACK (xxx), selector); } @@ -777,53 +855,69 @@ set_entry_dest (PsppireSelector *selector, G_CALLBACK (on_row_inserted), selector); } - -/* Set SOURCE and DEST for this selector, and - set SELECT_FUNC and FILTER_FUNC */ -void -psppire_selector_set_subjects (PsppireSelector *selector, - GtkWidget *source, - GtkWidget *dest, - SelectItemsFunc *select_func, - FilterItemsFunc *filter_func, - gpointer user_data) +static void +update_subjects (PsppireSelector *selector) { - g_assert(selector); + GtkTreeModel *model = NULL; - selector->filter = filter_func ; + if ( NULL == selector->dest ) + return; - selector->source = source; - selector->dest = dest; - selector->select_user_data = user_data; + if ( NULL == selector->source ) + return; - if ( filter_func == NULL) - { - if (GTK_IS_TREE_VIEW (dest)) - selector->filter = is_item_in_dest; - } + g_signal_connect_swapped (selector->source, "notify::dictionary", + G_CALLBACK (update_subjects), selector); - if ( GTK_IS_TREE_VIEW (source)) - set_tree_view_source (selector, GTK_TREE_VIEW (source) ); - else - g_error ("Unsupported source widget: %s", G_OBJECT_TYPE_NAME (source)); + g_signal_connect_swapped (selector->source, "notify::model", + G_CALLBACK (update_subjects), selector); + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (selector->source)); - g_assert ( GTK_IS_TREE_MODEL_FILTER (selector->filtered_source)); + if ( NULL == model) + return; - if ( NULL == dest) + + if ( GTK_IS_TREE_VIEW (selector->source)) + set_tree_view_source (selector, GTK_TREE_VIEW (selector->source) ); + else + g_error ("Unsupported source widget: %s", G_OBJECT_TYPE_NAME (selector->source)); + + if ( NULL == selector->dest) ; - else if ( GTK_IS_TREE_VIEW (dest)) - set_tree_view_dest (selector, GTK_TREE_VIEW (dest)); + else if ( GTK_IS_TREE_VIEW (selector->dest)) + { + set_tree_view_dest (selector, GTK_TREE_VIEW (selector->dest)); + } - else if ( GTK_IS_ENTRY (dest)) - set_entry_dest (selector, GTK_ENTRY (dest)); + else if ( GTK_IS_ENTRY (selector->dest)) + set_entry_dest (selector, GTK_ENTRY (selector->dest)); - else if (GTK_IS_TEXT_VIEW (dest)) + else if (GTK_IS_TEXT_VIEW (selector->dest)) { /* Nothing to be done */ } - else - g_error ("Unsupported destination widget: %s", G_OBJECT_TYPE_NAME (dest)); + g_error ("Unsupported destination widget: %s", G_OBJECT_TYPE_NAME (selector->dest)); + +} + + +/* Set SELECT_FUNC and FILTER_FUNC for this selector */ +void +psppire_selector_set_subjects (PsppireSelector *selector, + SelectItemsFunc *select_func, + FilterItemsFunc *filter_func, + gpointer user_data) +{ + selector->filter = filter_func ; + selector->select_user_data = user_data; + + if ( filter_func == NULL) + { + if (GTK_IS_TREE_VIEW (selector->dest)) + selector->filter = is_item_in_dest; + } selector->select_items = select_func; } @@ -831,7 +925,7 @@ psppire_selector_set_subjects (PsppireSelector *selector, void -psppire_selector_set_allow (PsppireSelector *selector , AllowSelectionFunc *allow) +psppire_selector_set_allow (PsppireSelector *selector, AllowSelectionFunc *allow) { selector->allow_selection = allow; } diff --git a/src/ui/gui/psppire-selector.h b/src/ui/gui/psppire-selector.h index 6fff5d42..8174f97c 100644 --- a/src/ui/gui/psppire-selector.h +++ b/src/ui/gui/psppire-selector.h @@ -77,7 +77,10 @@ struct _PsppireSelector GtkWidget *arrow; GtkAction *action; + gboolean dispose_has_run; + enum psppire_selector_dir direction; + GtkWidget *source; GtkWidget *dest; @@ -111,8 +114,6 @@ struct _PsppireSelectorClass GType psppire_selector_get_type (void); GtkWidget* psppire_selector_new (void); void psppire_selector_set_subjects (PsppireSelector *, - GtkWidget *, - GtkWidget *, SelectItemsFunc *, FilterItemsFunc *, gpointer ); diff --git a/src/ui/gui/psppire.ui b/src/ui/gui/psppire.ui index 06cce7be..99d9ed06 100644 --- a/src/ui/gui/psppire.ui +++ b/src/ui/gui/psppire.ui @@ -85,6 +85,8 @@ False False 5 + weight-cases-treeview + weight-cases-entry 0 @@ -324,6 +326,8 @@ False False 5 + source-treeview + new-name-entry 1 @@ -338,6 +342,8 @@ False False 5 + source-treeview + variables-treeview @@ -501,6 +507,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + split-file-dict-treeview + split-file-grouping-vars @@ -821,6 +829,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + compute-treeview1 + compute-textview1 False @@ -934,6 +944,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 source below destination + compute-treeview2 + compute-textview1 False @@ -1241,6 +1253,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + select-cases-treeview + filter-variable-entry False diff --git a/src/ui/gui/rank-dialog.c b/src/ui/gui/rank-dialog.c index b2894095..ec3cccfa 100644 --- a/src/ui/gui/rank-dialog.c +++ b/src/ui/gui/rank-dialog.c @@ -311,8 +311,6 @@ rank_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (rd.rank_vars), rd.dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1), - vars, - rd.rank_vars, insert_source_row_into_tree_view, NULL, NULL); @@ -320,8 +318,6 @@ rank_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (rd.group_vars), rd.dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2), - vars, - rd.group_vars, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/rank.ui b/src/ui/gui/rank.ui index 5b7d6f4b..1b2a8245 100644 --- a/src/ui/gui/rank.ui +++ b/src/ui/gui/rank.ui @@ -144,6 +144,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + dict-treeview + group-vars-treeview 1 @@ -161,6 +163,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + dict-treeview + variables-treeview 1 diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c index 0bb82eb3..c3e48a88 100644 --- a/src/ui/gui/recode-dialog.c +++ b/src/ui/gui/recode-dialog.c @@ -952,8 +952,6 @@ recode_dialog (PsppireDataWindow *de, gboolean diff) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - rd.dict_treeview, - rd.variable_treeview, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/recode.ui b/src/ui/gui/recode.ui index 4acd7fc4..711a4eaf 100644 --- a/src/ui/gui/recode.ui +++ b/src/ui/gui/recode.ui @@ -720,6 +720,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + treeview1 + treeview2 1 diff --git a/src/ui/gui/regression-dialog.c b/src/ui/gui/regression-dialog.c index eaca17e0..87101397 100644 --- a/src/ui/gui/regression-dialog.c +++ b/src/ui/gui/regression-dialog.c @@ -260,15 +260,11 @@ regression_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (dest_indep), rd.dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (dep_selector), - source, - dest_dep, insert_source_row_into_tree_view, NULL, NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (indep_selector), - source, - dest_indep, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/regression.ui b/src/ui/gui/regression.ui index 190e6866..437a1f6b 100644 --- a/src/ui/gui/regression.ui +++ b/src/ui/gui/regression.ui @@ -67,6 +67,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 5 + dict-view + dep-view 1 @@ -83,6 +85,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 5 + dict-view + indep-view 1 diff --git a/src/ui/gui/reliability-dialog.c b/src/ui/gui/reliability-dialog.c index 66c8bf5c..6b824361 100644 --- a/src/ui/gui/reliability-dialog.c +++ b/src/ui/gui/reliability-dialog.c @@ -143,8 +143,6 @@ reliability_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (rd.variables), rd.dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - rd.variables, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/reliability.ui b/src/ui/gui/reliability.ui index a4236b77..364ea893 100644 --- a/src/ui/gui/reliability.ui +++ b/src/ui/gui/reliability.ui @@ -70,6 +70,8 @@ True True 5 + dict-view + treeview2 diff --git a/src/ui/gui/select-cases-dialog.c b/src/ui/gui/select-cases-dialog.c index 56b10d2c..c46595c6 100644 --- a/src/ui/gui/select-cases-dialog.c +++ b/src/ui/gui/select-cases-dialog.c @@ -332,8 +332,6 @@ select_cases_dialog (GObject *o, gpointer data) GTK_SELECTION_SINGLE, NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - entry, insert_source_row_into_entry, is_currently_in_entry, NULL); diff --git a/src/ui/gui/sort-cases-dialog.c b/src/ui/gui/sort-cases-dialog.c index cde70ccf..242b7d3c 100644 --- a/src/ui/gui/sort-cases-dialog.c +++ b/src/ui/gui/sort-cases-dialog.c @@ -117,8 +117,6 @@ sort_cases_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (dest), scd.dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - dest, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/sort.ui b/src/ui/gui/sort.ui index c7e4b2d4..b80affaf 100644 --- a/src/ui/gui/sort.ui +++ b/src/ui/gui/sort.ui @@ -51,6 +51,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + sort-cases-treeview1 + sort-cases-treeview2 diff --git a/src/ui/gui/split-file-dialog.c b/src/ui/gui/split-file-dialog.c index 613f8e91..8ae69213 100644 --- a/src/ui/gui/split-file-dialog.c +++ b/src/ui/gui/split-file-dialog.c @@ -198,8 +198,6 @@ split_file_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (dest), sfd.dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - dest, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/t-test-independent-samples-dialog.c b/src/ui/gui/t-test-independent-samples-dialog.c index 5d77ce43..03cce8d4 100644 --- a/src/ui/gui/t-test-independent-samples-dialog.c +++ b/src/ui/gui/t-test-independent-samples-dialog.c @@ -432,7 +432,6 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1), - dict_view, test_variables_treeview, insert_source_row_into_tree_view, NULL, NULL); @@ -442,7 +441,6 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2), - dict_view, tt_d.groups_entry, insert_source_row_into_entry, is_currently_in_entry, NULL); diff --git a/src/ui/gui/t-test-one-sample.c b/src/ui/gui/t-test-one-sample.c index 8b2d8af7..5e5f35e4 100644 --- a/src/ui/gui/t-test-one-sample.c +++ b/src/ui/gui/t-test-one-sample.c @@ -157,7 +157,6 @@ t_test_one_sample_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - dict_view, tt_d.vars_treeview, insert_source_row_into_tree_view, NULL, NULL); diff --git a/src/ui/gui/t-test-paired-samples.c b/src/ui/gui/t-test-paired-samples.c index 15b99ad2..1e14dfa1 100644 --- a/src/ui/gui/t-test-paired-samples.c +++ b/src/ui/gui/t-test-paired-samples.c @@ -229,8 +229,6 @@ t_test_paired_samples_dialog (GObject *o, gpointer data) psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - dict_view, - tt_d.pairs_treeview, select_as_pair_member, NULL, &tt_d); diff --git a/src/ui/gui/t-test.ui b/src/ui/gui/t-test.ui index 74d8d068..48ac0940 100644 --- a/src/ui/gui/t-test.ui +++ b/src/ui/gui/t-test.ui @@ -93,6 +93,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + indep-samples-t-test-treeview1 + indep-samples-t-test-treeview2 @@ -106,6 +108,8 @@ True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 5 + indep-samples-t-test-treeview1 + indep-samples-t-test-entry 1 @@ -681,6 +685,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 5 + one-sample-t-test-treeview2 + one-sample-t-test-treeview1 @@ -741,6 +747,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True 5 + paired-samples-t-test-treeview1 + paired-samples-t-test-treeview2 diff --git a/src/ui/gui/transpose-dialog.c b/src/ui/gui/transpose-dialog.c index 36640f6f..1d8744d5 100644 --- a/src/ui/gui/transpose-dialog.c +++ b/src/ui/gui/transpose-dialog.c @@ -91,7 +91,6 @@ transpose_dialog (GObject *o, gpointer data) GtkWidget *dest = get_widget_assert (xml, "variables-treeview"); GtkWidget *selector1 = get_widget_assert (xml, "psppire-selector2"); GtkWidget *selector2 = get_widget_assert (xml, "psppire-selector3"); - GtkWidget *new_name_entry = get_widget_assert (xml, "new-name-entry"); g_object_get (de->data_editor, "var-store", &vs, NULL); @@ -101,14 +100,12 @@ transpose_dialog (GObject *o, gpointer data) set_dest_model (GTK_TREE_VIEW (dest), dict); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector1), - source, dest, insert_source_row_into_tree_view, NULL, NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector2), - source, new_name_entry, insert_source_row_into_entry, is_currently_in_entry, NULL); diff --git a/src/ui/gui/weight-cases-dialog.c b/src/ui/gui/weight-cases-dialog.c index b3087159..b43d49c3 100644 --- a/src/ui/gui/weight-cases-dialog.c +++ b/src/ui/gui/weight-cases-dialog.c @@ -138,15 +138,11 @@ weight_cases_dialog (GObject *o, gpointer data) NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), - source, - entry, insert_source_row_into_entry, is_currently_in_entry, NULL ); - - wcd.entry = GTK_ENTRY (entry); wcd.status = GTK_LABEL (status); wcd.off = GTK_TOGGLE_BUTTON (radiobutton1);