]> git.lyx.org Git - features.git/commitdiff
GuiCitation: Do not allow to add entries by pressing Enter when the Add button is...
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 3 Mar 2012 12:39:19 +0000 (12:39 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 3 Mar 2012 12:39:19 +0000 (12:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40835 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiSelectionManager.cpp

index 825115cb3a368fff67470dc774a2269ff427bd25..d3d2b01f410f9204cfb9054e33808411b88f973a 100644 (file)
@@ -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
                                        }