X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fcorrelation-dialog.c;h=e0dfd89fe1251204f5c22198e4cde8d6dc23dc3c;hb=refs%2Fbuilds%2F20101211030502%2Fpspp;hp=19bb7a7001e0ca31541251ea37f8b1a5dab67990;hpb=ba03e6dae4d379b510b053c4df6d41277b456d3a;p=pspp diff --git a/src/ui/gui/correlation-dialog.c b/src/ui/gui/correlation-dialog.c index 19bb7a7001..e0dfd89fe1 100644 --- a/src/ui/gui/correlation-dialog.c +++ b/src/ui/gui/correlation-dialog.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2009 Free Software Foundation + Copyright (C) 2009, 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 @@ -17,7 +17,6 @@ #include #include "dialog-common.h" -#include #include #include @@ -74,7 +73,7 @@ dialog_state_valid (gpointer data) GtkTreeModel *liststore = gtk_tree_view_get_model (GTK_TREE_VIEW (corr->variables)); - if (gtk_tree_model_iter_n_children (liststore, NULL) >= 1) + if (gtk_tree_model_iter_n_children (liststore, NULL) > 1) return TRUE; return FALSE; @@ -83,13 +82,12 @@ dialog_state_valid (gpointer data) /* Pops up the Correlation dialog box */ void -correlation_dialog (GObject *o, gpointer data) +correlation_dialog (PsppireDataWindow *de) { struct correlation rd; gint response; GtkBuilder *xml = builder_new ("correlation.ui"); - PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data); PsppireVarStore *vs; GtkWidget *dialog = get_widget_assert (xml, "correlation-dialog"); @@ -100,7 +98,10 @@ correlation_dialog (GObject *o, gpointer data) gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de)); g_object_get (vs, "dictionary", &rd.dict, NULL); - g_object_set (source, "model", rd.dict, NULL); + g_object_set (source, + "model", rd.dict, + "predicate", var_is_numeric, + NULL); rd.variables = get_widget_assert (xml, "psppire-var-view1"); rd.significant = get_widget_assert (xml, "button-flag-significants"); @@ -116,22 +117,10 @@ correlation_dialog (GObject *o, gpointer data) switch (response) { case GTK_RESPONSE_OK: - { - gchar *syntax = generate_syntax (&rd); - - struct getl_interface *sss = create_syntax_string_source (syntax); - execute_syntax (sss); - - g_free (syntax); - } + g_free (execute_syntax_string (generate_syntax (&rd))); break; case PSPPIRE_RESPONSE_PASTE: - { - gchar *syntax = generate_syntax (&rd); - paste_syntax_in_new_window (syntax); - - g_free (syntax); - } + g_free (paste_syntax_to_window (generate_syntax (&rd))); break; default: break;