From 793854f7acfcb8a706278a4df1cf8b0a820a892a Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Mon, 4 Jun 2007 13:43:58 +0000 Subject: [PATCH] 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 --- src/LyXFunc.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 77ad4dcc3f..0cb14f577a 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -18,6 +18,7 @@ */ #include +#include #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;