From acd6847cd4d6c53b1034e6c018c2e2b7f2399ff6 Mon Sep 17 00:00:00 2001 From: Jonathan White Date: Sat, 20 Apr 2019 11:54:25 -0400 Subject: [PATCH] Support Ctrl+Enter shortcut on all dialogs with QPushButtonBox (#3039) * Remove specific action from EditEntryWidget * Implement key handling at the lowest level * Fix #3036 --- src/gui/DialogyWidget.cpp | 3 ++- src/gui/entry/EditEntryWidget.cpp | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/gui/DialogyWidget.cpp b/src/gui/DialogyWidget.cpp index 858d2949b..597bcc59d 100644 --- a/src/gui/DialogyWidget.cpp +++ b/src/gui/DialogyWidget.cpp @@ -35,7 +35,8 @@ void DialogyWidget::keyPressEvent(QKeyEvent* e) } } else #endif - if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) { + if (!e->modifiers() || e->modifiers() == Qt::ControlModifier + || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) { switch (e->key()) { case Qt::Key_Enter: case Qt::Key_Return: diff --git a/src/gui/entry/EditEntryWidget.cpp b/src/gui/entry/EditEntryWidget.cpp index e22e6703e..8d0f6f556 100644 --- a/src/gui/entry/EditEntryWidget.cpp +++ b/src/gui/entry/EditEntryWidget.cpp @@ -152,11 +152,6 @@ void EditEntryWidget::setupMain() m_mainUi->expirePresets->setMenu(createPresetsMenu()); connect(m_mainUi->expirePresets->menu(), SIGNAL(triggered(QAction*)), this, SLOT(useExpiryPreset(QAction*))); - QAction* action = new QAction(this); - action->setShortcut(Qt::CTRL | Qt::Key_Return); - connect(action, SIGNAL(triggered()), this, SLOT(commitEntry())); - this->addAction(action); - m_mainUi->passwordGenerator->hide(); m_mainUi->passwordGenerator->reset(); }