Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9.3, 2.0, and 2.0.1

stable branchop: use QShortcuts instead of reimplementing keyPressEvent

Changeset 181c004406d5

Parent 0cba1c9acf59

by Steve Borho

Changes to one file · Browse files at 181c004406d5 Showing diff from parent 0cba1c9acf59 Diff from another changeset...

 
79
80
81
82
83
84
85
86
87
88
89
90
91
92
 
 
93
94
95
 
79
80
81
 
 
 
 
 
 
 
 
 
 
 
82
83
84
85
86
@@ -79,17 +79,8 @@
  layout.addWidget(bb)   self.bb = bb   self.branchCombo = branchCombo - - def keyPressEvent(self, event): - # todo - is this necessary for a derivation of QDialog? - if event.key() in (Qt.Key_Return, Qt.Key_Enter): - if event.modifiers() == Qt.ControlModifier: - self.accept() # Ctrl+Enter - return - elif event.key() == Qt.Key_Escape: - self.reject() - return - return super(QDialog, self).keyPressEvent(event) + QShortcut(QKeySequence('Ctrl+Return'), self, self.accept) + QShortcut(QKeySequence('Escape'), self, self.reject)     def accept(self):   '''Branch operation is one of: