Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: davvid/git-cola
base: ad84e12020
...
head fork: davvid/git-cola
compare: 2e2b8937e7
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 29, 2013
@davvid status: remove global up/down keyboard shortcuts
The widget still honors up/down when the widget has focus so disable the
global shortcuts since it interferes with being able to jump between the
"summary" and "description" fields using the up/down arrow keys.

Signed-off-by: David Aguilar <davvid@gmail.com>
0957585
@davvid commitmsg: simplify the way we handle up/down arrow keys
Add QActions so that we can do without needing to trap the arrow keys in
a keyPressEvent().  This is much simpler.

Signed-off-by: David Aguilar <davvid@gmail.com>
2e2b893
Showing with 8 additions and 26 deletions.
  1. +3 −20 cola/widgets/commitmsg.py
  2. +5 −6 cola/widgets/status.py
View
23 cola/widgets/commitmsg.py
@@ -119,15 +119,12 @@ def __init__(self, model, parent):
# Handle the one-off autowrapping
connect_action_bool(self.autowrap_action, self.set_linebreak)
+ add_action(self.summary, N_('Move Down'), self.focus_description,
+ Qt.Key_Down, Qt.Key_Return, Qt.Key_Enter)
+
self.model.add_observer(self.model.message_commit_message_changed,
self.set_commit_message)
- self.connect(self.summary, SIGNAL('returnPressed()'),
- self.focus_description)
-
- self.connect(self.summary, SIGNAL('downPressed()'),
- self.focus_description)
-
self.connect(self.summary, SIGNAL('cursorPosition(int,int)'),
self.emit_position)
@@ -407,20 +404,6 @@ def __init__(self, parent=None):
HintedLineEdit.__init__(self, hint, parent)
self.extra_actions = []
- def keyPressEvent(self, event):
- if event.key() == Qt.Key_Down:
- position = self.cursorPosition()
- curtext = unicode(self.text())
- if position == len(curtext):
- self.emit(SIGNAL('downPressed()'))
- event.accept()
- return
- if event.key() in (Qt.Key_Return, Qt.Key_Enter):
- self.emit(SIGNAL('returnPressed()'))
- event.accept()
- return
- HintedLineEdit.keyPressEvent(self, event)
-
def contextMenuEvent(self, event):
menu = self.createStandardContextMenu()
if self.extra_actions:
View
11 cola/widgets/status.py
@@ -112,12 +112,11 @@ def __init__(self, parent):
cmds.OpenParentDir.SHORTCUT)
self.open_parent_dir.setIcon(qtutils.open_file_icon())
- self.up = qtutils.add_action(self,
- N_('Move Up'), self.move_up,
- Qt.Key_K, Qt.Key_Up)
- self.down = qtutils.add_action(self,
- N_('Move Down'), self.move_down,
- Qt.Key_J, Qt.Key_Down)
+ self.up = qtutils.add_action(self, N_('Move Up'), self.move_up,
+ Qt.Key_K)
+
+ self.down = qtutils.add_action(self, N_('Move Down'), self.move_down,
+ Qt.Key_J)
self.copy_path_action = qtutils.add_action(self,
N_('Copy Path to Clipboard'),

No commit comments for this range

Something went wrong with that request. Please try again.