X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fcompute-dialog.c;h=e779fba6d7f7c847144d1d6254ad57354bb705e2;hb=729b96a6bd9342c45e6f65a113fd87c70da85b0a;hp=76b9a7d1ce5e48d58faffc1810f78872bc763183;hpb=a1efcf97ca2f75f4be6a0389ff2372c03ed2d4e1;p=pspp-builds.git diff --git a/src/ui/gui/compute-dialog.c b/src/ui/gui/compute-dialog.c index 76b9a7d1..e779fba6 100644 --- a/src/ui/gui/compute-dialog.c +++ b/src/ui/gui/compute-dialog.c @@ -20,14 +20,15 @@ #include "helper.h" #include "psppire-dialog.h" #include "psppire-keypad.h" -#include "data-editor.h" +#include "psppire-data-window.h" #include "psppire-var-store.h" +#include "psppire-selector.h" #include "dialog-common.h" -#include "dict-display.h" +#include #include #include -#include "syntax-editor.h" +#include "executor.h" static void function_list_populate (GtkTreeView *tv); @@ -365,7 +366,7 @@ void compute_dialog (GObject *o, gpointer data) { gint response; - struct data_editor *de = data; + PsppireDataWindow *de = data; PsppireVarStore *vs = NULL; struct compute_dialog scd; @@ -394,13 +395,12 @@ compute_dialog (GObject *o, gpointer data) g_signal_connect (expression, "toggled", G_CALLBACK(on_expression_toggle), &scd); - gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); - - - attach_dictionary_to_treeview (GTK_TREE_VIEW (dict_view), - vs->dict, - GTK_SELECTION_SINGLE, NULL); + gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); + g_object_set (dict_view, + "dictionary", vs->dict, + "selection-mode", GTK_SELECTION_SINGLE, + NULL); psppire_selector_set_subjects (PSPPIRE_SELECTOR (var_selector), dict_view, syntax_area, @@ -447,6 +447,7 @@ compute_dialog (GObject *o, gpointer data) case GTK_RESPONSE_OK: { gchar *syntax = generate_syntax (&scd); + struct getl_interface *sss = create_syntax_string_source (syntax); execute_syntax (sss); @@ -457,10 +458,7 @@ compute_dialog (GObject *o, gpointer data) { gchar *syntax = generate_syntax (&scd); - 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); } @@ -606,7 +604,6 @@ insert_source_row_into_text_view (GtkTreeIter iter, gint *idx; struct variable *var; GtkTreeIter dict_iter; - gchar *name; GtkTextBuffer *buffer; g_return_if_fail (GTK_IS_TEXT_VIEW (dest)); @@ -634,13 +631,10 @@ insert_source_row_into_text_view (GtkTreeIter iter, gtk_tree_path_free (path); - name = pspp_locale_to_utf8 (var_get_name (var), -1, NULL); - buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dest)); erase_selection (buffer); - gtk_text_buffer_insert_at_cursor (buffer, name, -1); + gtk_text_buffer_insert_at_cursor (buffer, var_get_name (var), -1); - g_free (name); }