X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Ftext-data-import-dialog.c;h=13c6d96804e48903a72cf37e16699c0e788d0e3b;hb=758bb90bac15899ca7f18a55dc4f90e1345c7179;hp=5add061365a082a2e90ef4f91719d89c6e0f394e;hpb=01e18746832583769419e3f59824b80229321275;p=pspp-builds.git diff --git a/src/ui/gui/text-data-import-dialog.c b/src/ui/gui/text-data-import-dialog.c index 5add0613..13c6d968 100644 --- a/src/ui/gui/text-data-import-dialog.c +++ b/src/ui/gui/text-data-import-dialog.c @@ -458,7 +458,7 @@ init_file (struct import_assistant *ia, GtkWindow *parent_window) stream = fopen (file->file_name, "r"); if (stream == NULL) { - msg (ME, _("Could not open \"%s\": %s"), + msg (ME, _("Could not open `%s': %s"), file->file_name, strerror (errno)); return false; } @@ -474,10 +474,10 @@ init_file (struct import_assistant *ia, GtkWindow *parent_window) if (feof (stream)) break; else if (ferror (stream)) - msg (ME, _("Error reading \"%s\": %s"), + msg (ME, _("Error reading `%s': %s"), file->file_name, strerror (errno)); else - msg (ME, _("Failed to read \"%s\", because it contains a line " + msg (ME, _("Failed to read `%s', because it contains a line " "over %d bytes long and therefore appears not to be " "a text file."), file->file_name, MAX_LINE_LEN); @@ -491,7 +491,7 @@ init_file (struct import_assistant *ia, GtkWindow *parent_window) if (file->line_cnt == 0) { - msg (ME, _("\"%s\" is empty."), file->file_name); + msg (ME, _("`%s' is empty."), file->file_name); fclose (stream); destroy_file (ia); return false; @@ -1775,20 +1775,19 @@ parse_field (struct import_assistant *ia, tooltip = NULL; if (field.string != NULL) { - msg_disable (); + char *error; - if (!data_in (field, LEGACY_NATIVE, in->type, 0, 0, 0, - ia->formats.dict, - &val, var_get_width (var))) + error = data_in (field, LEGACY_NATIVE, in->type, &val, + var_get_width (var), + dict_get_encoding (ia->formats.dict)); + if (error != NULL) { - char fmt_string[FMT_STRING_LEN_MAX + 1]; - fmt_to_string (in, fmt_string); - tooltip = xasprintf (_("Field content \"%.*s\" cannot be parsed in " - "format %s."), + tooltip = xasprintf (_("Cannot parse field content `%.*s' as " + "format %s: %s"), (int) field.length, field.string, - fmt_string); + fmt_name (in->type), error); + free (error); } - msg_enable (); } else {