X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fcompute-dialog.c;h=89a64563630dbde933d166a02f75ec15580ec51f;hb=afdf3096926b561f4e6511c10fcf73fc6796b9d2;hp=c09c7571936fa4e4ca493bd0647b2586629caa6d;hpb=bd17d2af982332ee1791998361b1ac6731fe14fa;p=pspp-builds.git diff --git a/src/ui/gui/compute-dialog.c b/src/ui/gui/compute-dialog.c index c09c7571..89a64563 100644 --- a/src/ui/gui/compute-dialog.c +++ b/src/ui/gui/compute-dialog.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation + Copyright (C) 2007, 2010 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -27,7 +27,6 @@ #include #include -#include #include "executor.h" static void function_list_populate (GtkTreeView *tv); @@ -363,15 +362,14 @@ contents_plausible (gpointer data) /* Pops up the Compute dialog box */ void -compute_dialog (GObject *o, gpointer data) +compute_dialog (PsppireDataWindow *de) { gint response; - PsppireDataWindow *de = data; PsppireVarStore *vs = NULL; struct compute_dialog scd; - GtkBuilder *xml = builder_new ("psppire.ui"); + GtkBuilder *xml = builder_new ("compute.ui"); GtkWidget *dialog = get_widget_assert (xml, "compute-variable-dialog"); @@ -379,7 +377,6 @@ compute_dialog (GObject *o, gpointer data) GtkWidget *functions = get_widget_assert (xml, "compute-treeview2"); GtkWidget *keypad = get_widget_assert (xml, "psppire-keypad1"); GtkWidget *target = get_widget_assert (xml, "compute-entry1"); - GtkWidget *syntax_area = get_widget_assert (xml, "compute-textview1"); GtkWidget *var_selector = get_widget_assert (xml, "compute-selector1"); GtkWidget *func_selector = get_widget_assert (xml, "compute-selector2"); GtkWidget *type_and_label = get_widget_assert (xml, "compute-button1"); @@ -398,25 +395,17 @@ compute_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); - g_object_set (dict_view, "dictionary", scd.dict, + g_object_set (dict_view, "model", scd.dict, "selection-mode", GTK_SELECTION_SINGLE, NULL); - psppire_selector_set_subjects (PSPPIRE_SELECTOR (var_selector), - dict_view, syntax_area, - insert_source_row_into_text_view, - NULL, - NULL); - + psppire_selector_set_select_func (PSPPIRE_SELECTOR (var_selector), + insert_source_row_into_text_view, NULL); function_list_populate (GTK_TREE_VIEW (functions)); - psppire_selector_set_subjects (PSPPIRE_SELECTOR (func_selector), - functions, syntax_area, - insert_function_into_syntax_area, - NULL, - NULL); - + psppire_selector_set_select_func (PSPPIRE_SELECTOR (func_selector), + insert_function_into_syntax_area, NULL); scd.xml = xml; @@ -445,23 +434,10 @@ compute_dialog (GObject *o, gpointer data) switch (response) { case GTK_RESPONSE_OK: - { - gchar *syntax = generate_syntax (&scd); - - struct getl_interface *sss = create_syntax_string_source (syntax); - execute_syntax (sss); - - g_free (syntax); - } + g_free (execute_syntax_string (generate_syntax (&scd))); break; case PSPPIRE_RESPONSE_PASTE: - { - gchar *syntax = generate_syntax (&scd); - - paste_syntax_in_new_window (syntax); - - g_free (syntax); - } + g_free (paste_syntax_to_window (generate_syntax (&scd))); break; default: break;