]> git.lyx.org Git - features.git/commitdiff
Qt/Mac disappearing menu syndrom, part II
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 23 Jun 2004 14:04:09 +0000 (14:04 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 23 Jun 2004 14:04:09 +0000 (14:04 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8821 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/frontends/qt2/ChangeLog
src/frontends/qt2/lyx_gui.C
src/lyxfunc.C

index e50946f1d4599c313afcb0a9e422dd48dfc440a1..f9d437842e1b26550dce7683b01f7aa8dcb38c87 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-10  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * lyxfunc.C (getStatus): if lyx_gui::getStatus disables the
+       command, return early.
 2004-06-18  Lars Gullik Bjonnes  <larsbj@gullik.net>
 
        * debug.h: add DEBUG to enum and fix size of ANY.
index 7585f32fa1115bc2d60b9cc84b78cd16b3fdbf53..eb15c360ac65844a5bfe0631894ee3cad89a1d42 100644 (file)
@@ -1,3 +1,8 @@
+2004-06-09  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * lyx_gui.C (getStatus): under Mac OS X, disable the
+       buffer-related lfuns when the main window does not have the focus.
+
 2004-06-21  Jürgen Spitzmüller  <j.spitzmueller@gmx.de>
 
        * QCitation.[Ch]: add validation (fix bug 1617).
index bcd5362a49d5a6d3316e8b8de3a3152681892a96..b33ae2ecdda668ba25a35f7632af2a574242b210 100644 (file)
@@ -244,6 +244,18 @@ FuncStatus getStatus(FuncRequest const & ev)
        default:
                break;
        }
+
+#ifdef Q_WS_MACX
+       // In LyX/Mac, when a dialog is open, the menus of the
+       // application can still be accessed without giving focus to
+       // the main window. In this case, we want to disable the menu
+       // entries that are buffer-related.
+       if (use_gui 
+           && qApp->activeWindow() != qApp->mainWidget()
+           && !lyxaction.funcHasFlag(ev.action, LyXAction::NoBuffer)) 
+               flag.enabled(false);
+#endif
+
        return flag;
 }
 
index defcbe968966c9fbb70760d854e8dce6b6123a78..fade20901e947994a5b3e4451d72aaae93e0e23f 100644 (file)
@@ -299,6 +299,8 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
 
        // the default error message if we disable the command
        setStatusMessage(N_("Command disabled"));
+       if (!flag.enabled()) 
+               return flag;
 
        // Check whether we need a buffer
        if (!lyxaction.funcHasFlag(cmd.action, LyXAction::NoBuffer) && !buf) {