From 803e7a9cfa24d5633ee5ea358c5060f4fdf96c91 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sat, 3 Mar 2012 12:39:19 +0000 Subject: [PATCH] GuiCitation: Do not allow to add entries by pressing Enter when the Add button is disabled. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40835 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiSelectionManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt4/GuiSelectionManager.cpp b/src/frontends/qt4/GuiSelectionManager.cpp index 825115cb3a..d3d2b01f41 100644 --- a/src/frontends/qt4/GuiSelectionManager.cpp +++ b/src/frontends/qt4/GuiSelectionManager.cpp @@ -355,12 +355,12 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event) // This is designed to work both with the main enter key // and the one on the numeric keypad. if (keyPressed == Qt::Key_Enter || keyPressed == Qt::Key_Return) { - if (!keyModifiers) - addPB_clicked(); - else if (keyModifiers == Qt::ControlModifier || - keyModifiers == Qt::KeypadModifier || - keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) { - if (addPB->isEnabled()) { + if (addPB->isEnabled()) { + if (!keyModifiers) { + addPB_clicked(); + } else if (keyModifiers == Qt::ControlModifier || + keyModifiers == Qt::KeypadModifier || + keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) { addPB_clicked(); okHook(); //signal } -- 2.39.2