Correctly message that the export is cancelled

Uptil now, it was said that the export was succesful.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40099 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2011-10-30 19:52:27 +00:00
parent b436f71b33
commit 5cdcc4f7ef
3 changed files with 22 additions and 10 deletions

View File

@ -3745,7 +3745,10 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
if (status == CANCEL) {
message(_("Document export cancelled."));
} else if (tmp_result_file.exists()) {
return ExportCancel;
}
if (tmp_result_file.exists()) {
// Finally copy the main file
use_force = use_gui ? lyxrc.export_overwrite != NO_FILES
: force_overwrite != NO_FILES;
@ -3754,10 +3757,15 @@ Buffer::ExportStatus Buffer::doExport(string const & target, bool put_in_tempdir
status = copyFile(format, tmp_result_file,
FileName(result_file), result_file,
status == FORCE);
if (status == CANCEL) {
message(_("Document export cancelled."));
return ExportCancel;
} else {
message(bformat(_("Document exported as %1$s "
"to file `%2$s'"),
formats.prettyName(format),
makeDisplayPath(result_file)));
}
} else {
// This must be a dummy converter like fax (bug 1888)
message(bformat(_("Document exported as %1$s"),

View File

@ -125,6 +125,7 @@ public:
enum ExportStatus {
// export
ExportSuccess,
ExportCancel,
ExportError,
ExportNoPathToFormat,
ExportTexPathHasSpaces,

View File

@ -534,22 +534,25 @@ static void handleExportStatus(GuiView * view, Buffer::ExportStatus status,
docstring msg;
switch (status) {
case Buffer::ExportSuccess:
msg = _("Successful export to format: %1$s");
msg = bformat(_("Successful export to format: %1$s"), from_utf8(format));
break;
case Buffer::ExportCancel:
msg = _("Document export cancelled.");
break;
case Buffer::ExportError:
case Buffer::ExportNoPathToFormat:
case Buffer::ExportTexPathHasSpaces:
case Buffer::ExportConverterError:
msg = _("Error while exporting format: %1$s");
msg = bformat(_("Error while exporting format: %1$s"), from_utf8(format));
break;
case Buffer::PreviewSuccess:
msg = _("Successful preview of format: %1$s");
msg = bformat(_("Successful preview of format: %1$s"), from_utf8(format));
break;
case Buffer::PreviewError:
msg = _("Error while previewing format: %1$s");
msg = bformat(_("Error while previewing format: %1$s"), from_utf8(format));
break;
}
view->message(bformat(msg, from_utf8(format)));
view->message(msg);
}