aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRael <rael.gc@gmail.com>2015-10-25 08:00:15 -0200
committerRael <rael.gc@gmail.com>2015-10-25 08:00:15 -0200
commit5ba508028030fc89bb026ed16fc8735433fd8907 (patch)
treec6f6d509480bfe571c32ec484f87ec2fddfb1862
parent6dc6a9fc925ef6ac5e9510ad6555edc8938d7f73 (diff)
downloadscudcloud-5ba508028030fc89bb026ed16fc8735433fd8907.zip
scudcloud-5ba508028030fc89bb026ed16fc8735433fd8907.tar.gz
scudcloud-5ba508028030fc89bb026ed16fc8735433fd8907.tar.bz2
Better code
-rwxr-xr-xscudcloud-1.0/lib/scudcloud.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scudcloud-1.0/lib/scudcloud.py b/scudcloud-1.0/lib/scudcloud.py
index 9b84906..3fb3b2c 100755
--- a/scudcloud-1.0/lib/scudcloud.py
+++ b/scudcloud-1.0/lib/scudcloud.py
@@ -289,7 +289,8 @@ class ScudCloud(QtGui.QMainWindow):
self.focusInEvent(event)
if event.type() == QtCore.QEvent.KeyPress:
# Ctrl + <n>
- if QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
+ modifiers = QtGui.QApplication.keyboardModifiers()
+ if modifiers == QtCore.Qt.ControlModifier:
if event.key() == QtCore.Qt.Key_1: self.leftPane.click(0)
elif event.key() == QtCore.Qt.Key_2: self.leftPane.click(1)
elif event.key() == QtCore.Qt.Key_3: self.leftPane.click(2)
@@ -302,10 +303,10 @@ class ScudCloud(QtGui.QMainWindow):
# Ctrl + Tab
elif event.key() == QtCore.Qt.Key_Tab: self.leftPane.clickNext(1)
# Ctrl + BackTab
- if (QtGui.QApplication.keyboardModifiers() & QtCore.Qt.ControlModifier) and (QtGui.QApplication.keyboardModifiers() & QtCore.Qt.ShiftModifier):
+ if (modifiers & QtCore.Qt.ControlModifier) and (modifiers & QtCore.Qt.ShiftModifier):
if event.key() == QtCore.Qt.Key_Backtab: self.leftPane.clickNext(-1)
# Ctrl + Shift + <key>
- if (QtGui.QApplication.keyboardModifiers() & QtCore.Qt.ShiftModifier) and (QtGui.QApplication.keyboardModifiers() & QtCore.Qt.ShiftModifier):
+ if (modifiers & QtCore.Qt.ShiftModifier) and (modifiers & QtCore.Qt.ShiftModifier):
if event.key() == QtCore.Qt.Key_V: self.current().createSnippet()
return QtGui.QMainWindow.eventFilter(self, obj, event);