X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fmissing-val-dialog.c;h=4e9682f73544bcdcfae24cf26453b51d3482d8e6;hb=96b31e17b2c336995db448531ab7f86f57319b5f;hp=f622d91ff9ed31333151abedbe52e3699b0cd025;hpb=75fe94ea24fd7b12a0d99b8f36a79d8423e668d4;p=pspp-builds.git
diff --git a/src/ui/gui/missing-val-dialog.c b/src/ui/gui/missing-val-dialog.c
index f622d91f..4e9682f7 100644
--- a/src/ui/gui/missing-val-dialog.c
+++ b/src/ui/gui/missing-val-dialog.c
@@ -1,21 +1,18 @@
-/*
- PSPPIRE --- A Graphical User Interface for PSPP
- Copyright (C) 2005, 2006 Free Software Foundation
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2005, 2006 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
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
+ 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
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see . */
/* This module describes the behaviour of the Missing Values dialog box,
used for input of the missing values in the variable sheet */
@@ -27,6 +24,7 @@
#include "helper.h"
+#include
#include "missing-val-dialog.h"
#include
#include
@@ -90,8 +88,8 @@ missing_val_dialog_accept (GtkWidget *w, gpointer data)
gint nvals = 0;
gint badvals = 0;
gint i;
- mv_clear (&dialog->mvl);
- for (i = 0 ; i < 3 ; ++i )
+ mv_clear(&dialog->mvl);
+ for(i = 0 ; i < 3 ; ++i )
{
gchar *text =
g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->mv[i])));
@@ -151,7 +149,7 @@ missing_val_dialog_accept (GtkWidget *w, gpointer data)
g_strdup (gtk_entry_get_text (GTK_ENTRY (dialog->discrete)));
mv_clear (&dialog->mvl);
- mv_add_num_range (&dialog->mvl, low_val.f, high_val.f);
+ mv_add_range (&dialog->mvl, low_val.f, high_val.f);
if ( discrete_text && strlen (g_strstrip (discrete_text)) > 0 )
{
@@ -207,12 +205,28 @@ range (GtkToggleButton *button, gpointer data)
}
+
+/* Callback for when the Missing Value dialog is closed using
+ the window delete button.*/
+static gint
+on_delete (GtkWidget *w, GdkEvent *e, gpointer data)
+{
+ struct missing_val_dialog *dialog = data;
+
+ gtk_widget_hide (dialog->window);
+
+ return TRUE;
+}
+
+
/* Creates the dialog structure from the xml */
struct missing_val_dialog *
missing_val_dialog_create (GladeXML *xml)
{
struct missing_val_dialog *dialog = g_malloc (sizeof (*dialog));
+ connect_help (xml);
+
dialog->window = get_widget_assert (xml, "missing_values_dialog");
gtk_window_set_transient_for
@@ -226,6 +240,8 @@ missing_val_dialog_create (GladeXML *xml)
g_signal_connect (get_widget_assert (xml, "missing_val_ok"),
"clicked", G_CALLBACK (missing_val_dialog_accept), dialog);
+ g_signal_connect (dialog->window, "delete-event",
+ G_CALLBACK (on_delete), dialog);
dialog->mv[0] = get_widget_assert (xml, "mv0");
dialog->mv[1] = get_widget_assert (xml, "mv1");
@@ -292,7 +308,7 @@ missing_val_dialog_show (struct missing_val_dialog *dialog)
union value low, high;
gchar *low_text;
gchar *high_text;
- mv_peek_range (&dialog->mvl, &low.f, &high.f);
+ mv_get_range (&dialog->mvl, &low.f, &high.f);
low_text = value_to_text (low, *write_spec);
high_text = value_to_text (high, *write_spec);
@@ -306,7 +322,7 @@ missing_val_dialog_show (struct missing_val_dialog *dialog)
{
gchar *text;
union value value;
- mv_peek_value (&dialog->mvl, &value, 0);
+ mv_get_value (&dialog->mvl, &value, 0);
text = value_to_text (value, *write_spec);
gtk_entry_set_text (GTK_ENTRY (dialog->discrete), text);
g_free (text);
@@ -329,7 +345,7 @@ missing_val_dialog_show (struct missing_val_dialog *dialog)
gchar *text ;
union value value;
- mv_peek_value (&dialog->mvl, &value, i);
+ mv_get_value (&dialog->mvl, &value, i);
text = value_to_text (value, *write_spec);
gtk_entry_set_text (GTK_ENTRY (dialog->mv[i]), text);
g_free (text);