mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
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:
parent
2d420ddfc4
commit
31afc053ea
@ -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:
|
||||
|
@ -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 ||
|
||||
|
Loading…
Reference in New Issue
Block a user