Separated psppire_selector_set_subjects into two individual functions
[pspp-builds.git] / src / ui / gui / crosstabs-dialog.c
index 188c4aaa92c66c339c829bef59df4748f6e23516..8198520d6b686222f518dc4664d32d7db007b28d 100644 (file)
@@ -26,7 +26,7 @@
 #include <ui/gui/psppire-data-window.h>
 #include <ui/gui/dialog-common.h>
 #include <ui/gui/dict-display.h>
-#include "helper.h"
+#include "executor.h"
 #include <ui/gui/psppire-dialog.h>
 #include <ui/gui/psppire-var-store.h>
 #include <ui/gui/helper.h>
@@ -389,6 +389,7 @@ crosstabs_dialog (GObject *o, gpointer data)
 
   GtkBuilder *xml = builder_new ("crosstabs.ui");
   PsppireVarStore *vs = NULL;
+  PsppireDict *dict = NULL;
 
   PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data);
 
@@ -422,30 +423,23 @@ crosstabs_dialog (GObject *o, gpointer data)
 
   gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de));
 
-  attach_dictionary_to_treeview (GTK_TREE_VIEW (source),
-                                vs->dict,
-                                GTK_SELECTION_MULTIPLE, NULL);
+  g_object_get (vs, "dictionary", &dict, NULL);
+  g_object_set (source, "model", dict, NULL);
 
-  set_dest_model (GTK_TREE_VIEW (dest_rows), vs->dict);
-  set_dest_model (GTK_TREE_VIEW (dest_cols), vs->dict);
+  set_dest_model (GTK_TREE_VIEW (dest_rows), dict);
+  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_select_func (PSPPIRE_SELECTOR (row_selector),
+                                   insert_source_row_into_tree_view,
+                                   NULL);
 
-  psppire_selector_set_subjects (PSPPIRE_SELECTOR (col_selector),
-                                source,
-                                dest_cols,
-                                insert_source_row_into_tree_view,
-                                NULL,
-                                NULL);
+  psppire_selector_set_select_func (PSPPIRE_SELECTOR (col_selector),
+                                   insert_source_row_into_tree_view,
+                                   NULL);
 
   cd.row_vars = GTK_TREE_VIEW (dest_rows);
   cd.col_vars = GTK_TREE_VIEW (dest_cols);
-  cd.dict = vs->dict;
+  g_object_get (vs, "dictionary", &cd.dict, NULL);
   cd.format_dialog = get_widget_assert (xml, "format-dialog");
   cd.table_button = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "print-tables"));
   cd.pivot_button = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "pivot"));