X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fsplit-file-dialog.c;h=5acc9c505c7399b2b274f5d599f1eaafdfab133f;hb=64a18d9cb2657b541ebf39c9a064edc92101f2f3;hp=00f30c627080d53f96848d96c1c7ba4aca128ea7;hpb=a1efcf97ca2f75f4be6a0389ff2372c03ed2d4e1;p=pspp-builds.git diff --git a/src/ui/gui/split-file-dialog.c b/src/ui/gui/split-file-dialog.c index 00f30c62..5acc9c50 100644 --- a/src/ui/gui/split-file-dialog.c +++ b/src/ui/gui/split-file-dialog.c @@ -19,13 +19,15 @@ #include "split-file-dialog.h" #include "psppire-selector.h" #include "psppire-dialog.h" -#include "helper.h" -#include "data-editor.h" +#include "executor.h" +#include "psppire-data-window.h" #include "dict-display.h" #include -#include "syntax-editor.h" +#include "helper.h" #include +#include "psppire-var-view.h" + #include @@ -68,8 +70,7 @@ generate_syntax (const struct split_file_dialog *sfd) GString * varlist = g_string_sized_new (80); GtkWidget *sort = get_widget_assert (sfd->xml, "split-radiobutton3"); GtkWidget *layered = get_widget_assert (sfd->xml, "split-radiobutton1"); - gint n_vars = append_variable_names (varlist, - sfd->dict, GTK_TREE_VIEW (vars), 0); + gint n_vars = psppire_var_view_append_names (PSPPIRE_VAR_VIEW (vars), 0, varlist); if ( n_vars > 0 ) { @@ -163,10 +164,9 @@ refresh (PsppireDialog *dialog, struct split_file_dialog *d) /* Pops up the Split File dialog box */ void -split_file_dialog (GObject *o, gpointer data) +split_file_dialog (PsppireDataWindow *de) { gint response; - struct data_editor *de = data; struct split_file_dialog sfd; PsppireVarStore *vs ; @@ -186,31 +186,18 @@ split_file_dialog (GObject *o, gpointer data) g_object_get (de->data_editor, "var-store", &vs, NULL); - sfd.dict = vs->dict; + g_object_get (vs, "dictionary", &sfd.dict, NULL); sfd.tv = GTK_TREE_VIEW (dest); sfd.selector = PSPPIRE_SELECTOR ( get_widget_assert (sfd.xml, "split-file-selector")); - attach_dictionary_to_treeview (GTK_TREE_VIEW (source), - vs->dict, - GTK_SELECTION_MULTIPLE, NULL); - + g_object_set (source, "model", sfd.dict, NULL); g_signal_connect (on_off, "toggled", G_CALLBACK(on_off_toggled), sfd.xml); - - 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_signal_connect (dialog, "refresh", G_CALLBACK (refresh), &sfd); - gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); response = psppire_dialog_run (PSPPIRE_DIALOG (dialog)); @@ -220,6 +207,7 @@ split_file_dialog (GObject *o, gpointer data) case GTK_RESPONSE_OK: { gchar *syntax = generate_syntax (&sfd); + struct getl_interface *sss = create_syntax_string_source (syntax); execute_syntax (sss); @@ -229,11 +217,7 @@ split_file_dialog (GObject *o, gpointer data) case PSPPIRE_RESPONSE_PASTE: { gchar *syntax = generate_syntax (&sfd); - - 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); }