Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

hgqt: more pyqt signal cleanups

And bug fixes for rename guess dialog, though it is still
not finding renames for some reason inside Mercurial itself.

Changeset 09a9e2798934

Parent 4faad5f451e2

by Steve Borho

Changes to 6 files · Browse files at 09a9e2798934 Showing diff from parent 4faad5f451e2 Diff from another changeset...

 
147
148
149
150
 
151
152
153
 
180
181
182
 
183
184
185
 
187
188
189
190
191
192
 
 
 
193
194
195
 
353
354
355
356
 
357
358
359
360
361
362
 
363
364
365
 
370
371
372
373
 
374
375
376
 
377
378
379
380
 
381
382
383
 
386
387
388
 
 
 
389
390
391
 
406
407
408
409
410
 
411
412
 
413
414
415
416
417
418
419
 
420
421
422
423
424
 
 
425
426
427
428
429
430
 
443
444
445
446
 
447
448
449
450
451
452
453
 
454
455
456
 
147
148
149
 
150
151
152
153
 
180
181
182
183
184
185
186
 
188
189
190
 
 
 
191
192
193
194
195
196
 
354
355
356
 
357
358
359
360
361
362
 
363
364
365
366
 
371
372
373
 
374
375
376
 
377
378
379
380
 
381
382
383
384
 
387
388
389
390
391
392
393
394
395
 
410
411
412
 
 
413
414
 
415
416
417
418
419
420
421
 
422
423
424
425
 
 
426
427
428
429
 
430
431
432
 
445
446
447
 
448
449
450
451
452
453
454
 
455
456
457
458
@@ -147,7 +147,7 @@
  QTimer.singleShot(0, self.refresh)     def refresh(self): - repo.thginvalidate() + self.repo.thginvalidate()   wctx = self.repo[None]   wctx.status(unknown=True)   self.unrevlist.clear() @@ -180,6 +180,7 @@
  _('Select one or more rows for search'))   return   + self.repo.thginvalidate()   pct = self.simslider.value() / 100.0   copies = not self.copycheck.isChecked()   self.findbtn.setEnabled(False) @@ -187,9 +188,9 @@
    self.matchtv.model().clear()   self.thread = RenameSearchThread(self.repo, ulist, pct, copies) - self.connect(self.thread, SIGNAL('match'), self.rowReceived) - self.connect(self.thread, SIGNAL('progress'), self.progressReceived) - self.connect(self.thread, SIGNAL('error'), self.errorReceived) + self.thread.match.connect(self.rowReceived) + self.thread.progress.connect(self.progressReceived) + self.thread.error.connect(self.errorReceived)   self.thread.searchComplete.connect(self.finished)   self.thread.start()   @@ -353,13 +354,13 @@
  self.beginInsertRows(QModelIndex(), len(self.rows), len(self.rows))   self.rows.append(args)   self.endInsertRows() - self.emit(SIGNAL("dataChanged()")) + self.layoutChanged.emit()     def clear(self):   self.beginRemoveRows(QModelIndex(), 0, len(self.rows)-1)   self.rows = []   self.endRemoveRows() - self.emit(SIGNAL("dataChanged()")) + self.layoutChanged.emit()     def remove(self, dest):   i = 0 @@ -370,14 +371,14 @@
  self.endRemoveRows()   else:   i += 1 - self.emit(SIGNAL("dataChanged()")) + self.layoutChanged.emit()     def sort(self, col, order): - self.emit(SIGNAL("layoutAboutToBeChanged()")) + self.layoutAboutToBeChanged.emit()   self.rows.sort(lambda x, y: cmp(x[col], y[col]))   if order == Qt.DescendingOrder:   self.rows.reverse() - self.emit(SIGNAL("layoutChanged()")) + self.layoutChanged.emit()   self.reset()     def isEmpty(self): @@ -386,6 +387,9 @@
 class RenameSearchThread(QThread):   '''Background thread for searching repository history'''   searchComplete = pyqtSignal() + match = pyqtSignal(object) + progress = pyqtSignal(object) + error = pyqtSignal(object)     def __init__(self, repo, ufiles, minpct, copies):   super(RenameSearchThread, self).__init__() @@ -406,25 +410,23 @@
  else:   self.sig = QObject() # dummy object to emit signals   def progress(self, topic, pos, item='', unit='', total=None): - self.sig.emit(SIGNAL('progress'), - [topic, item, pos, total, unit]) + self.sig.emit("SIGNAL(progress)", [topic, item, pos, total, unit])   progui = ProgUi() - self.connect(progui.sig, SIGNAL('progress'), self.progress) + self.connect(progui.sig, SIGNAL('progress'), self.progressRecvd)   storeui = self.repo.ui   self.progui = progui   self.repo.ui = progui   try:   self.search(self.repo)   except Exception, e: - self.emit(SIGNAL('error'), hglib.tounicode(str(e))) + self.error.emit(hglib.tounicode(str(e)))   self.repo.ui = storeui   self.searchComplete.emit()   - def progress(self, wr): - self.emit(SIGNAL('progress'), wr) + def progressRecvd(self, wr): + self.progress.emit(wr)     def search(self, repo): - repo.thginvalidate()   wctx = repo[None]   pctx = repo['.']   if self.copies: @@ -443,14 +445,14 @@
  for o, n in gen:   old, new = o.path(), n.path()   exacts.append(old) - self.emit(SIGNAL('match'), [old, new, '100%']) + self.match.emit([old, new, '100%'])   if self.minpct == 1.0:   return   removed = [r for r in removed if r.path() not in exacts]   gen = similar._findsimilarmatches(repo, added, removed, self.minpct)   for o, n, s in gen:   old, new, sim = o.path(), n.path(), '%d%%' % (s*100) - self.emit(SIGNAL('match'), [old, new, sim]) + self.match.emit([old, new, sim])    def run(ui, *pats, **opts):   return DetectRenameDialog(None, None, *pats)
 
