Fix bug 3794: Disable LFUN_WINDOW_CLOSE if only one window is open.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18649 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Richard Heck 2007-06-04 13:43:58 +00:00
parent c54a01a194
commit 793854f7ac

View File

@ -18,6 +18,7 @@
*/
#include <config.h>
#include <vector>
#include "LyXFunc.h"
@ -628,6 +629,12 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
flag.setOnOff(current);
break;
}
case LFUN_WINDOW_CLOSE: {
enable = (theApp()->gui().viewIds().size() > 1);
break;
}
// this one is difficult to get right. As a half-baked
// solution, we consider only the first action of the sequence
case LFUN_COMMAND_SEQUENCE: {
@ -688,7 +695,6 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
case LFUN_BUFFER_NEXT:
case LFUN_BUFFER_PREVIOUS:
case LFUN_WINDOW_NEW:
case LFUN_WINDOW_CLOSE:
case LFUN_LYX_QUIT:
// these are handled in our dispatch()
break;