Documentation/Source/eric6.UI.FindFileDialog.html

changeset 3673
e26d7d0c1088
child 4602
48cc4820e2c2
equal deleted inserted replaced
3670:f0cb7579c0b4 3673:e26d7d0c1088
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_dirCombo_editTextChanged">on_dirCombo_editTextChanged</a></td>
111 <td>Private slot to handle the textChanged signal of the directory combo box.</td>
112 </tr><tr>
113 <td><a href="#FindFileDialog.on_dirSelectButton_clicked">on_dirSelectButton_clicked</a></td>
114 <td>Private slot to display a directory selection dialog.</td>
115 </tr><tr>
116 <td><a href="#FindFileDialog.on_filterCheckBox_clicked">on_filterCheckBox_clicked</a></td>
117 <td>Private slot to handle the selection of the file filter check box.</td>
118 </tr><tr>
119 <td><a href="#FindFileDialog.on_filterEdit_textEdited">on_filterEdit_textEdited</a></td>
120 <td>Private slot to handle the textChanged signal of the file filter edit.</td>
121 </tr><tr>
122 <td><a href="#FindFileDialog.on_findList_itemDoubleClicked">on_findList_itemDoubleClicked</a></td>
123 <td>Private slot to handle the double click on a file item.</td>
124 </tr><tr>
125 <td><a href="#FindFileDialog.on_findtextCombo_editTextChanged">on_findtextCombo_editTextChanged</a></td>
126 <td>Private slot to handle the editTextChanged signal of the find text combo.</td>
127 </tr><tr>
128 <td><a href="#FindFileDialog.on_projectButton_clicked">on_projectButton_clicked</a></td>
129 <td>Private slot to handle the selection of the project radio button.</td>
130 </tr><tr>
131 <td><a href="#FindFileDialog.on_replaceButton_clicked">on_replaceButton_clicked</a></td>
132 <td>Private slot to perform the requested replace actions.</td>
133 </tr><tr>
134 <td><a href="#FindFileDialog.on_replacetextCombo_editTextChanged">on_replacetextCombo_editTextChanged</a></td>
135 <td>Private slot to handle the editTextChanged signal of the replace text combo.</td>
136 </tr><tr>
137 <td><a href="#FindFileDialog.setOpenFiles">setOpenFiles</a></td>
138 <td>Public slot to set the mode to search in open files.</td>
139 </tr><tr>
140 <td><a href="#FindFileDialog.setSearchDirectory">setSearchDirectory</a></td>
141 <td>Public slot to set the name of the directory to search in.</td>
142 </tr><tr>
143 <td><a href="#FindFileDialog.show">show</a></td>
144 <td>Public method to enable/disable the project button.</td>
145 </tr>
146 </table>
147 <h3>Static Methods</h3>
148 <table>
149 <tr><td>None</td></tr>
150 </table>
151 <a NAME="FindFileDialog.__init__" ID="FindFileDialog.__init__"></a>
152 <h4>FindFileDialog (Constructor)</h4>
153 <b>FindFileDialog</b>(<i>project, replaceMode=False, parent=None</i>)
154 <p>
155 Constructor
156 </p><dl>
157 <dt><i>project</i></dt>
158 <dd>
159 reference to the project object
160 </dd><dt><i>replaceMode</i></dt>
161 <dd>
162 flag indicating the replace dialog mode (boolean)
163 </dd><dt><i>parent</i></dt>
164 <dd>
165 parent widget of this dialog (QWidget)
166 </dd>
167 </dl><a NAME="FindFileDialog.__contextMenuRequested" ID="FindFileDialog.__contextMenuRequested"></a>
168 <h4>FindFileDialog.__contextMenuRequested</h4>
169 <b>__contextMenuRequested</b>(<i>pos</i>)
170 <p>
171 Private slot to handle the context menu request.
172 </p><dl>
173 <dt><i>pos</i></dt>
174 <dd>
175 position the context menu shall be shown (QPoint)
176 </dd>
177 </dl><a NAME="FindFileDialog.__copyToClipboard" ID="FindFileDialog.__copyToClipboard"></a>
178 <h4>FindFileDialog.__copyToClipboard</h4>
179 <b>__copyToClipboard</b>(<i></i>)
180 <p>
181 Private method to copy the path of an entry to the clipboard.
182 </p><a NAME="FindFileDialog.__createItem" ID="FindFileDialog.__createItem"></a>
183 <h4>FindFileDialog.__createItem</h4>
184 <b>__createItem</b>(<i>file, line, text, start, end, replTxt="", md5=""</i>)
185 <p>
186 Private method to create an entry in the file list.
187 </p><dl>
188 <dt><i>file</i></dt>
189 <dd>
190 filename of file (string)
191 </dd><dt><i>line</i></dt>
192 <dd>
193 line number (integer)
194 </dd><dt><i>text</i></dt>
195 <dd>
196 text found (string)
197 </dd><dt><i>start</i></dt>
198 <dd>
199 start position of match (integer)
200 </dd><dt><i>end</i></dt>
201 <dd>
202 end position of match (integer)
203 </dd><dt><i>replTxt</i></dt>
204 <dd>
205 text with replacements applied (string)
206 </dd><dt><i>md5=</i></dt>
207 <dd>
208 MD5 hash of the file (string)
209 </dd>
210 </dl><a NAME="FindFileDialog.__doSearch" ID="FindFileDialog.__doSearch"></a>
211 <h4>FindFileDialog.__doSearch</h4>
212 <b>__doSearch</b>(<i></i>)
213 <p>
214 Private slot to handle the find button being pressed.
215 </p><a NAME="FindFileDialog.__enableFindButton" ID="FindFileDialog.__enableFindButton"></a>
216 <h4>FindFileDialog.__enableFindButton</h4>
217 <b>__enableFindButton</b>(<i></i>)
218 <p>
219 Private slot called to enable the find button.
220 </p><a NAME="FindFileDialog.__getFileList" ID="FindFileDialog.__getFileList"></a>
221 <h4>FindFileDialog.__getFileList</h4>
222 <b>__getFileList</b>(<i>path, filterRe</i>)
223 <p>
224 Private method to get a list of files to search.
225 </p><dl>
226 <dt><i>path</i></dt>
227 <dd>
228 the root directory to search in (string)
229 </dd><dt><i>filterRe</i></dt>
230 <dd>
231 regular expression defining the filter
232 criteria (regexp object)
233 </dd>
234 </dl><dl>
235 <dt>Returns:</dt>
236 <dd>
237 list of files to be processed (list of strings)
238 </dd>
239 </dl><a NAME="FindFileDialog.__openFile" ID="FindFileDialog.__openFile"></a>
240 <h4>FindFileDialog.__openFile</h4>
241 <b>__openFile</b>(<i></i>)
242 <p>
243 Private slot to open the currently selected entry.
244 </p><a NAME="FindFileDialog.__stopSearch" ID="FindFileDialog.__stopSearch"></a>
245 <h4>FindFileDialog.__stopSearch</h4>
246 <b>__stopSearch</b>(<i></i>)
247 <p>
248 Private slot to handle the stop button being pressed.
249 </p><a NAME="FindFileDialog.__stripEol" ID="FindFileDialog.__stripEol"></a>
250 <h4>FindFileDialog.__stripEol</h4>
251 <b>__stripEol</b>(<i>txt</i>)
252 <p>
253 Private method to strip the eol part.
254 </p><dl>
255 <dt><i>txt</i></dt>
256 <dd>
257 line of text that should be treated (string)
258 </dd>
259 </dl><dl>
260 <dt>Returns:</dt>
261 <dd>
262 text with eol stripped (string)
263 </dd>
264 </dl><a NAME="FindFileDialog.on_buttonBox_clicked" ID="FindFileDialog.on_buttonBox_clicked"></a>
265 <h4>FindFileDialog.on_buttonBox_clicked</h4>
266 <b>on_buttonBox_clicked</b>(<i>button</i>)
267 <p>
268 Private slot called by a button of the button box clicked.
269 </p><dl>
270 <dt><i>button</i></dt>
271 <dd>
272 button that was clicked (QAbstractButton)
273 </dd>
274 </dl><a NAME="FindFileDialog.on_dirButton_clicked" ID="FindFileDialog.on_dirButton_clicked"></a>
275 <h4>FindFileDialog.on_dirButton_clicked</h4>
276 <b>on_dirButton_clicked</b>(<i></i>)
277 <p>
278 Private slot to handle the selection of the project radio button.
279 </p><a NAME="FindFileDialog.on_dirCombo_editTextChanged" ID="FindFileDialog.on_dirCombo_editTextChanged"></a>
280 <h4>FindFileDialog.on_dirCombo_editTextChanged</h4>
281 <b>on_dirCombo_editTextChanged</b>(<i>text</i>)
282 <p>
283 Private slot to handle the textChanged signal of the directory
284 combo box.
285 </p><dl>
286 <dt><i>text</i></dt>
287 <dd>
288 (ignored)
289 </dd>
290 </dl><a NAME="FindFileDialog.on_dirSelectButton_clicked" ID="FindFileDialog.on_dirSelectButton_clicked"></a>
291 <h4>FindFileDialog.on_dirSelectButton_clicked</h4>
292 <b>on_dirSelectButton_clicked</b>(<i></i>)
293 <p>
294 Private slot to display a directory selection dialog.
295 </p><a NAME="FindFileDialog.on_filterCheckBox_clicked" ID="FindFileDialog.on_filterCheckBox_clicked"></a>
296 <h4>FindFileDialog.on_filterCheckBox_clicked</h4>
297 <b>on_filterCheckBox_clicked</b>(<i></i>)
298 <p>
299 Private slot to handle the selection of the file filter check box.
300 </p><a NAME="FindFileDialog.on_filterEdit_textEdited" ID="FindFileDialog.on_filterEdit_textEdited"></a>
301 <h4>FindFileDialog.on_filterEdit_textEdited</h4>
302 <b>on_filterEdit_textEdited</b>(<i>text</i>)
303 <p>
304 Private slot to handle the textChanged signal of the file filter edit.
305 </p><dl>
306 <dt><i>text</i></dt>
307 <dd>
308 (ignored)
309 </dd>
310 </dl><a NAME="FindFileDialog.on_findList_itemDoubleClicked" ID="FindFileDialog.on_findList_itemDoubleClicked"></a>
311 <h4>FindFileDialog.on_findList_itemDoubleClicked</h4>
312 <b>on_findList_itemDoubleClicked</b>(<i>itm, column</i>)
313 <p>
314 Private slot to handle the double click on a file item.
315 </p><p>
316 It emits the signal
317 sourceFile or designerFile depending on the file extension.
318 </p><dl>
319 <dt><i>itm</i></dt>
320 <dd>
321 the double clicked tree item (QTreeWidgetItem)
322 </dd><dt><i>column</i></dt>
323 <dd>
324 column that was double clicked (integer) (ignored)
325 </dd>
326 </dl><a NAME="FindFileDialog.on_findtextCombo_editTextChanged" ID="FindFileDialog.on_findtextCombo_editTextChanged"></a>
327 <h4>FindFileDialog.on_findtextCombo_editTextChanged</h4>
328 <b>on_findtextCombo_editTextChanged</b>(<i>text</i>)
329 <p>
330 Private slot to handle the editTextChanged signal of the find
331 text combo.
332 </p><dl>
333 <dt><i>text</i></dt>
334 <dd>
335 (ignored)
336 </dd>
337 </dl><a NAME="FindFileDialog.on_projectButton_clicked" ID="FindFileDialog.on_projectButton_clicked"></a>
338 <h4>FindFileDialog.on_projectButton_clicked</h4>
339 <b>on_projectButton_clicked</b>(<i></i>)
340 <p>
341 Private slot to handle the selection of the project radio button.
342 </p><a NAME="FindFileDialog.on_replaceButton_clicked" ID="FindFileDialog.on_replaceButton_clicked"></a>
343 <h4>FindFileDialog.on_replaceButton_clicked</h4>
344 <b>on_replaceButton_clicked</b>(<i></i>)
345 <p>
346 Private slot to perform the requested replace actions.
347 </p><a NAME="FindFileDialog.on_replacetextCombo_editTextChanged" ID="FindFileDialog.on_replacetextCombo_editTextChanged"></a>
348 <h4>FindFileDialog.on_replacetextCombo_editTextChanged</h4>
349 <b>on_replacetextCombo_editTextChanged</b>(<i>text</i>)
350 <p>
351 Private slot to handle the editTextChanged signal of the replace
352 text combo.
353 </p><dl>
354 <dt><i>text</i></dt>
355 <dd>
356 (ignored)
357 </dd>
358 </dl><a NAME="FindFileDialog.setOpenFiles" ID="FindFileDialog.setOpenFiles"></a>
359 <h4>FindFileDialog.setOpenFiles</h4>
360 <b>setOpenFiles</b>(<i></i>)
361 <p>
362 Public slot to set the mode to search in open files.
363 </p><a NAME="FindFileDialog.setSearchDirectory" ID="FindFileDialog.setSearchDirectory"></a>
364 <h4>FindFileDialog.setSearchDirectory</h4>
365 <b>setSearchDirectory</b>(<i>searchDir</i>)
366 <p>
367 Public slot to set the name of the directory to search in.
368 </p><dl>
369 <dt><i>searchDir</i></dt>
370 <dd>
371 name of the directory to search in (string)
372 </dd>
373 </dl><a NAME="FindFileDialog.show" ID="FindFileDialog.show"></a>
374 <h4>FindFileDialog.show</h4>
375 <b>show</b>(<i>txt=""</i>)
376 <p>
377 Public method to enable/disable the project button.
378 </p><dl>
379 <dt><i>txt</i></dt>
380 <dd>
381 text to be shown in the searchtext combo (string)
382 </dd>
383 </dl>
384 <div align="right"><a href="#top">Up</a></div>
385 <hr />
386 </body></html>

eric ide

mercurial