mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-14 09:32:20 +00:00
Emergency save of dirty Buffers when they are destroyed.
Better fix to be committed for 1.6.5. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@31117 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0aeadcb787
commit
412cd14027
@ -3,7 +3,7 @@
|
|||||||
* This file is part of LyX, the document processor.
|
* This file is part of LyX, the document processor.
|
||||||
* Licence details can be found in the file COPYING.
|
* Licence details can be found in the file COPYING.
|
||||||
*
|
*
|
||||||
* \author Lars Gullik Bjønnes
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
||||||
* \author Stefan Schimanski
|
* \author Stefan Schimanski
|
||||||
*
|
*
|
||||||
* Full author contact details are available in file CREDITS.
|
* Full author contact details are available in file CREDITS.
|
||||||
@ -313,6 +313,20 @@ Buffer::~Buffer()
|
|||||||
d->children_positions.clear();
|
d->children_positions.clear();
|
||||||
d->position_to_children.clear();
|
d->position_to_children.clear();
|
||||||
|
|
||||||
|
if (!isClean()) {
|
||||||
|
docstring const text = bformat(_("The document %1$s has unsaved changes."
|
||||||
|
"\n\nDo you want to save the document or discard the changes?"), from_utf8(absFileName()));
|
||||||
|
int const ret = Alert::prompt(_("Save changed document?"),
|
||||||
|
text, 0, 2, _("&Save"), _("&Discard"));
|
||||||
|
switch (ret) {
|
||||||
|
case 0:
|
||||||
|
save();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!d->temppath.destroyDirectory()) {
|
if (!d->temppath.destroyDirectory()) {
|
||||||
Alert::warning(_("Could not remove temporary directory"),
|
Alert::warning(_("Could not remove temporary directory"),
|
||||||
bformat(_("Could not remove the temporary directory %1$s"),
|
bformat(_("Could not remove the temporary directory %1$s"),
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is part of LyX, the document processor.
|
* This file is part of LyX, the document processor.
|
||||||
* Licence details can be found in the file COPYING.
|
* Licence details can be found in the file COPYING.
|
||||||
*
|
*
|
||||||
* \author Lars Gullik Bjønnes
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
||||||
*
|
*
|
||||||
* Full author contact details are available in file CREDITS.
|
* Full author contact details are available in file CREDITS.
|
||||||
*/
|
*/
|
||||||
@ -282,6 +282,8 @@ docstring BufferList::emergencyWrite(Buffer * buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
user_message += _(" Save failed! Bummer. Document is lost.");
|
user_message += _(" Save failed! Bummer. Document is lost.");
|
||||||
|
// Don't try again
|
||||||
|
buf->markClean();
|
||||||
return user_message;
|
return user_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
* This file is part of LyX, the document processor.
|
* This file is part of LyX, the document processor.
|
||||||
* Licence details can be found in the file COPYING.
|
* Licence details can be found in the file COPYING.
|
||||||
*
|
*
|
||||||
* \author Lars Gullik Bjønnes
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
||||||
* \author John Levon
|
* \author John Levon
|
||||||
* \author Abdelrazak Younes
|
* \author Abdelrazak Younes
|
||||||
* \author Peter Kümmel
|
* \author Peter K<EFBFBD>mmel
|
||||||
*
|
*
|
||||||
* Full author contact details are available in file CREDITS.
|
* Full author contact details are available in file CREDITS.
|
||||||
*/
|
*/
|
||||||
@ -1875,6 +1875,7 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened, bool mark_active)
|
|||||||
// have no autosave file but I guess
|
// have no autosave file but I guess
|
||||||
// this is really improbable (Jug)
|
// this is really improbable (Jug)
|
||||||
buf.removeAutosaveFile();
|
buf.removeAutosaveFile();
|
||||||
|
buf.markClean();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user