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

grep: emit signals for parent's status bar

More details ui.progress signals can be added later, when we get
our features integrated with hg grep

Changeset 2b6a9ee4297b

Parent e4482e1d8bd9

by Steve Borho

Changes to one file · Browse files at 2b6a9ee4297b Showing diff from parent e4482e1d8bd9 Diff from another changeset...

 
26
27
28
29
30
31
 
 
 
 
 
 
32
33
34
 
79
80
81
82
83
84
 
85
86
87
 
122
123
124
125
126
127
128
129
130
131
 
132
133
 
134
135
 
 
 
 
 
 
136
137
138
 
26
27
28
 
29
30
31
32
33
34
35
36
37
38
39
 
84
85
86
 
 
 
87
88
89
90
 
125
126
127
 
 
 
 
 
128
 
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@@ -26,9 +26,14 @@
 # smart visual diffs  # context menu for matches  # emit errors to parent's status bar -# emit to parent's progress bar    class SearchWidget(QWidget): + '''Working copy and repository search widget + SIGNALS: + loadBegin() - for progress bar + loadComplete() - for progress bar + errorMessage(QString) - for status bar + '''   def __init__(self, root=None, parent=None):   QWidget.__init__(self, parent)   @@ -79,9 +84,7 @@
  if self.thread and self.thread.isRunning():   self.thread.terminate()   self.thread.wait() - for col in xrange(COL_TEXT): - self.tv.resizeColumnToContents(col) - self.le.setEnabled(True) + self.finished()   else:   self.close()   else: @@ -122,17 +125,19 @@
  self.tv.setColumnHidden(COL_USER, False)   self.thread = HistorySearchThread(self.repo, pattern, icase)   - def finished(): - for col in xrange(COL_TEXT): - self.tv.resizeColumnToContents(col) - self.le.setEnabled(True) -   self.le.setEnabled(False) - self.connect(self.thread, SIGNAL('finished'), finished) + self.connect(self.thread, SIGNAL('finished'), self.finished)   self.connect(self.thread, SIGNAL('matchedRow'),   lambda row: model.appendRow(*row)) + self.emit(SIGNAL('loadBegin'))   self.thread.start()   + def finished(self): + for col in xrange(COL_TEXT): + self.tv.resizeColumnToContents(col) + self.le.setEnabled(True) + self.emit(SIGNAL('loadComplete')) +    class HistorySearchThread(QThread):   '''Background thread for searching repository history'''