Fix bug #740 (part 2): Wish for added menu item: File->Close all.

Now disable the menuitem when there is only 1 visible buffer.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30890 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2009-08-07 00:41:39 +00:00
parent 2d420ddfc4
commit 31afc053ea
2 changed files with 16 additions and 1 deletions

View File

@ -633,7 +633,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
case LFUN_CANCEL:
case LFUN_META_PREFIX:
case LFUN_BUFFER_CLOSE:
case LFUN_BUFFER_CLOSE_ALL:
case LFUN_BUFFER_IMPORT:
case LFUN_BUFFER_AUTO_SAVE:
case LFUN_RECONFIGURE:

View File

@ -1246,6 +1246,22 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
enable = buf;
break;
case LFUN_BUFFER_CLOSE_ALL: {
enable = false;
BufferList::iterator it = theBufferList().begin();
BufferList::iterator end = theBufferList().end();
int visible_buffers = 0;
for (; it != end; ++it) {
if (workArea(**it))
++visible_buffers;
if (visible_buffers > 1) {
enable = true;
break;
}
}
break;
}
case LFUN_SPLIT_VIEW:
if (cmd.getArg(0) == "vertical")
enable = buf && (d.splitter_->count() == 1 ||