PsppireSelector: new properties: "source-widget" and "dest-widget".
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 15 Nov 2009 21:30:18 +0000 (22:30 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 15 Nov 2009 21:30:18 +0000 (22:30 +0100)
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.

35 files changed:
glade/psppire.xml
src/ui/gui/compute-dialog.c
src/ui/gui/crosstabs-dialog.c
src/ui/gui/crosstabs.ui
src/ui/gui/descriptives-dialog.c
src/ui/gui/descriptives.ui
src/ui/gui/dict-display.c
src/ui/gui/examine-dialog.c
src/ui/gui/examine.ui
src/ui/gui/find-dialog.c
src/ui/gui/frequencies-dialog.c
src/ui/gui/frequencies.ui
src/ui/gui/oneway-anova-dialog.c
src/ui/gui/oneway.ui
src/ui/gui/psppire-selector.c
src/ui/gui/psppire-selector.h
src/ui/gui/psppire.ui
src/ui/gui/rank-dialog.c
src/ui/gui/rank.ui
src/ui/gui/recode-dialog.c
src/ui/gui/recode.ui
src/ui/gui/regression-dialog.c
src/ui/gui/regression.ui
src/ui/gui/reliability-dialog.c
src/ui/gui/reliability.ui
src/ui/gui/select-cases-dialog.c
src/ui/gui/sort-cases-dialog.c
src/ui/gui/sort.ui
src/ui/gui/split-file-dialog.c
src/ui/gui/t-test-independent-samples-dialog.c
src/ui/gui/t-test-one-sample.c
src/ui/gui/t-test-paired-samples.c
src/ui/gui/t-test.ui
src/ui/gui/transpose-dialog.c
src/ui/gui/weight-cases-dialog.c

index 50a0366186ea4da876516362fec16840196e5e63..5673d6779bbb3a85029b88f5512e1af0ac8ce24a 100644 (file)
          </displayable-values>
        </property>
 
-
-       <property id="visible" ignore="True" default="True" />
+       <property id="source-widget"     ignore="True" />
+       <property id="dest-widget"       ignore="True" />
+       <property id="visible"           ignore="True" default="True" />
      </properties>
 
     </glade-widget-class>
index c09c7571936fa4e4ca493bd0647b2586629caa6d..34f686162b44db3e94edbf08c826a0c10ea42bb4 100644 (file)
@@ -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);
index 019d8c361dffe49c35b58b2f2799f701abd392b8..1fa3bff21a3c50dccf791daaa2ffd468c209dc93 100644 (file)
@@ -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);
index c556c47816b147dc4de5c062a24add6676a7f01f..cb90d3cc7bf1759b57838b5f7c1fb9f28ad29f4b 100644 (file)
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="border_width">5</property>
+                <property name="source_widget">dict-treeview</property>
+                <property name="dest_widget">rows</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="border_width">5</property>
+                <property name="source_widget">dict-treeview</property>
+                <property name="dest_widget">cols</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
index 318646f8ef87a4eff2002a092f7d6a111a6e70f1..1b49d92130839f9db49f0d3cc8d57390043bd1b7 100644 (file)
@@ -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);
index f5dc93f2423719539725a27d19984f157a1e8c75..f43ed49566f566c9baa9c5ff854fdd8f5922122b 100644 (file)
@@ -56,6 +56,8 @@
                         <property name="receives_default">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="border_width">5</property>
+                        <property name="source_widget">all-variables</property>
+                        <property name="dest_widget">stat-variables</property>
                       </object>
                     </child>
                   </object>
index 1665d7ff3f7a3c0a4bc8e1b4ebeb12b99cc8cfb9..b06fcb4b53ab793281478560776c3dc5d8293dfc 100644 (file)
@@ -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);
 
index 470c4dbbe37797ac23e23d3430741c56da0aa94b..85505f72bbb349c607a50721f900cfd658b00a2f 100644 (file)
@@ -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);
 
index 273c19bc8d054409a4668863e02d13494fcd8e13..e2acfc3f2379bb1891648d4ffc955eb06b5c5ac3 100644 (file)
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">treeview1</property>
+                    <property name="dest_widget">entry1</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">treeview1</property>
+                    <property name="dest_widget">treeview3</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">treeview1</property>
+                    <property name="dest_widget">treeview2</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
index 11ec0603d4dfd98ee65954b1fed34af49feb4bc2..608a4d187cf8e5ce653674ad8e2be941538541bc 100644 (file)
@@ -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
index 8706f3a4e63ac105e0caee6a46e597cee048fc40..2f74e9d2636f03daca2627c0c414eafcb18b85b6 100644 (file)
@@ -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);
index 47e25d49f3ddcd6e3bd69942e3e1940e95c0d10e..1a24657850edd6d76c061d0bd10d81ca8c3c6eab 100644 (file)
@@ -56,6 +56,8 @@
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="no_show_all">True</property>
                         <property name="border_width">5</property>
