projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Committed patch #5524, which allows the message destination to be
[pspp]
/
src
/
ui
/
gui
/
var-sheet.c
diff --git
a/src/ui/gui/var-sheet.c
b/src/ui/gui/var-sheet.c
index 3fd426efdf866582c2576eb7a9e873706ddee766..3145f13dc7159cc7d754dddbd91fcc9f8b240e97 100644
(file)
--- a/
src/ui/gui/var-sheet.c
+++ b/
src/ui/gui/var-sheet.c
@@
-34,6
+34,7
@@
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
+#include <langinfo.h>
#include <data/value.h>
#include <data/value.h>
@@
-98,14
+99,14
@@
click2row(GtkWidget *w, gint row, gpointer data)
-const gchar *alignments[]={
+const gchar *alignments[
n_ALIGNMENTS + 1
]={
N_("Left"),
N_("Right"),
N_("Centre"),
0
};
N_("Left"),
N_("Right"),
N_("Centre"),
0
};
-const gchar *measures[]={
+const gchar *measures[
n_MEASURES + 1
]={
N_("Nominal"),
N_("Ordinal"),
N_("Scale"),
N_("Nominal"),
N_("Ordinal"),
N_("Scale"),
@@
-191,13
+192,15
@@
traverse_cell_callback (GtkSheet * sheet,
}
/* If the destination cell is outside the current variables, then
}
/* If the destination cell is outside the current variables, then
- a
ccept the destination only as the name column of the first blank row
+ a
utomatically create variables for the new rows.
*/
*/
- if ( *new_row > n_vars)
- return FALSE;
-
- if ( *new_row >= n_vars && *new_column != COL_NAME)
- return FALSE;
+ if ( (*new_row > n_vars) ||
+ (*new_row == n_vars && *new_column != COL_NAME) )
+ {
+ gint i;
+ for ( i = n_vars ; i <= *new_row; ++i )
+ psppire_dict_insert_variable(var_store->dict, i, NULL);
+ }
return TRUE;
}
return TRUE;
}
@@
-409,6
+412,8
@@
var_sheet_cell_change_entry (GtkSheet * sheet, gint row, gint column,
}
}
+extern PsppireVarStore *var_store;
+
/* Create the var sheet */
GtkWidget*
/* Create the var sheet */
GtkWidget*
@@
-417,15
+422,13
@@
psppire_variable_sheet_create (gchar *widget_name,
gchar *string2,
gint int1, gint int2)
{
gchar *string2,
gint int1, gint int2)
{
+ gchar *codeset;
gint i;
GtkWidget *sheet;
GObject *geo = g_sheet_hetero_column_new(75, n_COLS);
gint i;
GtkWidget *sheet;
GObject *geo = g_sheet_hetero_column_new(75, n_COLS);
- GObject *row_geometry = g_sheet_uniform_row_new(25, n_initial_rows);
-
-
- sheet = gtk_sheet_new(G_SHEET_ROW(row_geometry),
+ sheet = gtk_sheet_new(G_SHEET_ROW(var_store),
G_SHEET_COLUMN(geo),
"variable sheet", 0);
G_SHEET_COLUMN(geo),
"variable sheet", 0);
@@
-445,14
+448,19
@@
psppire_variable_sheet_create (gchar *widget_name,
GTK_SIGNAL_FUNC (click2row),
sheet);
GTK_SIGNAL_FUNC (click2row),
sheet);
+ /* 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));
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,
-
gettext(column_def[i].label));
-
+ gettext(column_def[i].label));
+
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);
}
+ bind_textdomain_codeset(PACKAGE, codeset);
gtk_widget_show(sheet);
gtk_widget_show(sheet);