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

stable status: do not connect signals directly to model (refs #138)

Changeset 25345493d79b

Parent 48296093b489

by Steve Borho

Changes to one file · Browse files at 25345493d79b Showing diff from parent 48296093b489 Diff from another changeset...

 
143
144
145
 
 
146
147
148
 
249
250
251
 
 
 
252
253
254
 
260
261
262
263
264
265
266
267
268
269
270
 
282
283
284
 
 
 
 
 
 
 
 
 
 
285
286
287
 
599
600
601
602
603
604
605
606
607
608
609
610
 
143
144
145
146
147
148
149
150
 
251
252
253
254
255
256
257
258
259
 
265
266
267
 
 
 
 
 
268
269
270
 
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
 
609
610
611
 
 
 
 
 
 
612
613
614
@@ -143,6 +143,8 @@
  tv.setItemsExpandable(False)   tv.setRootIsDecorated(False)   tv.sortByColumn(COL_PATH_DISPLAY) + tv.clicked.connect(self.onRowClicked) + le.textEdited.connect(self.setFilter)     def statusTypeTrigger(isChecked):   txt = hglib.fromunicode(self.sender().text()) @@ -249,6 +251,9 @@
  parent=self)   ms = merge.mergestate(self.repo)   tm = WctxModel(wctx, ms, self.opts, checked, self) + tm.checkToggled.connect(self.updateCheckCount) + + self.updateCheckCount()   self.tv.setModel(tm)   self.tv.setSortingEnabled(True)   self.tv.setColumnHidden(COL_PATH, bool(wctx.p2())) @@ -260,11 +265,6 @@
  for col in (COL_PATH_DISPLAY, COL_EXTENSION, COL_SIZE):   self.tv.resizeColumnToContents(col)   - self.tv.clicked.connect(tm.clickedRow) - self.le.textEdited.connect(tm.setFilter) - tm.checkToggled.connect(self.updateCheckCount) - self.updateCheckCount() -   # reset selection, or select first row   curidx = tm.index(0, 0)   selmodel = self.tv.selectionModel() @@ -282,6 +282,16 @@
  if curidx and curidx.isValid():   selmodel.setCurrentIndex(curidx, QItemSelectionModel.Current)   + @pyqtSlot(QModelIndex) + def onRowClicked(self, index): + 'tree view emitted a clicked signal, index guarunteed valid' + if index.column() == COL_PATH: + self.tv.model().toggleRow(index) + + @pyqtSlot(QString) + def setFilter(self, match): + self.tv.model().setFilter(match) +   def updateCheckCount(self):   text = _('Checked count: %d') % len(self.getChecked())   self.countlbl.setText(text) @@ -599,12 +609,6 @@
  self.layoutChanged.emit()   self.checkToggled.emit()   - def clickedRow(self, index): - 'Connected to "pressed" signal, emitted by mouse clicks' - assert index.isValid() - if index.column() == COL_PATH: - self.toggleRow(index) -   def sort(self, col, order):   self.layoutAboutToBeChanged.emit()   if col == COL_PATH: