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