50 |
50 |
51 self.searchDirCompleter = E5DirCompleter(self.searchDirEdit) |
51 self.searchDirCompleter = E5DirCompleter(self.searchDirEdit) |
52 |
52 |
53 self.fileList.headerItem().setText(self.fileList.columnCount(), "") |
53 self.fileList.headerItem().setText(self.fileList.columnCount(), "") |
54 |
54 |
55 self.stopButton = \ |
55 self.stopButton = self.buttonBox.addButton( |
56 self.buttonBox.addButton(self.trUtf8("Stop"), QDialogButtonBox.ActionRole) |
56 self.trUtf8("Stop"), QDialogButtonBox.ActionRole) |
57 self.stopButton.setToolTip(self.trUtf8("Press to stop the search")) |
57 self.stopButton.setToolTip(self.trUtf8("Press to stop the search")) |
58 self.stopButton.setEnabled(False) |
58 self.stopButton.setEnabled(False) |
59 self.buttonBox.button(QDialogButtonBox.Open).setToolTip( |
59 self.buttonBox.button(QDialogButtonBox.Open).setToolTip( |
60 self.trUtf8("Opens the selected file")) |
60 self.trUtf8("Opens the selected file")) |
61 self.buttonBox.button(QDialogButtonBox.Open).setEnabled(False) |
61 self.buttonBox.button(QDialogButtonBox.Open).setEnabled(False) |
129 self.stopButton.setEnabled(True) |
129 self.stopButton.setEnabled(True) |
130 QApplication.processEvents() |
130 QApplication.processEvents() |
131 |
131 |
132 for path in searchPaths: |
132 for path in searchPaths: |
133 if os.path.isdir(path): |
133 if os.path.isdir(path): |
134 files = direntries(path, True, fileNamePattern, False, self.checkStop) |
134 files = direntries(path, True, fileNamePattern, |
|
135 False, self.checkStop) |
135 if files: |
136 if files: |
136 found = True |
137 found = True |
137 for file in files: |
138 for file in files: |
138 fp, fn = os.path.split(file) |
139 fp, fn = os.path.split(file) |
139 if fn in locations: |
140 if fn in locations: |
171 """ |
172 """ |
172 self.__searchFile() |
173 self.__searchFile() |
173 |
174 |
174 def on_fileExtEdit_textChanged(self, text): |
175 def on_fileExtEdit_textChanged(self, text): |
175 """ |
176 """ |
176 Private slot to handle the textChanged signal of the file extension edit. |
177 Private slot to handle the textChanged signal of the file extension |
|
178 edit. |
177 |
179 |
178 @param text (ignored) |
180 @param text (ignored) |
179 """ |
181 """ |
180 self.__searchFile() |
182 self.__searchFile() |
181 |
183 |
182 def on_searchDirEdit_textChanged(self, text): |
184 def on_searchDirEdit_textChanged(self, text): |
183 """ |
185 """ |
184 Private slot to handle the textChanged signal of the search directory edit. |
186 Private slot to handle the textChanged signal of the search directory |
|
187 edit. |
185 |
188 |
186 @param text text of the search dir edit (string) |
189 @param text text of the search dir edit (string) |
187 """ |
190 """ |
188 self.searchDirCheckBox.setEnabled(text != "") |
191 self.searchDirCheckBox.setEnabled(text != "") |
189 if self.searchDirCheckBox.isChecked(): |
192 if self.searchDirCheckBox.isChecked(): |
190 self.__searchFile() |
193 self.__searchFile() |
191 |
194 |
192 @pyqtSlot() |
195 @pyqtSlot() |
193 def on_searchDirButton_clicked(self): |
196 def on_searchDirButton_clicked(self): |
194 """ |
197 """ |
195 Private slot to handle the clicked signal of the search directory selection |
198 Private slot to handle the clicked signal of the search directory |
|
199 selection |
196 button. |
200 button. |
197 """ |
201 """ |
198 searchDir = E5FileDialog.getExistingDirectory( |
202 searchDir = E5FileDialog.getExistingDirectory( |
199 None, |
203 None, |
200 self.trUtf8("Select search directory"), |
204 self.trUtf8("Select search directory"), |
204 if searchDir: |
208 if searchDir: |
205 self.searchDirEdit.setText(Utilities.toNativeSeparators(searchDir)) |
209 self.searchDirEdit.setText(Utilities.toNativeSeparators(searchDir)) |
206 |
210 |
207 def on_searchDirCheckBox_toggled(self, checked): |
211 def on_searchDirCheckBox_toggled(self, checked): |
208 """ |
212 """ |
209 Private slot to handle the toggled signal of the search directory checkbox. |
213 Private slot to handle the toggled signal of the search directory |
|
214 checkbox. |
210 |
215 |
211 @param checked flag indicating the state of the checkbox (boolean) |
216 @param checked flag indicating the state of the checkbox (boolean) |
212 """ |
217 """ |
213 if self.searchDirEdit.text(): |
218 if self.searchDirEdit.text(): |
214 self.__searchFile() |
219 self.__searchFile() |
247 Private slot handling a change of the current item. |
252 Private slot handling a change of the current item. |
248 |
253 |
249 @param current current item (QTreeWidgetItem) |
254 @param current current item (QTreeWidgetItem) |
250 @param previous prevoius current item (QTreeWidgetItem) |
255 @param previous prevoius current item (QTreeWidgetItem) |
251 """ |
256 """ |
252 self.buttonBox.button(QDialogButtonBox.Open).setEnabled(current is not None) |
257 self.buttonBox.button(QDialogButtonBox.Open).setEnabled( |
|
258 current is not None) |
253 |
259 |
254 def show(self): |
260 def show(self): |
255 """ |
261 """ |
256 Overwritten method to enable/disable the project checkbox. |
262 Overwritten method to enable/disable the project checkbox. |
257 """ |
263 """ |