mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
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:
parent
059729ec59
commit
b379d68d21
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user