mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-10 20:04:46 +00:00
Use the Buffer::reload() function also in buffer_func.cpp::checkAndLoadLyXFile().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33265 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
3410d6ad3e
commit
8c5626cf13
@ -67,18 +67,16 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty)
|
||||
if (checkBuffer->isClean() || acceptDirty)
|
||||
return checkBuffer;
|
||||
docstring const file = makeDisplayPath(filename.absFilename(), 20);
|
||||
docstring text = bformat(_(
|
||||
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")))
|
||||
return checkBuffer;
|
||||
|
||||
// FIXME: should be LFUN_REVERT
|
||||
checkBuffer->markClean();
|
||||
theBufferList().release(checkBuffer);
|
||||
// Load it again.
|
||||
return checkAndLoadLyXFile(filename);
|
||||
if (!Alert::prompt(_("Reload saved document?"),
|
||||
text, 0, 1, _("&Reload"), _("&Keep Changes"))) {
|
||||
// reload the document
|
||||
if (!checkBuffer->reload())
|
||||
return 0;
|
||||
}
|
||||
return checkBuffer;
|
||||
}
|
||||
|
||||
if (filename.exists()) {
|
||||
|
Loading…
Reference in New Issue
Block a user