102
103
104
105
106
107
 
108
109
110
111
112
113
114
115
 
 
116
117
118
 
140
141
142
143
 
144
145
146
 
159
160
161
162
163
164
 
 
 
165
166
167
 
260
261
262
263
 
264
265
266
 
102
103
104
 
 
 
105
106
107
108
109
110
111
 
 
112
113
114
115
116
 
138
139
140
 
141
142
143
144
 
157
158
159
 
 
 
160
161
162
163
164
165
 
258
259
260
 
261
262
263
264
@@ -102,17 +102,15 @@
  uvbox.addWidget(unknownlist)   unknownlist.currentTextChanged.connect(self.setGlobFilter)   unknownlist.setContextMenuPolicy(Qt.CustomContextMenu) - self.connect(unknownlist, - SIGNAL('customContextMenuRequested(const QPoint &)'), - self.customContextMenuRequested) + unknownlist.customContextMenuRequested.connect(self.menuRequest)   lbl = QLabel(_('Backspace or Del to remove a row'))   ivbox.addWidget(lbl)     # layer 4 - dialog buttons   BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Close) - self.connect(bb, SIGNAL("accepted()"), self, SLOT("accept()")) - self.connect(bb, SIGNAL("rejected()"), self, SLOT("reject()")) + bb.accepted.connect(self.accept) + bb.rejected.connect(self.reject)   vbox.addWidget(bb)   self.bb = bb   @@ -140,7 +138,7 @@
  self.refresh()   return True   - def customContextMenuRequested(self, point): + def menuRequest(self, point):   'context menu request for unknown list'   point = self.unknownlist.mapToGlobal(point)   row = self.unknownlist.currentRow() @@ -159,9 +157,9 @@
  dirname = os.path.dirname(dirname)   for f in filters:   action = menu.addAction(_('Ignore ') + hglib.tounicode(f)) - action.localtext = f - action.wrapper = lambda f=f: self.insertFilter(f, False) - self.connect(action, SIGNAL('triggered()'), action.wrapper) + action.args = (f,False) + action.run = lambda: self.insertFilter(*action.args) + action.triggered.connect(action.run)   menu.exec_(point)     def insertFilter(self, pat, isregexp): @@ -260,7 +258,7 @@
  f.write(out)   f.rename()   shlib.shell_notify([self.ignorefile]) - self.emit(SIGNAL('ignoreFilterUpdated')) + self.ignoreFilterUpdated.emit()   except IOError, e:   qtlib.WarningMsgBox(_('Unable to write .hgignore file'),   hglib.tounicode(str(e)), parent=self)
 
