#include "language/data-io/data-parser.h"
#include "language/lexer/lexer.h"
#include "libpspp/assertion.h"
+#include "libpspp/i18n.h"
#include "libpspp/message.h"
#include "ui/gui/checkbox-treeview.h"
#include "ui/gui/descriptives-dialog.h"
/* Pops up the Text Data Import assistant. */
void
-text_data_import_assistant (GtkWindow *parent_window)
+text_data_import_assistant (PsppireDataWindow *dw)
{
+ GtkWindow *parent_window = GTK_WINDOW (dw);
struct import_assistant *ia;
ia = xzalloc (sizeof *ia);
switch (ia->asst.response)
{
case GTK_RESPONSE_APPLY:
- free (execute_syntax_string (generate_syntax (ia)));
+ free (execute_syntax_string (dw, generate_syntax (ia)));
break;
case PSPPIRE_RESPONSE_PASTE:
free (paste_syntax_to_window (generate_syntax (ia)));
ds_put_cstr (s, "\n ");
syntax_gen_value (s, &vl->value, width, format);
ds_put_byte (s, ' ');
- syntax_gen_string (s, ss_cstr (val_lab_get_label (vl)));
+ syntax_gen_string (s, ss_cstr (val_lab_get_escaped_label (vl)));
}
free (labels);
ds_put_cstr (s, ".\n");
destroy_file (ia);
return false;
}
- ds_chomp (line, '\n');
- ds_chomp (line, '\r');
+ ds_chomp_byte (line, '\n');
+ ds_chomp_byte (line, '\r');
}
if (file->line_cnt == 0)
size_t max_line_length;
gint content_width, header_width;
size_t i;
- gchar *title = _("Text");
+ const gchar *title = _("Text");
make_tree_view (ia, 0, &tree_view);
struct column *col;
size_t name_row;
- dict = dict_create ();
+ dict = dict_create (get_default_encoding ());
name_row = f->variable_names && f->skip_lines ? f->skip_lines : 0;
for (col = s->columns; col < &s->columns[s->column_cnt]; col++)
{
push_watch_cursor (ia);
- dict = dict_create ();
+ dict = dict_create (get_default_encoding ());
fg = fmt_guesser_create ();
for (column_idx = 0; column_idx < s->column_cnt; column_idx++)
{
{
char *error;
- error = data_in (field, LEGACY_NATIVE, in->type, &val,
- var_get_width (var),
+ error = data_in (field, C_ENCODING, in->type, &val, var_get_width (var),
dict_get_encoding (ia->formats.dict));
if (error != NULL)
{
to make the data related to the tool tips part of a GObject
that only gets destroyed when all references are released,
but this solution appears to be effective too. */
- if (!GTK_WIDGET_MAPPED (widget))
+ if (!gtk_widget_get_mapped (widget))
return FALSE;
gtk_tree_view_convert_widget_to_bin_window_coords (tree_view,