/* 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
#include <config.h>
#include "dialog-common.h"
-#include <language/syntax-string-source.h>
#include "reliability-dialog.h"
#include "psppire-selector.h"
#include "psppire-dictview.h"
#include "psppire-dialog.h"
#include "psppire-data-window.h"
+#include "psppire-var-view.h"
#include "executor.h"
#include "helper.h"
GtkWidget *variables;
GtkWidget *split_point_hbox;
GtkWidget *split_spinbutton;
+ GtkWidget *scale_if_item_deleted_checkbutton;
};
gtk_spin_button_set_range (GTK_SPIN_BUTTON (rd->split_spinbutton),
0, 0);
+
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (rd->scale_if_item_deleted_checkbutton),
+ FALSE);
}
/* Pops up the Reliability dialog box */
void
-reliability_dialog (GObject *o, gpointer data)
+reliability_dialog (PsppireDataWindow *de)
{
struct reliability rd;
gint response;
GtkBuilder *xml = builder_new ("reliability.ui");
- PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data);
PsppireVarStore *vs;
GtkWidget *dialog = get_widget_assert (xml, "reliability-dialog");
GtkWidget *source = get_widget_assert (xml, "dict-view");
- GtkWidget *selector = get_widget_assert (xml, "psppire-selector1");
-
rd.split_point_hbox = get_widget_assert (xml, "split-point-hbox");
rd.variables = get_widget_assert (xml, "treeview2");
rd.model_combo = get_widget_assert (xml, "combobox1");
rd.split_spinbutton = get_widget_assert (xml, "spinbutton1");
+ rd.scale_if_item_deleted_checkbutton = get_widget_assert (xml, "totals-checkbutton");
+
g_signal_connect_swapped (rd.model_combo, "changed",
G_CALLBACK (on_method_change), &rd);
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (de));
- g_object_set (source, "dictionary", vs->dict, NULL);
-
- rd.dict = vs->dict;
-
- set_dest_model (GTK_TREE_VIEW (rd.variables), vs->dict);
-
- psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector),
- source,
- rd.variables,
- insert_source_row_into_tree_view,
- NULL,
- NULL);
+ g_object_get (vs, "dictionary", &rd.dict, NULL);
+ g_object_set (source, "model", rd.dict, NULL);
{
GtkTreeModel *tm =
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;
GString *string = g_string_new ("RELIABILITY");
g_string_append (string, "\n\t/VARIABLES=");
- append_variable_names (string, rd->dict, GTK_TREE_VIEW (rd->variables), 0);
+ psppire_var_view_append_names (PSPPIRE_VAR_VIEW (rd->variables), 0, string);
g_string_append (string, "\n\t/MODEL=");
gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (rd->split_spinbutton))
);
+ if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->scale_if_item_deleted_checkbutton)))
+ g_string_append (string, "\n\t/SUMMARY = TOTAL");
+
g_string_append (string, ".\n");
text = string->str;