61
62
63
64
65
 
 
66
67
68
 
61
62
63
 
 
64
65
66
67
68
@@ -61,8 +61,8 @@
  BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Ok|BB.Cancel)   self.apply_button = bb.button(BB.Apply) - self.connect(bb, SIGNAL("accepted()"), self, SLOT("accept()")) - self.connect(bb, SIGNAL("rejected()"), self, SLOT("reject()")) + bb.accepted.connect(self.accept) + bb.rejected.connect(self.reject)   bb.button(BB.Ok).setDefault(True)   layout.addWidget(bb)  
 
254
255
256
257
 
258
259
260
 
466
467
468
469
470
471
472
 
 
473
474
475
 
254
255
256
 
257
258
259
260
 
466
467
468
 
 
 
 
469
470
471
472
473
@@ -254,7 +254,7 @@
  def keyPressEvent(self, event):   for k, btn in self.hotkeys.iteritems():   if event.text() == k: - btn.emit(SIGNAL('clicked()')) + btn.clicked.emit()   super(CustomPrompt, self).keyPressEvent(event)    def setup_font_substitutions(): @@ -466,10 +466,8 @@
  vbox.addWidget(editor)   BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Save|BB.Cancel) - dialog.connect(bb, SIGNAL('accepted()'), - dialog, SLOT('accept()')) - dialog.connect(bb, SIGNAL('rejected()'), - dialog, SLOT('reject()')) + bb.accepted.connect(dialog.accept) + bb.rejected.connect(dialog.reject)   vbox.addWidget(bb)   lexer = QsciLexerProperties()   editor.setLexer(lexer)
 
132
133
134
135
 
136
137
138
 
152
153
154
155
 
156
157
158
159
160
 
161
162
163
 
423
424
425
426
 
427
428
429
 
132
133
134
 
135
136
137
138
 
152
153
154
 
155
156
157
158
159
 
160
161
162
163
 
423
424
425
 
426
427
428
429
@@ -132,7 +132,7 @@
  branch=branch, allparents=allparents)   self.graph = Graph(self.repo, grapher, self.max_file_size, include_mq=True)   self.rowcount = 0 - self.emit(SIGNAL('layoutChanged()')) + self.layoutChanged.emit()   self.ensureBuilt(row=self.fill_step)   self.showMessage.emit('')   QTimer.singleShot(0, lambda: self.filled.emit()) @@ -152,12 +152,12 @@
  if validcols:   self._columns = tuple(validcols)   self.datacache = {} - self.emit(SIGNAL("layoutChanged()")) + self.layoutChanged.emit()     def invalidate(self):   self.reloadConfig()   self.datacache = {} - self.emit(SIGNAL("layoutChanged()")) + self.layoutChanged.emit()     def branch(self):   return self.filterbranch @@ -423,7 +423,7 @@
  'empty the list'   self.graph = None   self.datacache = {} - self.emit(SIGNAL("layoutChanged()")) + self.layoutChanged.emit()     def gettags(self, ctx, gnode):   if ctx.rev() is None:
 
533
534
535
536
537
 
 
538
539
540
 
533
534
535
 
 
536
537
538
539
540
@@ -533,8 +533,8 @@
    BB = QDialogButtonBox   bb = QDialogButtonBox(BB.Ok|BB.Cancel) - self.connect(bb, SIGNAL("accepted()"), self, SLOT("accept()")) - self.connect(bb, SIGNAL("rejected()"), self, SLOT("reject()")) + bb.accepted.connect(self.accept) + bb.rejected.connect(self.reject)   layout.addWidget(bb)   self.bb = bb