commit a0ce37147cffa39b1a5c8859eb001dd2194b22a1
Author: Guillaume Munch <[email protected]>
Date: Thu Mar 2 22:27:38 2017 +0100
Allow Ctrl+Enter in GuiCitation even if the citation is already there
---
src/frontends/qt4/GuiSelectionManager.cpp | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/frontends/qt4/GuiSelectionManager.cpp
b/src/frontends/qt4/GuiSelectionManager.cpp
index 5523495..eeba937 100644
--- a/src/frontends/qt4/GuiSelectionManager.cpp
+++ b/src/frontends/qt4/GuiSelectionManager.cpp
@@ -390,15 +390,16 @@ 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 (addPB->isEnabled()) {
- if (!keyModifiers) {
+ if (!keyModifiers ||
+ keyModifiers == Qt::ControlModifier ||
+ keyModifiers == Qt::KeypadModifier ||
+ keyModifiers == (Qt::ControlModifier
+ | Qt::KeypadModifier)) {
+ if (addPB->isEnabled()) {
addPB_clicked();
- } else if (keyModifiers ==
Qt::ControlModifier ||
- keyModifiers ==
Qt::KeypadModifier ||
- keyModifiers ==
(Qt::ControlModifier | Qt::KeypadModifier)) {
- addPB_clicked();
- okHook(); //signal
}
+ if (keyModifiers)
+ okHook(); //signal
}
event->accept();
return true;