qtutils: try to support older PyQt versions
[git-cola.git] / cola / hotkeys.py
blobca5b6a054ec76db0b534e1b6dff16f8cb27b3256
1 from PyQt4.QtGui import QKeySequence
2 from PyQt4.QtCore import Qt
4 # A-G
5 STAGE_MODIFIED = Qt.AltModifier | Qt.Key_A
6 WORD_LEFT = Qt.Key_B
7 BRANCH = Qt.ControlModifier | Qt.Key_B
8 CHECKOUT = Qt.AltModifier | Qt.Key_B
9 CHERRY_PICK = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_C
10 DIFFSTAT = Qt.AltModifier | Qt.Key_D
11 DIFF = Qt.ControlModifier | Qt.Key_D
12 DIFF_SECONDARY = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_D
13 EDIT = Qt.ControlModifier | Qt.Key_E
14 EDIT_SECONDARY = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_E
15 EXPORT = Qt.AltModifier | Qt.Key_E
16 FIT = Qt.Key_F
17 FETCH = Qt.ControlModifier | Qt.Key_F
18 FILTER = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_F
19 GREP = Qt.ControlModifier | Qt.Key_G
20 # H-P
21 MOVE_LEFT = Qt.Key_H
22 HISTORY = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_H
23 SIGNOFF = Qt.ControlModifier | Qt.Key_I
24 MOVE_DOWN = Qt.Key_J
25 MOVE_DOWN_SECONDARY = Qt.AltModifier | Qt.Key_J
26 MOVE_DOWN_TERTIARY = Qt.ShiftModifier | Qt.Key_J
27 MOVE_UP = Qt.Key_K
28 MOVE_UP_SECONDARY = Qt.AltModifier | Qt.Key_K
29 MOVE_UP_TERTIARY = Qt.ShiftModifier | Qt.Key_K
30 MOVE_RIGHT = Qt.Key_L
31 FOCUS = Qt.ControlModifier | Qt.Key_L
32 AMEND = Qt.ControlModifier | Qt.Key_M
33 MERGE = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_M
34 PUSH = Qt.ControlModifier | Qt.Key_P
35 PULL = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_P
36 # Q-Z
37 QUIT = Qt.ControlModifier | Qt.Key_Q
38 REFRESH = Qt.ControlModifier | Qt.Key_R
39 REFRESH_SECONDARY = Qt.Key_F5
40 REFRESH_HOTKEYS = (REFRESH, REFRESH_SECONDARY)
41 STAGE_DIFF = Qt.Key_S
42 STAGE_SELECTION = Qt.ControlModifier | Qt.Key_S
43 STASH = Qt.AltModifier | Qt.ShiftModifier | Qt.Key_S
44 FINDER = Qt.ControlModifier | Qt.Key_T
45 FINDER_SECONDARY = Qt.Key_T
46 TERMINAL = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_T
47 STAGE_UNTRACKED = Qt.AltModifier | Qt.Key_U
48 REVERT = Qt.ControlModifier | Qt.Key_U
49 WORD_RIGHT = Qt.Key_W
50 UNDO = Qt.ControlModifier | Qt.Key_Z
52 # Numbers
53 START_OF_LINE = Qt.Key_0
55 # Special keys
56 BACKSPACE = Qt.Key_Backspace
57 TRASH = Qt.ControlModifier | Qt.Key_Backspace
58 DELETE_FILE = Qt.ControlModifier | Qt.ShiftModifier | Qt.Key_Backspace
59 DELETE_FILE_SECONDARY = Qt.ControlModifier | Qt.Key_Backspace
60 PREFERENCES = Qt.ControlModifier | Qt.Key_Comma
61 END_OF_LINE = Qt.Key_Dollar
62 DOWN = Qt.Key_Down
63 ENTER = Qt.Key_Enter
64 ZOOM_OUT = Qt.Key_Minus
65 REMOVE_ITEM = Qt.Key_Minus
66 ADD_ITEM = Qt.Key_Plus
67 ZOOM_IN = Qt.Key_Plus
68 ZOOM_IN_SECONDARY = Qt.Key_Equal
70 QUESTION = Qt.Key_Question
71 RETURN = Qt.Key_Return
72 ACCEPT = (ENTER, RETURN)
73 COMMIT = Qt.ControlModifier | Qt.Key_Return
74 PRIMARY_ACTION = Qt.Key_Space
75 SECONDARY_ACTION = Qt.ShiftModifier | Qt.Key_Space
76 LEAVE = Qt.ShiftModifier | Qt.Key_Tab
77 UP = Qt.Key_Up
79 # Rebase
80 REBASE_PICK = (Qt.Key_1, Qt.Key_P)
81 REBASE_REWORD = (Qt.Key_2, Qt.Key_R)
82 REBASE_EDIT = (Qt.Key_3, Qt.Key_E)
83 REBASE_FIXUP = (Qt.Key_4, Qt.Key_F)
84 REBASE_SQUASH = (Qt.Key_5, Qt.Key_S)
86 # Key Sequences
87 COPY = QKeySequence.Copy
88 CLOSE = QKeySequence.Close
89 CUT = QKeySequence.Cut
90 DELETE = QKeySequence.Delete
91 NEW = QKeySequence.New
92 OPEN = QKeySequence.Open