branch: GuiCitation: Do not allow to add entries by pressing Enter when the Add button is disabled.

see r40835.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40846 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2012-03-03 15:52:21 +00:00
parent f92c5848f6
commit 9a5c01acb8
2 changed files with 8 additions and 7 deletions

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)
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
}

View File

@ -65,7 +65,8 @@ What's new
* USER INTERFACE
-
- Do not allow to add a citation in the citation dialog using the
<Enter> key if the Add button is disabled.
* DOCUMENTATION AND LOCALIZATION