X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Ffrequencies-dialog.c;h=2d5fcbb48d9f23485ab3b093c0bfe80fa273b80c;hb=fd0c595927a23ea0373551a1eed4570388ea0fc5;hp=89cf7683e890cfad1ca97697047ae29fe77be832;hpb=a1efcf97ca2f75f4be6a0389ff2372c03ed2d4e1;p=pspp-builds.git diff --git a/src/ui/gui/frequencies-dialog.c b/src/ui/gui/frequencies-dialog.c index 89cf7683..2d5fcbb4 100644 --- a/src/ui/gui/frequencies-dialog.c +++ b/src/ui/gui/frequencies-dialog.c @@ -18,18 +18,19 @@ #include "checkbox-treeview.h" #include "frequencies-dialog.h" +#include "psppire-var-view.h" #include #include #include -#include +#include #include #include #include #include #include -#include +#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="); @@ -307,7 +308,7 @@ void frequencies_dialog (GObject *o, gpointer data) { gint response; - struct data_editor *de = data; + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); struct frequencies_dialog fd; @@ -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"); @@ -331,25 +331,12 @@ frequencies_dialog (GObject *o, gpointer data) ); - gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); - - 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); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); + 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"); @@ -369,7 +356,7 @@ frequencies_dialog (GObject *o, gpointer data) fd.current_opts.limit = 50; - gtk_window_set_transient_for (GTK_WINDOW (fd.format_dialog), de->parent.window); + gtk_window_set_transient_for (GTK_WINDOW (fd.format_dialog), GTK_WINDOW (de)); g_signal_connect (dialog, "refresh", G_CALLBACK (refresh), &fd); @@ -393,6 +380,7 @@ frequencies_dialog (GObject *o, gpointer data) case GTK_RESPONSE_OK: { gchar *syntax = generate_syntax (&fd); + struct getl_interface *sss = create_syntax_string_source (syntax); execute_syntax (sss); @@ -402,12 +390,7 @@ frequencies_dialog (GObject *o, gpointer data) case PSPPIRE_RESPONSE_PASTE: { gchar *syntax = generate_syntax (&fd); - - struct syntax_editor *se = - (struct syntax_editor *) window_create (WINDOW_SYNTAX, NULL); - - gtk_text_buffer_insert_at_cursor (se->buffer, syntax, -1); - + paste_syntax_in_new_window (syntax); g_free (syntax); } break;