* LyX, The Document Word Processor
*
* Copyright 1995 Matthias Ettrich
* LyX, The Document Word Processor
*
* Copyright 1995 Matthias Ettrich
bool BufferList::qwriteAll()
{
string unsaved;
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
for (; it != end; ++it) {
bool BufferList::qwriteAll()
{
string unsaved;
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
for (; it != end; ++it) {
// Since we are closing we can just as well delete all
// in the textcache this will also speed the closing/quiting up a bit.
textcache.clear();
// Since we are closing we can just as well delete all
// in the textcache this will also speed the closing/quiting up a bit.
textcache.clear();
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
for (; it != end; ++it) {
BufferStorage::iterator it = bstore.begin();
BufferStorage::iterator end = bstore.end();
for (; it != end; ++it) {
void BufferList::emergencyWriteAll()
{
for_each(bstore.begin(), bstore.end(),
void BufferList::emergencyWriteAll()
{
for_each(bstore.begin(), bstore.end(),
lyxerr << fmt(_("lyx: Attempting to save document %s as..."),
buf->isUnnamed() ? OnlyFilename(buf->fileName()).c_str()
: buf->fileName().c_str()) << endl;
lyxerr << fmt(_("lyx: Attempting to save document %s as..."),
buf->isUnnamed() ? OnlyFilename(buf->fileName()).c_str()
: buf->fileName().c_str()) << endl;
lyxerr << _(" Save seems successful. Phew.") << endl;
return;
} else {
lyxerr << _(" Save failed! Trying...") << endl;
}
}
lyxerr << _(" Save seems successful. Phew.") << endl;
return;
} else {
lyxerr << _(" Save failed! Trying...") << endl;
}
}
// 2) In HOME directory.
string s = AddName(GetEnvPath("HOME"), buf->fileName());
s += ".emergency";
lyxerr << " " << s << endl;
// 2) In HOME directory.
string s = AddName(GetEnvPath("HOME"), buf->fileName());
s += ".emergency";
lyxerr << " " << s << endl;
// 3) In "/tmp" directory.
// MakeAbsPath to prepend the current
// drive letter on OS/2
s = AddName(MakeAbsPath("/tmp/"), buf->fileName());
s += ".emergency";
lyxerr << " " << s << endl;
// 3) In "/tmp" directory.
// MakeAbsPath to prepend the current
// drive letter on OS/2
s = AddName(MakeAbsPath("/tmp/"), buf->fileName());
s += ".emergency";
lyxerr << " " << s << endl;
Buffer * b = bstore.newBuffer(s, ronly);
// Check if emergency save file exists and is newer.
Buffer * b = bstore.newBuffer(s, ronly);
// Check if emergency save file exists and is newer.
BufferStorage::const_iterator cit =
find(bstore.begin(), bstore.end(), b);
return cit != bstore.end();
BufferStorage::const_iterator cit =
find(bstore.begin(), bstore.end(), b);
return cit != bstore.end();
MakeDisplayPath(tname));
// no template, start with empty buffer
b->paragraph = new Paragraph;
MakeDisplayPath(tname));
// no template, start with empty buffer
b->paragraph = new Paragraph;
if (LyXVC::file_not_found_hook(s)) {
// Ask if the file should be checked out for
// viewing/editing, if so: load it.
if (LyXVC::file_not_found_hook(s)) {
// Ask if the file should be checked out for
// viewing/editing, if so: load it.
// How can we know _how_ to do the checkout?
// With the current VC support it has to be,
// a RCS file since CVS do not have special ,v files.
// How can we know _how_ to do the checkout?
// With the current VC support it has to be,
// a RCS file since CVS do not have special ,v files.