Change license from GPLv2+ to GPLv3+.
[pspp-builds.git] / src / ui / gui / var-sheet.c
index bb7a0a6026885f09fdb30783494010b54b954f40..b6440e4d3caa32071dcaff366de85b65bb00bb31 100644 (file)
@@ -1,10 +1,9 @@
-/*
-   PSPPIRE --- A Graphical User Interface for PSPP
+/* PSPPIRE - a graphical user interface for PSPP.
    Copyright (C) 2004, 2005, 2006  Free Software Foundation
 
-   This program is free software; you can redistribute it and/or modify
+   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
+   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,
@@ -13,9 +12,7 @@
    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. */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 
 
 /* This module creates the Variable Sheet used for inputing the
@@ -33,7 +30,6 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <langinfo.h>
 
 #include <data/value.h>
 
@@ -41,6 +37,7 @@
 #include <gtksheet/gsheet-hetero-column.h>
 #include <gtksheet/gsheet-uniform-row.h>
 
+#include "localcharset.h"
 #include "psppire-var-store.h"
 #include "helper.h"
 #include "psppire-dict.h"
@@ -222,7 +219,7 @@ var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
   if ( row >= psppire_var_store_get_var_cnt (var_store))
     return TRUE;
 
-  xml = glade_xml_new (PKGDATADIR "/data-editor.glade", NULL, NULL);
+  xml = XML_NEW ("data-editor.glade");
 
   gtk_sheet_get_attributes (sheet, row, column, &attributes);
 
@@ -287,7 +284,7 @@ var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
        if (!val_labs_dialog )
            val_labs_dialog = val_labs_dialog_create (xml);
 
-       val_labs_dialog->pv = pv;
+       val_labs_dialog_set_target_variable (val_labs_dialog, pv);
 
        g_signal_connect_swapped (GTK_OBJECT (customEntry),
                                 "clicked",
@@ -410,7 +407,7 @@ extern PsppireVarStore *the_var_store;
 
 
 /* Create the var sheet */
-GtkWidget*
+G_MODULE_EXPORT GtkWidget*
 psppire_variable_sheet_create (gchar *widget_name,
                               gchar *string1,
                               gchar *string2,
@@ -447,7 +444,8 @@ psppire_variable_sheet_create (gchar *widget_name,
   /* Since this happens inside glade_xml_new, we must prevent strings from
    * being re-encoded twice */
   codeset = bind_textdomain_codeset (PACKAGE, 0);
-  bind_textdomain_codeset (PACKAGE, nl_langinfo (CODESET));
+  bind_textdomain_codeset (PACKAGE, locale_charset ());
+
   for (i = 0 ; i < n_COLS ; ++i )
     {
       g_sheet_hetero_column_set_button_label (G_SHEET_HETERO_COLUMN (geo), i,
@@ -456,6 +454,7 @@ psppire_variable_sheet_create (gchar *widget_name,
       g_sheet_hetero_column_set_width (G_SHEET_HETERO_COLUMN (geo), i,
                                               column_def[i].width);
     }
+
   bind_textdomain_codeset (PACKAGE, codeset);
 
   gtk_widget_show (sheet);