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
This commit is contained in:
Vincent van Ravesteijn 2012-03-03 12:39:19 +00:00
parent 1c66a43a91
commit 803e7a9cfa

View 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)
if (addPB->isEnabled()) {
if (!keyModifiers) {
addPB_clicked();
else if (keyModifiers == Qt::ControlModifier ||
} else if (keyModifiers == Qt::ControlModifier ||
keyModifiers == Qt::KeypadModifier ||
keyModifiers == (Qt::ControlModifier | Qt::KeypadModifier)) {
if (addPB->isEnabled()) {
addPB_clicked();
okHook(); //signal
}