From 5214d3190893b5590d965e6b29262e9c4f5db6f8 Mon Sep 17 00:00:00 2001 From: Marcel Paffrath Date: Wed, 21 Jun 2017 14:09:39 +0200 Subject: [PATCH] [add] space hotkey to close window --- pylot/RELEASE-VERSION | 2 +- pylot/core/util/widgets.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/pylot/RELEASE-VERSION b/pylot/RELEASE-VERSION index cc4db1e3..ab13596e 100644 --- a/pylot/RELEASE-VERSION +++ b/pylot/RELEASE-VERSION @@ -1 +1 @@ -0a6a-dirty +c106-dirty diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 51eb6908..d00ec3de 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -845,17 +845,21 @@ class PickDlg(QDialog): self.s_button = QPushButton('S', self) self.p_button.setCheckable(True) self.s_button.setCheckable(True) - # button shortcuts (1 for P-button, 2 for S-button) - self.p_button.setShortcut(QKeySequence('1')) - self.s_button.setShortcut(QKeySequence('2')) # set button tooltips self.p_button.setToolTip('Hotkey: "1"') self.s_button.setToolTip('Hotkey: "2"') - + # create accept/reject button self.accept_button = QPushButton('&Accept Picks') self.reject_button = QPushButton('&Reject Picks') self.disable_ar_buttons() + + # add hotkeys + self._shortcut_space = QtGui.QShortcut(QtGui.QKeySequence(' '), self) + self._shortcut_space.activated.connect(self.accept_button.clicked) + # button shortcuts (1 for P-button, 2 for S-button) + self.p_button.setShortcut(QKeySequence('1')) + self.s_button.setShortcut(QKeySequence('2')) # layout the outermost appearance of the Pick Dialog _outerlayout = QVBoxLayout()