[add] space hotkey to close window

This commit is contained in:
Marcel Paffrath 2017-06-21 14:09:39 +02:00
parent c10639b49c
commit 5214d31908
2 changed files with 9 additions and 5 deletions

View File

@ -1 +1 @@
0a6a-dirty c106-dirty

View File

@ -845,9 +845,6 @@ class PickDlg(QDialog):
self.s_button = QPushButton('S', self) self.s_button = QPushButton('S', self)
self.p_button.setCheckable(True) self.p_button.setCheckable(True)
self.s_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 # set button tooltips
self.p_button.setToolTip('Hotkey: "1"') self.p_button.setToolTip('Hotkey: "1"')
self.s_button.setToolTip('Hotkey: "2"') self.s_button.setToolTip('Hotkey: "2"')
@ -857,6 +854,13 @@ class PickDlg(QDialog):
self.reject_button = QPushButton('&Reject Picks') self.reject_button = QPushButton('&Reject Picks')
self.disable_ar_buttons() 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 # layout the outermost appearance of the Pick Dialog
_outerlayout = QVBoxLayout() _outerlayout = QVBoxLayout()
_dialtoolbar = QToolBar() _dialtoolbar = QToolBar()