Change license from GPLv2+ to GPLv3+.
[pspp-builds.git] / src / ui / gui / missing-val-dialog.c
index 58ff43dafbab326d3d709188d75a9a15b3b7dbc4..3a350735b99f17bf207bc0b5c7221f107a1c57af 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>. */
 
 /*  This module describes the behaviour of the Missing Values dialog box,
     used for input of the missing values in the variable sheet */
@@ -90,8 +87,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])));
@@ -207,6 +204,20 @@ 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)
@@ -228,6 +239,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 (GTK_OBJECT (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");