projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added crosstabs dialog
[pspp-builds.git]
/
src
/
ui
/
gui
/
var-sheet.c
diff --git
a/src/ui/gui/var-sheet.c
b/src/ui/gui/var-sheet.c
index d8e6f6f7195e0a15dd1bd7ddbf961278b4afedbb..9e73cce6220a8cc358e9e7f255de35fb7f4b62e7 100644
(file)
--- a/
src/ui/gui/var-sheet.c
+++ b/
src/ui/gui/var-sheet.c
@@
-1,10
+1,9
@@
-/*
- PSPPIRE --- A Graphical User Interface for PSPP
- Copyright (C) 2004, 2005, 2006 Free Software Foundation
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2004, 2005, 2006, 2007 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
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,
(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
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
/* This module creates the Variable Sheet used for inputing the
@@
-33,9
+30,6
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
-#if HAVE_LANGINFO_H
-#include <langinfo.h>
-#endif
#include <data/value.h>
#include <data/value.h>
@@
-43,6
+37,8
@@
#include <gtksheet/gsheet-hetero-column.h>
#include <gtksheet/gsheet-uniform-row.h>
#include <gtksheet/gsheet-hetero-column.h>
#include <gtksheet/gsheet-uniform-row.h>
+#include "localcharset.h"
+#include "xalloc.h"
#include "psppire-var-store.h"
#include "helper.h"
#include "psppire-dict.h"
#include "psppire-var-store.h"
#include "helper.h"
#include "psppire-dict.h"
@@
-83,7
+79,7
@@
static const struct column_parameters column_def[] = {
const gchar *const alignments[n_ALIGNMENTS + 1]={
N_("Left"),
N_("Right"),
const gchar *const alignments[n_ALIGNMENTS + 1]={
N_("Left"),
N_("Right"),
- N_("Cent
re
"),
+ N_("Cent
er
"),
0
};
0
};
@@
-211,7
+207,7
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
{
GtkSheetCellAttr attributes;
PsppireVarStore *var_store ;
{
GtkSheetCellAttr attributes;
PsppireVarStore *var_store ;
- struct variable *
pv
;
+ struct variable *
var
;
GladeXML *xml;
GladeXML *xml;
@@
-224,17
+220,17
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
if ( row >= psppire_var_store_get_var_cnt (var_store))
return TRUE;
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);
gtk_sheet_get_attributes (sheet, row, column, &attributes);
-
pv
= psppire_var_store_get_var (var_store, row);
+
var
= psppire_var_store_get_var (var_store, row);
switch (column)
{
case COL_ALIGN:
{
switch (column)
{
case COL_ALIGN:
{
- static GtkListStore *list_store =
0
;
+ static GtkListStore *list_store =
NULL
;
GtkComboBoxEntry *cbe;
gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY);
cbe =
GtkComboBoxEntry *cbe;
gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY);
cbe =
@@
-250,9
+246,10
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
g_signal_connect (G_OBJECT (cbe),"changed",
g_signal_connect (G_OBJECT (cbe),"changed",
- G_CALLBACK (change_alignment),
pv
);
+ G_CALLBACK (change_alignment),
var
);
}
break;
}
break;
+
case COL_MEASURE:
{
static GtkListStore *list_store = 0;
case COL_MEASURE:
{
static GtkListStore *list_store = 0;
@@
-270,13
+267,13
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
gtk_combo_box_entry_set_text_column (cbe, 0);
g_signal_connect (G_OBJECT (cbe),"changed",
gtk_combo_box_entry_set_text_column (cbe, 0);
g_signal_connect (G_OBJECT (cbe),"changed",
- G_CALLBACK (change_measure),
pv
);
+ G_CALLBACK (change_measure),
var
);
}
break;
case COL_VALUES:
{
}
break;
case COL_VALUES:
{
- static struct val_labs_dialog *val_labs_dialog =
0
;
+ static struct val_labs_dialog *val_labs_dialog =
NULL
;
PsppireCustomEntry *customEntry;
PsppireCustomEntry *customEntry;
@@
-285,11
+282,15
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
+ if ( var_is_long_string (var))
+ g_object_set (customEntry,
+ "editable", FALSE,
+ NULL);
if (!val_labs_dialog )
val_labs_dialog = val_labs_dialog_create (xml);
if (!val_labs_dialog )
val_labs_dialog = val_labs_dialog_create (xml);
- val_labs_dialog_set_target_variable (val_labs_dialog,
pv
);
+ val_labs_dialog_set_target_variable (val_labs_dialog,
var
);
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
@@
-297,6
+298,7
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
val_labs_dialog);
}
break;
val_labs_dialog);
}
break;
+
case COL_MISSING:
{
static struct missing_val_dialog *missing_val_dialog = 0;
case COL_MISSING:
{
static struct missing_val_dialog *missing_val_dialog = 0;
@@
-307,6
+309,11
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
customEntry =
PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet));
+ if ( var_is_long_string (var))
+ g_object_set (customEntry,
+ "editable", FALSE,
+ NULL);
+
if (!missing_val_dialog )
missing_val_dialog = missing_val_dialog_create (xml);
if (!missing_val_dialog )
missing_val_dialog = missing_val_dialog_create (xml);
@@
-336,7
+343,7
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
var_type_dialog = var_type_dialog_create (xml);
var_type_dialog = var_type_dialog_create (xml);
- var_type_dialog->pv =
pv
;
+ var_type_dialog->pv =
var
;
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
g_signal_connect_swapped (GTK_OBJECT (customEntry),
"clicked",
@@
-344,6
+351,7
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
var_type_dialog);
}
break;
var_type_dialog);
}
break;
+
case COL_WIDTH:
case COL_DECIMALS:
case COL_COLUMNS:
case COL_WIDTH:
case COL_DECIMALS:
case COL_COLUMNS:
@@
-360,7
+368,7
@@
var_sheet_cell_entry_enter (GtkSheet * sheet, gint row, gint column,
const gint current_value = atoi (s);
GtkObject *adj ;
const gint current_value = atoi (s);
GtkObject *adj ;
- const struct fmt_spec *fmt = var_get_write_format (
pv
);
+ const struct fmt_spec *fmt = var_get_write_format (
var
);
switch (column)
{
case COL_WIDTH:
switch (column)
{
case COL_WIDTH:
@@
-446,12
+454,11
@@
psppire_variable_sheet_create (gchar *widget_name,
gtk_sheet_set_model (GTK_SHEET (sheet), G_SHEET_MODEL (the_var_store));
gtk_sheet_set_model (GTK_SHEET (sheet), G_SHEET_MODEL (the_var_store));
-#if HAVE_LANGINFO_H
/* Since this happens inside glade_xml_new, we must prevent strings from
* being re-encoded twice */
/* 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
));
-#endif
+ codeset =
xstrdup (bind_textdomain_codeset (PACKAGE, 0)
);
+ 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,
for (i = 0 ; i < n_COLS ; ++i )
{
g_sheet_hetero_column_set_button_label (G_SHEET_HETERO_COLUMN (geo), i,
@@
-460,9
+467,9
@@
psppire_variable_sheet_create (gchar *widget_name,
g_sheet_hetero_column_set_width (G_SHEET_HETERO_COLUMN (geo), i,
column_def[i].width);
}
g_sheet_hetero_column_set_width (G_SHEET_HETERO_COLUMN (geo), i,
column_def[i].width);
}
-#if HAVE_LANGINFO_H
+
bind_textdomain_codeset (PACKAGE, codeset);
bind_textdomain_codeset (PACKAGE, codeset);
-#endif
+ free (codeset);
gtk_widget_show (sheet);
gtk_widget_show (sheet);