Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 2.0.5, 2.1, and 2.1.1

stable status: toggle all selected rows at once (fixes #632)

Changeset 37c3f4e1e3e1

Parent 182539630952

by Phil Currier

Changes to one file · Browse files at 37c3f4e1e3e1 Showing diff from parent 182539630952 Diff from another changeset...

 
295
296
297
298
 
299
300
301
 
432
433
434
435
436
 
437
438
439
 
626
627
628
629
 
630
631
632
633
634
635
636
637
638
 
 
 
 
639
640
641
 
295
296
297
 
298
299
300
301
 
432
433
434
 
 
435
436
437
438
 
625
626
627
 
628
629
630
631
632
633
 
 
634
 
635
636
637
638
639
640
641
@@ -295,7 +295,7 @@
  def onRowClicked(self, index):   'tree view emitted a clicked signal, index guarunteed valid'   if index.column() == COL_PATH: - self.tv.model().toggleRow(index) + self.tv.model().toggleRows([index])     @pyqtSlot(QString)   def setFilter(self, match): @@ -432,8 +432,7 @@
    def keyPressEvent(self, event):   if event.key() == 32: - for index in self.selectedRows(): - self.model().toggleRow(index) + self.model().toggleRows(self.selectedRows())   if event.key() == Qt.Key_D and event.modifiers() == Qt.ControlModifier:   selfiles = []   for index in self.selectedRows(): @@ -626,16 +625,17 @@
  for row in self.rows:   yield row   - def toggleRow(self, index): + def toggleRows(self, indexes):   'Connected to "activated" signal, emitted by dbl-click or enter'   if QApplication.keyboardModifiers() & Qt.ControlModifier:   # ignore Ctrl-Enter events, the user does not want a row   # toggled just as they are committing.   return - assert index.isValid() - fname = self.rows[index.row()][COL_PATH]   self.layoutAboutToBeChanged.emit() - self.checked[fname] = not self.checked[fname] + for index in indexes: + assert index.isValid() + fname = self.rows[index.row()][COL_PATH] + self.checked[fname] = not self.checked[fname]   self.layoutChanged.emit()   self.checkToggled.emit()