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