|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.UI.FindFileDialog</title> |
|
4 <meta charset="UTF-8"> |
|
5 <style> |
|
6 body { |
|
7 background: #EDECE6; |
|
8 margin: 0em 1em 10em 1em; |
|
9 color: black; |
|
10 } |
|
11 |
|
12 h1 { color: white; background: #85774A; } |
|
13 h2 { color: white; background: #85774A; } |
|
14 h3 { color: white; background: #9D936E; } |
|
15 h4 { color: white; background: #9D936E; } |
|
16 |
|
17 a { color: #BA6D36; } |
|
18 |
|
19 </style> |
|
20 </head> |
|
21 <body><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.UI.FindFileDialog</h1> |
|
23 <p> |
|
24 Module implementing a dialog to search for text in files. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#FindFileDialog">FindFileDialog</a></td> |
|
34 <td>Class implementing a dialog to search for text in files.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="FindFileDialog" ID="FindFileDialog"></a> |
|
43 <h2>FindFileDialog</h2> |
|
44 <p> |
|
45 Class implementing a dialog to search for text in files. |
|
46 </p><p> |
|
47 The occurrences found are displayed in a QTreeWidget showing the filename, |
|
48 the linenumber and the found text. The file will be opened upon a double |
|
49 click onto the respective entry of the list. |
|
50 </p><h3>Signals</h3> |
|
51 <dl> |
|
52 <dt>designerFile(str)</dt> |
|
53 <dd> |
|
54 emitted to open a Qt-Designer file |
|
55 </dd><dt>sourceFile(str, int, str, int, int)</dt> |
|
56 <dd> |
|
57 emitted to open a source file |
|
58 at a line |
|
59 </dd> |
|
60 </dl> |
|
61 <h3>Derived from</h3> |
|
62 QDialog, Ui_FindFileDialog |
|
63 <h3>Class Attributes</h3> |
|
64 <table> |
|
65 <tr><td>endRole</td></tr><tr><td>lineRole</td></tr><tr><td>md5Role</td></tr><tr><td>replaceRole</td></tr><tr><td>startRole</td></tr> |
|
66 </table> |
|
67 <h3>Class Methods</h3> |
|
68 <table> |
|
69 <tr><td>None</td></tr> |
|
70 </table> |
|
71 <h3>Methods</h3> |
|
72 <table> |
|
73 <tr> |
|
74 <td><a href="#FindFileDialog.__init__">FindFileDialog</a></td> |
|
75 <td>Constructor</td> |
|
76 </tr><tr> |
|
77 <td><a href="#FindFileDialog.__contextMenuRequested">__contextMenuRequested</a></td> |
|
78 <td>Private slot to handle the context menu request.</td> |
|
79 </tr><tr> |
|
80 <td><a href="#FindFileDialog.__copyToClipboard">__copyToClipboard</a></td> |
|
81 <td>Private method to copy the path of an entry to the clipboard.</td> |
|
82 </tr><tr> |
|
83 <td><a href="#FindFileDialog.__createItem">__createItem</a></td> |
|
84 <td>Private method to create an entry in the file list.</td> |
|
85 </tr><tr> |
|
86 <td><a href="#FindFileDialog.__doSearch">__doSearch</a></td> |
|
87 <td>Private slot to handle the find button being pressed.</td> |
|
88 </tr><tr> |
|
89 <td><a href="#FindFileDialog.__enableFindButton">__enableFindButton</a></td> |
|
90 <td>Private slot called to enable the find button.</td> |
|
91 </tr><tr> |
|
92 <td><a href="#FindFileDialog.__getFileList">__getFileList</a></td> |
|
93 <td>Private method to get a list of files to search.</td> |
|
94 </tr><tr> |
|
95 <td><a href="#FindFileDialog.__openFile">__openFile</a></td> |
|
96 <td>Private slot to open the currently selected entry.</td> |
|
97 </tr><tr> |
|
98 <td><a href="#FindFileDialog.__stopSearch">__stopSearch</a></td> |
|
99 <td>Private slot to handle the stop button being pressed.</td> |
|
100 </tr><tr> |
|
101 <td><a href="#FindFileDialog.__stripEol">__stripEol</a></td> |
|
102 <td>Private method to strip the eol part.</td> |
|
103 </tr><tr> |
|
104 <td><a href="#FindFileDialog.on_buttonBox_clicked">on_buttonBox_clicked</a></td> |
|
105 <td>Private slot called by a button of the button box clicked.</td> |
|
106 </tr><tr> |
|
107 <td><a href="#FindFileDialog.on_dirButton_clicked">on_dirButton_clicked</a></td> |
|
108 <td>Private slot to handle the selection of the project radio button.</td> |
|
109 </tr><tr> |
|
110 <td><a href="#FindFileDialog.on_dirPicker_editTextChanged">on_dirPicker_editTextChanged</a></td> |
|
111 <td>Private slot to handle the textChanged signal of the directory picker.</td> |
|
112 </tr><tr> |
|
113 <td><a href="#FindFileDialog.on_filterCheckBox_clicked">on_filterCheckBox_clicked</a></td> |
|
114 <td>Private slot to handle the selection of the file filter check box.</td> |
|
115 </tr><tr> |
|
116 <td><a href="#FindFileDialog.on_filterEdit_textEdited">on_filterEdit_textEdited</a></td> |
|
117 <td>Private slot to handle the textChanged signal of the file filter edit.</td> |
|
118 </tr><tr> |
|
119 <td><a href="#FindFileDialog.on_findList_itemDoubleClicked">on_findList_itemDoubleClicked</a></td> |
|
120 <td>Private slot to handle the double click on a file item.</td> |
|
121 </tr><tr> |
|
122 <td><a href="#FindFileDialog.on_findtextCombo_editTextChanged">on_findtextCombo_editTextChanged</a></td> |
|
123 <td>Private slot to handle the editTextChanged signal of the find text combo.</td> |
|
124 </tr><tr> |
|
125 <td><a href="#FindFileDialog.on_projectButton_clicked">on_projectButton_clicked</a></td> |
|
126 <td>Private slot to handle the selection of the project radio button.</td> |
|
127 </tr><tr> |
|
128 <td><a href="#FindFileDialog.on_replaceButton_clicked">on_replaceButton_clicked</a></td> |
|
129 <td>Private slot to perform the requested replace actions.</td> |
|
130 </tr><tr> |
|
131 <td><a href="#FindFileDialog.on_replacetextCombo_editTextChanged">on_replacetextCombo_editTextChanged</a></td> |
|
132 <td>Private slot to handle the editTextChanged signal of the replace text combo.</td> |
|
133 </tr><tr> |
|
134 <td><a href="#FindFileDialog.setOpenFiles">setOpenFiles</a></td> |
|
135 <td>Public slot to set the mode to search in open files.</td> |
|
136 </tr><tr> |
|
137 <td><a href="#FindFileDialog.setSearchDirectory">setSearchDirectory</a></td> |
|
138 <td>Public slot to set the name of the directory to search in.</td> |
|
139 </tr><tr> |
|
140 <td><a href="#FindFileDialog.show">show</a></td> |
|
141 <td>Public method to enable/disable the project button.</td> |
|
142 </tr> |
|
143 </table> |
|
144 <h3>Static Methods</h3> |
|
145 <table> |
|
146 <tr><td>None</td></tr> |
|
147 </table> |
|
148 <a NAME="FindFileDialog.__init__" ID="FindFileDialog.__init__"></a> |
|
149 <h4>FindFileDialog (Constructor)</h4> |
|
150 <b>FindFileDialog</b>(<i>project, replaceMode=False, parent=None</i>) |
|
151 <p> |
|
152 Constructor |
|
153 </p><dl> |
|
154 <dt><i>project</i></dt> |
|
155 <dd> |
|
156 reference to the project object |
|
157 </dd><dt><i>replaceMode</i></dt> |
|
158 <dd> |
|
159 flag indicating the replace dialog mode (boolean) |
|
160 </dd><dt><i>parent</i></dt> |
|
161 <dd> |
|
162 parent widget of this dialog (QWidget) |
|
163 </dd> |
|
164 </dl><a NAME="FindFileDialog.__contextMenuRequested" ID="FindFileDialog.__contextMenuRequested"></a> |
|
165 <h4>FindFileDialog.__contextMenuRequested</h4> |
|
166 <b>__contextMenuRequested</b>(<i>pos</i>) |
|
167 <p> |
|
168 Private slot to handle the context menu request. |
|
169 </p><dl> |
|
170 <dt><i>pos</i></dt> |
|
171 <dd> |
|
172 position the context menu shall be shown (QPoint) |
|
173 </dd> |
|
174 </dl><a NAME="FindFileDialog.__copyToClipboard" ID="FindFileDialog.__copyToClipboard"></a> |
|
175 <h4>FindFileDialog.__copyToClipboard</h4> |
|
176 <b>__copyToClipboard</b>(<i></i>) |
|
177 <p> |
|
178 Private method to copy the path of an entry to the clipboard. |
|
179 </p><a NAME="FindFileDialog.__createItem" ID="FindFileDialog.__createItem"></a> |
|
180 <h4>FindFileDialog.__createItem</h4> |
|
181 <b>__createItem</b>(<i>file, line, text, start, end, replTxt="", md5=""</i>) |
|
182 <p> |
|
183 Private method to create an entry in the file list. |
|
184 </p><dl> |
|
185 <dt><i>file</i></dt> |
|
186 <dd> |
|
187 filename of file (string) |
|
188 </dd><dt><i>line</i></dt> |
|
189 <dd> |
|
190 line number (integer) |
|
191 </dd><dt><i>text</i></dt> |
|
192 <dd> |
|
193 text found (string) |
|
194 </dd><dt><i>start</i></dt> |
|
195 <dd> |
|
196 start position of match (integer) |
|
197 </dd><dt><i>end</i></dt> |
|
198 <dd> |
|
199 end position of match (integer) |
|
200 </dd><dt><i>replTxt</i></dt> |
|
201 <dd> |
|
202 text with replacements applied (string) |
|
203 </dd><dt><i>md5=</i></dt> |
|
204 <dd> |
|
205 MD5 hash of the file (string) |
|
206 </dd> |
|
207 </dl><a NAME="FindFileDialog.__doSearch" ID="FindFileDialog.__doSearch"></a> |
|
208 <h4>FindFileDialog.__doSearch</h4> |
|
209 <b>__doSearch</b>(<i></i>) |
|
210 <p> |
|
211 Private slot to handle the find button being pressed. |
|
212 </p><a NAME="FindFileDialog.__enableFindButton" ID="FindFileDialog.__enableFindButton"></a> |
|
213 <h4>FindFileDialog.__enableFindButton</h4> |
|
214 <b>__enableFindButton</b>(<i></i>) |
|
215 <p> |
|
216 Private slot called to enable the find button. |
|
217 </p><a NAME="FindFileDialog.__getFileList" ID="FindFileDialog.__getFileList"></a> |
|
218 <h4>FindFileDialog.__getFileList</h4> |
|
219 <b>__getFileList</b>(<i>path, filterRe</i>) |
|
220 <p> |
|
221 Private method to get a list of files to search. |
|
222 </p><dl> |
|
223 <dt><i>path</i></dt> |
|
224 <dd> |
|
225 the root directory to search in (string) |
|
226 </dd><dt><i>filterRe</i></dt> |
|
227 <dd> |
|
228 regular expression defining the filter |
|
229 criteria (regexp object) |
|
230 </dd> |
|
231 </dl><dl> |
|
232 <dt>Returns:</dt> |
|
233 <dd> |
|
234 list of files to be processed (list of strings) |
|
235 </dd> |
|
236 </dl><a NAME="FindFileDialog.__openFile" ID="FindFileDialog.__openFile"></a> |
|
237 <h4>FindFileDialog.__openFile</h4> |
|
238 <b>__openFile</b>(<i></i>) |
|
239 <p> |
|
240 Private slot to open the currently selected entry. |
|
241 </p><a NAME="FindFileDialog.__stopSearch" ID="FindFileDialog.__stopSearch"></a> |
|
242 <h4>FindFileDialog.__stopSearch</h4> |
|
243 <b>__stopSearch</b>(<i></i>) |
|
244 <p> |
|
245 Private slot to handle the stop button being pressed. |
|
246 </p><a NAME="FindFileDialog.__stripEol" ID="FindFileDialog.__stripEol"></a> |
|
247 <h4>FindFileDialog.__stripEol</h4> |
|
248 <b>__stripEol</b>(<i>txt</i>) |
|
249 <p> |
|
250 Private method to strip the eol part. |
|
251 </p><dl> |
|
252 <dt><i>txt</i></dt> |
|
253 <dd> |
|
254 line of text that should be treated (string) |
|
255 </dd> |
|
256 </dl><dl> |
|
257 <dt>Returns:</dt> |
|
258 <dd> |
|
259 text with eol stripped (string) |
|
260 </dd> |
|
261 </dl><a NAME="FindFileDialog.on_buttonBox_clicked" ID="FindFileDialog.on_buttonBox_clicked"></a> |
|
262 <h4>FindFileDialog.on_buttonBox_clicked</h4> |
|
263 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
264 <p> |
|
265 Private slot called by a button of the button box clicked. |
|
266 </p><dl> |
|
267 <dt><i>button</i></dt> |
|
268 <dd> |
|
269 button that was clicked (QAbstractButton) |
|
270 </dd> |
|
271 </dl><a NAME="FindFileDialog.on_dirButton_clicked" ID="FindFileDialog.on_dirButton_clicked"></a> |
|
272 <h4>FindFileDialog.on_dirButton_clicked</h4> |
|
273 <b>on_dirButton_clicked</b>(<i></i>) |
|
274 <p> |
|
275 Private slot to handle the selection of the project radio button. |
|
276 </p><a NAME="FindFileDialog.on_dirPicker_editTextChanged" ID="FindFileDialog.on_dirPicker_editTextChanged"></a> |
|
277 <h4>FindFileDialog.on_dirPicker_editTextChanged</h4> |
|
278 <b>on_dirPicker_editTextChanged</b>(<i>text</i>) |
|
279 <p> |
|
280 Private slot to handle the textChanged signal of the directory |
|
281 picker. |
|
282 </p><dl> |
|
283 <dt><i>text</i></dt> |
|
284 <dd> |
|
285 (ignored) |
|
286 </dd> |
|
287 </dl><a NAME="FindFileDialog.on_filterCheckBox_clicked" ID="FindFileDialog.on_filterCheckBox_clicked"></a> |
|
288 <h4>FindFileDialog.on_filterCheckBox_clicked</h4> |
|
289 <b>on_filterCheckBox_clicked</b>(<i></i>) |
|
290 <p> |
|
291 Private slot to handle the selection of the file filter check box. |
|
292 </p><a NAME="FindFileDialog.on_filterEdit_textEdited" ID="FindFileDialog.on_filterEdit_textEdited"></a> |
|
293 <h4>FindFileDialog.on_filterEdit_textEdited</h4> |
|
294 <b>on_filterEdit_textEdited</b>(<i>text</i>) |
|
295 <p> |
|
296 Private slot to handle the textChanged signal of the file filter edit. |
|
297 </p><dl> |
|
298 <dt><i>text</i></dt> |
|
299 <dd> |
|
300 (ignored) |
|
301 </dd> |
|
302 </dl><a NAME="FindFileDialog.on_findList_itemDoubleClicked" ID="FindFileDialog.on_findList_itemDoubleClicked"></a> |
|
303 <h4>FindFileDialog.on_findList_itemDoubleClicked</h4> |
|
304 <b>on_findList_itemDoubleClicked</b>(<i>itm, column</i>) |
|
305 <p> |
|
306 Private slot to handle the double click on a file item. |
|
307 </p><p> |
|
308 It emits the signal |
|
309 sourceFile or designerFile depending on the file extension. |
|
310 </p><dl> |
|
311 <dt><i>itm</i></dt> |
|
312 <dd> |
|
313 the double clicked tree item (QTreeWidgetItem) |
|
314 </dd><dt><i>column</i></dt> |
|
315 <dd> |
|
316 column that was double clicked (integer) (ignored) |
|
317 </dd> |
|
318 </dl><a NAME="FindFileDialog.on_findtextCombo_editTextChanged" ID="FindFileDialog.on_findtextCombo_editTextChanged"></a> |
|
319 <h4>FindFileDialog.on_findtextCombo_editTextChanged</h4> |
|
320 <b>on_findtextCombo_editTextChanged</b>(<i>text</i>) |
|
321 <p> |
|
322 Private slot to handle the editTextChanged signal of the find |
|
323 text combo. |
|
324 </p><dl> |
|
325 <dt><i>text</i></dt> |
|
326 <dd> |
|
327 (ignored) |
|
328 </dd> |
|
329 </dl><a NAME="FindFileDialog.on_projectButton_clicked" ID="FindFileDialog.on_projectButton_clicked"></a> |
|
330 <h4>FindFileDialog.on_projectButton_clicked</h4> |
|
331 <b>on_projectButton_clicked</b>(<i></i>) |
|
332 <p> |
|
333 Private slot to handle the selection of the project radio button. |
|
334 </p><a NAME="FindFileDialog.on_replaceButton_clicked" ID="FindFileDialog.on_replaceButton_clicked"></a> |
|
335 <h4>FindFileDialog.on_replaceButton_clicked</h4> |
|
336 <b>on_replaceButton_clicked</b>(<i></i>) |
|
337 <p> |
|
338 Private slot to perform the requested replace actions. |
|
339 </p><a NAME="FindFileDialog.on_replacetextCombo_editTextChanged" ID="FindFileDialog.on_replacetextCombo_editTextChanged"></a> |
|
340 <h4>FindFileDialog.on_replacetextCombo_editTextChanged</h4> |
|
341 <b>on_replacetextCombo_editTextChanged</b>(<i>text</i>) |
|
342 <p> |
|
343 Private slot to handle the editTextChanged signal of the replace |
|
344 text combo. |
|
345 </p><dl> |
|
346 <dt><i>text</i></dt> |
|
347 <dd> |
|
348 (ignored) |
|
349 </dd> |
|
350 </dl><a NAME="FindFileDialog.setOpenFiles" ID="FindFileDialog.setOpenFiles"></a> |
|
351 <h4>FindFileDialog.setOpenFiles</h4> |
|
352 <b>setOpenFiles</b>(<i></i>) |
|
353 <p> |
|
354 Public slot to set the mode to search in open files. |
|
355 </p><a NAME="FindFileDialog.setSearchDirectory" ID="FindFileDialog.setSearchDirectory"></a> |
|
356 <h4>FindFileDialog.setSearchDirectory</h4> |
|
357 <b>setSearchDirectory</b>(<i>searchDir</i>) |
|
358 <p> |
|
359 Public slot to set the name of the directory to search in. |
|
360 </p><dl> |
|
361 <dt><i>searchDir</i></dt> |
|
362 <dd> |
|
363 name of the directory to search in (string) |
|
364 </dd> |
|
365 </dl><a NAME="FindFileDialog.show" ID="FindFileDialog.show"></a> |
|
366 <h4>FindFileDialog.show</h4> |
|
367 <b>show</b>(<i>txt=""</i>) |
|
368 <p> |
|
369 Public method to enable/disable the project button. |
|
370 </p><dl> |
|
371 <dt><i>txt</i></dt> |
|
372 <dd> |
|
373 text to be shown in the searchtext combo (string) |
|
374 </dd> |
|
375 </dl> |
|
376 <div align="right"><a href="#top">Up</a></div> |
|
377 <hr /> |
|
378 </body></html> |