Keyboard modifiers with quick navigation

The quick navigation key disrupted keybindings with keyboard modifiers,
like Ctrl-C for copy. This restricts the quick navigation only where no
keyboard modifiers are active.

Fixes #184
This commit is contained in:
Peter Šurda 2016-03-16 18:42:08 +01:00
parent a30d5af948
commit 2e47ab0cd2

View File

@ -1509,35 +1509,36 @@ class MyForm(settingsmixin.SMainWindow):
else: else:
self.on_action_InboxTrash() self.on_action_InboxTrash()
event.ignore() event.ignore()
elif event.key() == QtCore.Qt.Key_N: elif QtGui.QApplication.queryKeyboardModifiers() == QtCore.Qt.NoModifier:
currentRow = messagelist.currentRow() if event.key() == QtCore.Qt.Key_N:
if currentRow < messagelist.rowCount() - 1: currentRow = messagelist.currentRow()
messagelist.selectRow(currentRow + 1) if currentRow < messagelist.rowCount() - 1:
event.ignore() messagelist.selectRow(currentRow + 1)
elif event.key() == QtCore.Qt.Key_P: event.ignore()
currentRow = messagelist.currentRow() elif event.key() == QtCore.Qt.Key_P:
if currentRow > 0: currentRow = messagelist.currentRow()
messagelist.selectRow(currentRow - 1) if currentRow > 0:
event.ignore() messagelist.selectRow(currentRow - 1)
elif event.key() == QtCore.Qt.Key_R: event.ignore()
if messagelist == self.ui.tableWidgetInboxChans: elif event.key() == QtCore.Qt.Key_R:
self.on_action_InboxReplyChan() if messagelist == self.ui.tableWidgetInboxChans:
else: self.on_action_InboxReplyChan()
self.on_action_InboxReply() else:
event.ignore() self.on_action_InboxReply()
elif event.key() == QtCore.Qt.Key_C: event.ignore()
currentAddress = self.getCurrentAccount() elif event.key() == QtCore.Qt.Key_C:
if currentAddress: currentAddress = self.getCurrentAccount()
self.setSendFromComboBox(currentAddress) if currentAddress:
self.ui.tabWidgetSend.setCurrentIndex(0) self.setSendFromComboBox(currentAddress)
self.ui.tabWidget.setCurrentIndex(1) self.ui.tabWidgetSend.setCurrentIndex(0)
self.ui.lineEditTo.setFocus() self.ui.tabWidget.setCurrentIndex(1)
event.ignore() self.ui.lineEditTo.setFocus()
elif event.key() == QtCore.Qt.Key_F: event.ignore()
searchline = self.getCurrentSearchLine(retObj = True) elif event.key() == QtCore.Qt.Key_F:
if searchline: searchline = self.getCurrentSearchLine(retObj = True)
searchline.setFocus() if searchline:
event.ignore() searchline.setFocus()
event.ignore()
if not event.isAccepted(): if not event.isAccepted():
return return
if isinstance (focus, MessageView): if isinstance (focus, MessageView):