+                        <property name="source_widget">dict-treeview</property>
+                        <property name="dest_widget">var-treeview</property>
                       </object>
                     </child>
                   </object>
index 1814dd6737562a1d922722141d9e6c6f3c2b0a63..ea390c334275f797b4069fd793b994d02b3827fa 100644 (file)
@@ -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);
index 6ec3120fa608a9fa8e721c0bf1a117fc1ebdab6e..a0f7914543eefab02e4c1c694d4e4c4efac28462 100644 (file)
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="border_width">5</property>
+                <property name="source_widget">oneway-anova-treeview1</property>
+                <property name="dest_widget">oneway-anova-entry</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
                 <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="border_width">5</property>
+                <property name="source_widget">oneway-anova-treeview1</property>
+                <property name="dest_widget">oneway-anova-treeview2</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
index d6ea3375257186d0566aa8a7706da717030db17c..8e0be3a3590b37015877e4b7ebb452c006f6e900 100644 (file)
@@ -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;
 }
index 6fff5d4269da20286062e0f8c36def77374f1fa5..8174f97c8f5f4a20a1888774e75a05e72402d1fc 100644 (file)
@@ -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 );
index 06cce7beebebacc5a372154f537e8a593d2dee74..99d9ed06e0db861293070fcf5d6827f2071dce4d 100644 (file)
@@ -85,6 +85,8 @@
                                 <property name="can_focus">False</property>
                                 <property name="receives_default">False</property>
                                 <property name="border_width">5</property>
+                                <property name="source_widget">weight-cases-treeview</property>
+                                <property name="dest_widget">weight-cases-entry</property>
                               </object>
                               <packing>
                                 <property name="position">0</property>
                     <property name="can_focus">False</property>
                     <property name="receives_default">False</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">source-treeview</property>
+                    <property name="dest_widget">new-name-entry</property>
                   </object>
                   <packing>
                     <property name="top_attach">1</property>
                     <property name="can_focus">False</property>
                     <property name="receives_default">False</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">source-treeview</property>
+                    <property name="dest_widget">variables-treeview</property>
                   </object>
                   <packing>
                     <property name="x_options"></property>
                                 <property name="receives_default">True</property>
                                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                 <property name="border_width">5</property>
+                                <property name="source_widget">split-file-dict-treeview</property>
+                                <property name="dest_widget">split-file-grouping-vars</property>
                               </object>
                             </child>
                           </object>
                         <property name="receives_default">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="border_width">5</property>
+                        <property name="source_widget">compute-treeview1</property>
+                        <property name="dest_widget">compute-textview1</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                             <property name="border_width">5</property>
                             <property name="orientation">source below destination</property>
+                            <property name="source_widget">compute-treeview2</property>
+                            <property name="dest_widget">compute-textview1</property>
                           </object>
                           <packing>
                             <property name="fill">False</property>
                                             <property name="receives_default">True</property>
                                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                                             <property name="border_width">5</property>
+                                            <property name="source_widget">select-cases-treeview</property>
+                                            <property name="dest_widget">filter-variable-entry</property>
                                           </object>
                                           <packing>
                                             <property name="expand">False</property>
index b2894095b76c69335e6b3f73d3276305967b5787..ec3cccfaa3afa97a8feb3e65a97d4f6f43751feb 100644 (file)
@@ -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);
index 5b7d6f4b27f471ef1735b5c1e17b3767687ccd2d..1b2a8245d5b5210e9a73cd6a8be14c38cd81c5d4 100644 (file)
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">dict-treeview</property>
+                    <property name="dest_widget">group-vars-treeview</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">dict-treeview</property>
+                    <property name="dest_widget">variables-treeview</property>
                   </object>
                   <packing>
                     <property name="left_attach">1</property>
index 0bb82eb335a9a6d3c75a13f6c1cf34e47863c8a3..c3e48a882b72b7bb3966f3649ebd51241b5fb55f 100644 (file)
@@ -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);
index 4acd7fc4c44be92ec4f828f19cca6757db8deda4..711a4eafb631e337c55c35b42db03b420e2e1521 100644 (file)
             <property name="receives_default">True</property>
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
             <property name="border_width">5</property>
