docstring const text = bformat(_(
"The document %1$s is already loaded and has unsaved changes.\n"
"Do you want to abandon your changes and reload the version on disk?"), file);
if (!Alert::prompt(_("Reload saved document?"),
text, 0, 1, _("&Reload"), _("&Keep Changes"))) {
// reload the document
docstring const text = bformat(_(
"The document %1$s is already loaded and has unsaved changes.\n"
"Do you want to abandon your changes and reload the version on disk?"), file);
if (!Alert::prompt(_("Reload saved document?"),
text, 0, 1, _("&Reload"), _("&Keep Changes"))) {
// reload the document
if (!filename.isReadableFile()) {
docstring text = bformat(_("The file %1$s exists but is not "
"readable by the current user."),
if (!filename.isReadableFile()) {
docstring text = bformat(_("The file %1$s exists but is not "
"readable by the current user."),
docstring text = bformat(_("The document %1$s does not yet "
"exist.\n\nDo you want to create a new document?"),
docstring text = bformat(_("The document %1$s does not yet "
"exist.\n\nDo you want to create a new document?"),
if (!Alert::prompt(_("Create new document?"),
text, 0, 1, _("&Create"), _("Cancel")))
if (!Alert::prompt(_("Create new document?"),
text, 0, 1, _("&Create"), _("Cancel")))
// FIXME newFile() should probably be a member method of Application...
Buffer * newFile(string const & filename, string const & templatename,
// FIXME newFile() should probably be a member method of Application...
Buffer * newFile(string const & filename, string const & templatename,
- if (!b->readFile(tname)) {
- docstring const file = makeDisplayPath(tname.absFilename(), 50);
+ if (b->loadThisLyXFile(tname) != Buffer::ReadSuccess) {
+ docstring const file = makeDisplayPath(tname.absFileName(), 50);
docstring const text = bformat(
_("The specified document template\n%1$s\ncould not be read."),
file);
docstring const text = bformat(
_("The specified document template\n%1$s\ncould not be read."),
file);
* are similar but, unfortunately, they seem to have a different
* notion of what to count. Since nobody ever complained about that,
* this proves (again) that any number beats no number ! (JMarc)
* are similar but, unfortunately, they seem to have a different
* notion of what to count. Since nobody ever complained about that,
* this proves (again) that any number beats no number ! (JMarc)
+ * We have two use cases:
+ * 1. Count the words of the given range for document statistics
+ * - ignore inset content without output. (skipNoOutput == true)
+ * 2. Count the words to present a progress bar for the spell checker
+ * - has to count whole content. (skipNoOutput == false)