New module psppire-var-view
[pspp-builds.git] / src / ui / gui / frequencies-dialog.c
index 37e301b88babb099490ed752a075e5e7f44da9f5..2d5fcbb48d9f23485ab3b093c0bfe80fa273b80c 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "checkbox-treeview.h"
 #include "frequencies-dialog.h"
+#include "psppire-var-view.h"
 
 #include <gtk/gtk.h>
 #include <stdlib.h>
@@ -29,7 +30,7 @@
 #include <ui/gui/helper.h>
 #include <ui/gui/psppire-dialog.h>
 #include <ui/gui/psppire-var-store.h>
-#include <ui/gui/helper.h>
+#include "executor.h"
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
@@ -147,7 +148,7 @@ generate_syntax (const struct frequencies_dialog *fd)
   GString *string = g_string_new ("FREQUENCIES");
 
   g_string_append (string, "\n\t/VARIABLES=");
-  append_variable_names (string, fd->dict, GTK_TREE_VIEW (fd->stat_vars), 0);
+  psppire_var_view_append_names (PSPPIRE_VAR_VIEW (fd->stat_vars), 0, string);
 
   g_string_append (string, "\n\t/FORMAT=");
 
@@ -316,7 +317,6 @@ frequencies_dialog (GObject *o, gpointer data)
   GtkWidget *dialog = get_widget_assert   (xml, "frequencies-dialog");
   GtkWidget *source = get_widget_assert   (xml, "dict-treeview");
   GtkWidget *dest =   get_widget_assert   (xml, "var-treeview");
-  GtkWidget *selector = get_widget_assert (xml, "selector1");
   GtkWidget *format_button = get_widget_assert (xml, "button1");
   GtkWidget *stats_treeview = get_widget_assert (xml, "stats-treeview");
 
@@ -333,23 +333,10 @@ frequencies_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);
-
-  set_dest_model (GTK_TREE_VIEW (dest), vs->dict);
-
-
-  psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
-                                source,
-                                dest,
-                                insert_source_row_into_tree_view,
-                                NULL,
-                                NULL);
-
+  g_object_get (vs, "dictionary", &fd.dict, NULL);
+  g_object_set (source, "model", fd.dict, NULL);
 
   fd.stat_vars = GTK_TREE_VIEW (dest);
-  fd.dict = vs->dict;
   fd.table_button = get_widget_assert (xml, "checkbutton1");
   fd.format_dialog = get_widget_assert (xml, "format-dialog");
   fd.maximum_cats = get_widget_assert (xml, "hbox5");