|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Project.QuickFindFileDialog</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.Project.QuickFindFileDialog</h1> |
|
23 <p> |
|
24 Module implementing a quick search for files. |
|
25 </p><p> |
|
26 This is basically the FindFileNameDialog modified to support faster |
|
27 interactions. |
|
28 </p> |
|
29 <h3>Global Attributes</h3> |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 <table> |
|
35 <tr> |
|
36 <td><a href="#QuickFindFileDialog">QuickFindFileDialog</a></td> |
|
37 <td>Class implementing the Quick Find File by Name Dialog.</td> |
|
38 </tr> |
|
39 </table> |
|
40 <h3>Functions</h3> |
|
41 <table> |
|
42 <tr><td>None</td></tr> |
|
43 </table> |
|
44 <hr /><hr /> |
|
45 <a NAME="QuickFindFileDialog" ID="QuickFindFileDialog"></a> |
|
46 <h2>QuickFindFileDialog</h2> |
|
47 <p> |
|
48 Class implementing the Quick Find File by Name Dialog. |
|
49 </p><p> |
|
50 This dialog provides a slightly more streamlined behaviour |
|
51 than the standard FindFileNameDialog in that it tries to |
|
52 match any name in the project against (fragmentary) bits of |
|
53 file names. |
|
54 </p><h3>Signals</h3> |
|
55 <dl> |
|
56 <dt>designerFile(str)</dt> |
|
57 <dd> |
|
58 emitted to open a Qt-Designer file |
|
59 </dd><dt>linguistFile(str)</dt> |
|
60 <dd> |
|
61 emitted to open a Qt translation file |
|
62 </dd><dt>sourceFile(str)</dt> |
|
63 <dd> |
|
64 emitted to open a file in the editor |
|
65 </dd> |
|
66 </dl> |
|
67 <h3>Derived from</h3> |
|
68 QWidget, Ui_QuickFindFile |
|
69 <h3>Class Attributes</h3> |
|
70 <table> |
|
71 <tr><td>None</td></tr> |
|
72 </table> |
|
73 <h3>Class Methods</h3> |
|
74 <table> |
|
75 <tr><td>None</td></tr> |
|
76 </table> |
|
77 <h3>Methods</h3> |
|
78 <table> |
|
79 <tr> |
|
80 <td><a href="#QuickFindFileDialog.__init__">QuickFindFileDialog</a></td> |
|
81 <td>Constructor</td> |
|
82 </tr><tr> |
|
83 <td><a href="#QuickFindFileDialog.__generateLocations">__generateLocations</a></td> |
|
84 <td>Private method to generate a set of locations that can be searched.</td> |
|
85 </tr><tr> |
|
86 <td><a href="#QuickFindFileDialog.__openFile">__openFile</a></td> |
|
87 <td>Private slot to open a file.</td> |
|
88 </tr><tr> |
|
89 <td><a href="#QuickFindFileDialog.__searchFile">__searchFile</a></td> |
|
90 <td>Private slot to handle the search.</td> |
|
91 </tr><tr> |
|
92 <td><a href="#QuickFindFileDialog.__sortedMatches">__sortedMatches</a></td> |
|
93 <td>Private method to find the subset of items which match a search term.</td> |
|
94 </tr><tr> |
|
95 <td><a href="#QuickFindFileDialog.eventFilter">eventFilter</a></td> |
|
96 <td>Public method to handle event for another object.</td> |
|
97 </tr><tr> |
|
98 <td><a href="#QuickFindFileDialog.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="#QuickFindFileDialog.on_fileList_currentItemChanged">on_fileList_currentItemChanged</a></td> |
|
102 <td>Private slot handling a change of the current item.</td> |
|
103 </tr><tr> |
|
104 <td><a href="#QuickFindFileDialog.on_fileList_itemActivated">on_fileList_itemActivated</a></td> |
|
105 <td>Private slot to handle the double click on a file item.</td> |
|
106 </tr><tr> |
|
107 <td><a href="#QuickFindFileDialog.on_fileNameEdit_returnPressed">on_fileNameEdit_returnPressed</a></td> |
|
108 <td>Private slot to handle enter being pressed on the file name edit box.</td> |
|
109 </tr><tr> |
|
110 <td><a href="#QuickFindFileDialog.on_fileNameEdit_textChanged">on_fileNameEdit_textChanged</a></td> |
|
111 <td>Private slot to handle the textChanged signal of the file name edit.</td> |
|
112 </tr><tr> |
|
113 <td><a href="#QuickFindFileDialog.show">show</a></td> |
|
114 <td>Public method to enable/disable the project checkbox.</td> |
|
115 </tr> |
|
116 </table> |
|
117 <h3>Static Methods</h3> |
|
118 <table> |
|
119 <tr><td>None</td></tr> |
|
120 </table> |
|
121 <a NAME="QuickFindFileDialog.__init__" ID="QuickFindFileDialog.__init__"></a> |
|
122 <h4>QuickFindFileDialog (Constructor)</h4> |
|
123 <b>QuickFindFileDialog</b>(<i>project, parent=None</i>) |
|
124 <p> |
|
125 Constructor |
|
126 </p><dl> |
|
127 <dt><i>project</i> (Project)</dt> |
|
128 <dd> |
|
129 reference to the project object |
|
130 </dd><dt><i>parent</i> (QWidget)</dt> |
|
131 <dd> |
|
132 parent widget of this dialog |
|
133 </dd> |
|
134 </dl><a NAME="QuickFindFileDialog.__generateLocations" ID="QuickFindFileDialog.__generateLocations"></a> |
|
135 <h4>QuickFindFileDialog.__generateLocations</h4> |
|
136 <b>__generateLocations</b>(<i></i>) |
|
137 <p> |
|
138 Private method to generate a set of locations that can be searched. |
|
139 </p><dl> |
|
140 <dt>Returns:</dt> |
|
141 <dd> |
|
142 yields set of files in our project... |
|
143 </dd> |
|
144 </dl><dl> |
|
145 <dt>Return Type:</dt> |
|
146 <dd> |
|
147 str |
|
148 </dd> |
|
149 </dl><a NAME="QuickFindFileDialog.__openFile" ID="QuickFindFileDialog.__openFile"></a> |
|
150 <h4>QuickFindFileDialog.__openFile</h4> |
|
151 <b>__openFile</b>(<i>itm=None</i>) |
|
152 <p> |
|
153 Private slot to open a file. |
|
154 </p><p> |
|
155 It emits the signal sourceFile or designerFile depending on the |
|
156 file extension. |
|
157 </p><dl> |
|
158 <dt><i>itm</i> (QTreeWidgetItem)</dt> |
|
159 <dd> |
|
160 item to be opened |
|
161 </dd> |
|
162 </dl><dl> |
|
163 <dt>Returns:</dt> |
|
164 <dd> |
|
165 flag indicating a file was opened |
|
166 </dd> |
|
167 </dl><dl> |
|
168 <dt>Return Type:</dt> |
|
169 <dd> |
|
170 bool |
|
171 </dd> |
|
172 </dl><a NAME="QuickFindFileDialog.__searchFile" ID="QuickFindFileDialog.__searchFile"></a> |
|
173 <h4>QuickFindFileDialog.__searchFile</h4> |
|
174 <b>__searchFile</b>(<i></i>) |
|
175 <p> |
|
176 Private slot to handle the search. |
|
177 </p><a NAME="QuickFindFileDialog.__sortedMatches" ID="QuickFindFileDialog.__sortedMatches"></a> |
|
178 <h4>QuickFindFileDialog.__sortedMatches</h4> |
|
179 <b>__sortedMatches</b>(<i>items, searchTerm</i>) |
|
180 <p> |
|
181 Private method to find the subset of items which match a search term. |
|
182 </p><dl> |
|
183 <dt><i>items</i> (list of str)</dt> |
|
184 <dd> |
|
185 list of items to be scanned for the search term |
|
186 </dd><dt><i>searchTerm</i> (str)</dt> |
|
187 <dd> |
|
188 search term to be searched for |
|
189 </dd> |
|
190 </dl><dl> |
|
191 <dt>Returns:</dt> |
|
192 <dd> |
|
193 sorted subset of items which match searchTerm in |
|
194 relevance order (i.e. the most likely match first) |
|
195 </dd> |
|
196 </dl><dl> |
|
197 <dt>Return Type:</dt> |
|
198 <dd> |
|
199 list of tuple of bool, int and str |
|
200 </dd> |
|
201 </dl><a NAME="QuickFindFileDialog.eventFilter" ID="QuickFindFileDialog.eventFilter"></a> |
|
202 <h4>QuickFindFileDialog.eventFilter</h4> |
|
203 <b>eventFilter</b>(<i>source, event</i>) |
|
204 <p> |
|
205 Public method to handle event for another object. |
|
206 </p><dl> |
|
207 <dt><i>source</i> (QObject)</dt> |
|
208 <dd> |
|
209 object to handle events for |
|
210 </dd><dt><i>event</i> (QEvent)</dt> |
|
211 <dd> |
|
212 event to handle |
|
213 </dd> |
|
214 </dl><dl> |
|
215 <dt>Returns:</dt> |
|
216 <dd> |
|
217 flag indicating that the event was handled |
|
218 </dd> |
|
219 </dl><dl> |
|
220 <dt>Return Type:</dt> |
|
221 <dd> |
|
222 bool |
|
223 </dd> |
|
224 </dl><a NAME="QuickFindFileDialog.on_buttonBox_clicked" ID="QuickFindFileDialog.on_buttonBox_clicked"></a> |
|
225 <h4>QuickFindFileDialog.on_buttonBox_clicked</h4> |
|
226 <b>on_buttonBox_clicked</b>(<i>button</i>) |
|
227 <p> |
|
228 Private slot called by a button of the button box clicked. |
|
229 </p><dl> |
|
230 <dt><i>button</i></dt> |
|
231 <dd> |
|
232 button that was clicked (QAbstractButton) |
|
233 </dd> |
|
234 </dl><a NAME="QuickFindFileDialog.on_fileList_currentItemChanged" ID="QuickFindFileDialog.on_fileList_currentItemChanged"></a> |
|
235 <h4>QuickFindFileDialog.on_fileList_currentItemChanged</h4> |
|
236 <b>on_fileList_currentItemChanged</b>(<i>current, previous</i>) |
|
237 <p> |
|
238 Private slot handling a change of the current item. |
|
239 </p><dl> |
|
240 <dt><i>current</i></dt> |
|
241 <dd> |
|
242 current item (QTreeWidgetItem) |
|
243 </dd><dt><i>previous</i></dt> |
|
244 <dd> |
|
245 prevoius current item (QTreeWidgetItem) |
|
246 </dd> |
|
247 </dl><a NAME="QuickFindFileDialog.on_fileList_itemActivated" ID="QuickFindFileDialog.on_fileList_itemActivated"></a> |
|
248 <h4>QuickFindFileDialog.on_fileList_itemActivated</h4> |
|
249 <b>on_fileList_itemActivated</b>(<i>itm, column</i>) |
|
250 <p> |
|
251 Private slot to handle the double click on a file item. |
|
252 </p><p> |
|
253 It emits the signal sourceFile or designerFile depending on the |
|
254 file extension. |
|
255 </p><dl> |
|
256 <dt><i>itm</i></dt> |
|
257 <dd> |
|
258 the double clicked listview item (QTreeWidgetItem) |
|
259 </dd><dt><i>column</i></dt> |
|
260 <dd> |
|
261 column that was double clicked (integer) (ignored) |
|
262 </dd> |
|
263 </dl><a NAME="QuickFindFileDialog.on_fileNameEdit_returnPressed" ID="QuickFindFileDialog.on_fileNameEdit_returnPressed"></a> |
|
264 <h4>QuickFindFileDialog.on_fileNameEdit_returnPressed</h4> |
|
265 <b>on_fileNameEdit_returnPressed</b>(<i></i>) |
|
266 <p> |
|
267 Private slot to handle enter being pressed on the file name edit box. |
|
268 </p><a NAME="QuickFindFileDialog.on_fileNameEdit_textChanged" ID="QuickFindFileDialog.on_fileNameEdit_textChanged"></a> |
|
269 <h4>QuickFindFileDialog.on_fileNameEdit_textChanged</h4> |
|
270 <b>on_fileNameEdit_textChanged</b>(<i>text</i>) |
|
271 <p> |
|
272 Private slot to handle the textChanged signal of the file name edit. |
|
273 </p><dl> |
|
274 <dt><i>text</i></dt> |
|
275 <dd> |
|
276 (ignored) |
|
277 </dd> |
|
278 </dl><a NAME="QuickFindFileDialog.show" ID="QuickFindFileDialog.show"></a> |
|
279 <h4>QuickFindFileDialog.show</h4> |
|
280 <b>show</b>(<i></i>) |
|
281 <p> |
|
282 Public method to enable/disable the project checkbox. |
|
283 </p> |
|
284 <div align="right"><a href="#top">Up</a></div> |
|
285 <hr /> |
|
286 </body></html> |