+            <property name="source_widget">treeview1</property>
+            <property name="dest_widget">treeview2</property>
           </object>
           <packing>
             <property name="left_attach">1</property>
index eaca17e074e49aef32c5cbbb7447ef3c012b94b8..87101397be361c27e37d1183a72807f82d5bc9f4 100644 (file)
@@ -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);
index 190e686671fd38378a78de0f94f8a10ed284d9f1..437a1f6b088a7ad6bd6901e82f441417b69c920f 100644 (file)
@@ -67,6 +67,8 @@
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="no_show_all">True</property>
                 <property name="border_width">5</property>
+                <property name="source_widget">dict-view</property>
+                <property name="dest_widget">dep-view</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
@@ -83,6 +85,8 @@
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="no_show_all">True</property>
                 <property name="border_width">5</property>
+                <property name="source_widget">dict-view</property>
+                <property name="dest_widget">indep-view</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
index 66c8bf5ce4b3eed41425643db8bd3eb5ec043790..6b8243610e25aad4f8925011836478911cc5b3f3 100644 (file)
@@ -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);
index a4236b77a18aa75eb2a6489d2787ca515efd695d..364ea89387c3694594923eb1750d209255066506 100644 (file)
@@ -70,6 +70,8 @@
                         <property name="receives_default">True</property>
                         <property name="no_show_all">True</property>
                         <property name="border_width">5</property>
+                        <property name="source_widget">dict-view</property>
+                        <property name="dest_widget">treeview2</property>
                       </object>
                     </child>
                   </object>
index 56b10d2c5482e382da1b8b2df32f5646bb8fe127..c46595c65ef8d12e76669d4863673c254e890402 100644 (file)
@@ -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);
index cde70ccf83074fc65ac9b54ae94c423f41dddb60..242b7d3c07392b8ecca08bb46cb67ad91eb26238 100644 (file)
@@ -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);
index c7e4b2d40310aaeb7bf0b43c06691bfc3221d5a4..b80affaf099bc1e9b76cc429f5d22fb18ad3b232 100644 (file)
@@ -51,6 +51,8 @@
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">sort-cases-treeview1</property>
+                    <property name="dest_widget">sort-cases-treeview2</property>
                   </object>
                 </child>
               </object>
index 613f8e91fe601cf544f32bb62933c00211c3869a..8ae69213c2ebb630b81c80b5f324e43fa9e02e02 100644 (file)
@@ -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);
index 5d77ce43031ea7e46b37c3f0de57e9f9a22e67eb..03cce8d4430291930859cae982a499ed5f1ededd 100644 (file)
@@ -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);
index 8b2d8af795e055552e3cec44981e1e6b5f2ed4f9..5e5f35e4c7359249c6a18941c1010e4984937f04 100644 (file)
@@ -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);
index 15b99ad21914c6e3b119b5ab810dc54e6941dc48..1e14dfa17767f196007057f7b18505e10bf81b75 100644 (file)
@@ -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);
index 74d8d0682d1f2b56afb5f5e1d12a44ef81473705..48ac09401a714a992afc6470ef85d6b1b1051183 100644 (file)
@@ -93,6 +93,8 @@
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">indep-samples-t-test-treeview1</property>
+                    <property name="dest_widget">indep-samples-t-test-treeview2</property>
                   </object>
                   <packing>
                     <property name="x_options"></property>
                     <property name="receives_default">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">indep-samples-t-test-treeview1</property>
+                    <property name="dest_widget">indep-samples-t-test-entry</property>
                   </object>
                   <packing>
                     <property name="top_attach">1</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                 <property name="no_show_all">True</property>
                 <property name="border_width">5</property>
+                <property name="source_widget">one-sample-t-test-treeview2</property>
+                <property name="dest_widget">one-sample-t-test-treeview1</property>
               </object>
             </child>
           </object>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="no_show_all">True</property>
                     <property name="border_width">5</property>
+                    <property name="source_widget">paired-samples-t-test-treeview1</property>
+                    <property name="dest_widget">paired-samples-t-test-treeview2</property>
                   </object>
                 </child>
               </object>
index 36640f6f752a71829b391c1310a243d97de8eb17..1d8744d5ee3232429735ee26b89606393533ab52 100644 (file)
@@ -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);
index b3087159f941adf7d16b7d2dc1d66f7165ee38d5..b43d49c3f50d64c244b4ff17ee62877def5a68cf 100644 (file)
@@ -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);