Move LFUN_BUFFER_WRITE_ALL status to GuiView with a FIXME. I believe this LFUN should go to GuiApplication.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31447 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2009-09-22 21:46:16 +00:00
parent 059729ec59
commit b379d68d21
2 changed files with 19 additions and 18 deletions

View File

@ -474,24 +474,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
}
*/
case LFUN_BUFFER_WRITE_ALL: {
// We enable the command only if there are some modified buffers
Buffer * first = theBufferList().first();
enable = false;
if (!first)
break;
Buffer * b = first;
// We cannot use a for loop as the buffer list is a cycle.
do {
if (!b->isClean()) {
enable = true;
break;
}
b = theBufferList().next(b);
} while (b != first);
break;
}
case LFUN_BOOKMARK_GOTO: {
const unsigned int num = convert<unsigned int>(to_utf8(cmd.argument()));
enable = theSession().bookmarks().isValid(num);

View File

@ -1211,6 +1211,25 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
enable = doc_buffer && (doc_buffer->isUnnamed() || !doc_buffer->isClean());
break;
//FIXME: This LFUN should be moved to GuiApplication.
case LFUN_BUFFER_WRITE_ALL: {
// We enable the command only if there are some modified buffers
Buffer * first = theBufferList().first();
enable = false;
if (!first)
break;
Buffer * b = first;
// We cannot use a for loop as the buffer list is a cycle.
do {
if (!b->isClean()) {
enable = true;
break;
}
b = theBufferList().next(b);
} while (b != first);
break;
}
case LFUN_BUFFER_WRITE_AS:
enable = doc_buffer;
break;