69 |
69 |
70 self.stopButton.setEnabled(False) |
70 self.stopButton.setEnabled(False) |
71 self.stopButton.clicked.connect(self.__stopSearch) |
71 self.stopButton.clicked.connect(self.__stopSearch) |
72 self.stopButton.setIcon(UI.PixmapCache.getIcon("stopLoading")) |
72 self.stopButton.setIcon(UI.PixmapCache.getIcon("stopLoading")) |
73 |
73 |
74 self.findButton.setEnabled(False) |
|
75 self.findButton.clicked.connect(self.__searchFile) |
74 self.findButton.clicked.connect(self.__searchFile) |
76 self.findButton.setIcon(UI.PixmapCache.getIcon("find")) |
75 self.findButton.setIcon(UI.PixmapCache.getIcon("find")) |
77 |
76 |
78 self.clearButton.setEnabled(False) |
77 self.clearButton.setEnabled(False) |
79 self.clearButton.clicked.connect(self.__clearResults) |
78 self.clearButton.clicked.connect(self.__clearResults) |
142 def __searchFile(self): |
141 def __searchFile(self): |
143 """ |
142 """ |
144 Private slot to handle the search. |
143 Private slot to handle the search. |
145 """ |
144 """ |
146 fileName = self.fileNameEdit.text() |
145 fileName = self.fileNameEdit.text() |
147 if not fileName: |
|
148 self.fileList.clear() |
|
149 return |
|
150 |
|
151 fileExt = self.fileExtEdit.text() |
146 fileExt = self.fileExtEdit.text() |
152 if not fileExt and Utilities.isWindowsPlatform(): |
|
153 self.fileList.clear() |
|
154 return |
|
155 |
147 |
156 self.findStatusLabel.clear() |
148 self.findStatusLabel.clear() |
157 |
149 |
158 patternFormat = fileExt and "{0}{1}{2}" or "{0}*{1}{2}" |
150 if "*" in fileName or "?" in fileName: |
|
151 patternFormat = "{0}{1}{2}" |
|
152 else: |
|
153 patternFormat = "{0}*{1}{2}" |
|
154 |
159 fileNamePattern = patternFormat.format( |
155 fileNamePattern = patternFormat.format( |
160 fileName, os.extsep, fileExt and fileExt or '*') |
156 fileName or '*', os.extsep, fileExt or '*') |
161 |
157 |
162 searchPaths = [] |
158 searchPaths = [] |
163 if ( |
159 if ( |
164 self.searchDirCheckBox.isChecked() and |
160 self.searchDirCheckBox.isChecked() and |
165 self.searchDirPicker.text() != "" |
161 self.searchDirPicker.text() != "" |
226 """ |
222 """ |
227 QApplication.processEvents() |
223 QApplication.processEvents() |
228 return self.__shouldStop |
224 return self.__shouldStop |
229 |
225 |
230 @pyqtSlot(str) |
226 @pyqtSlot(str) |
231 def on_fileNameEdit_textChanged(self, text): |
|
232 """ |
|
233 Private slot to handle the textChanged signal of the file name edit. |
|
234 |
|
235 @param text (ignored) |
|
236 @type str |
|
237 """ |
|
238 self.findButton.setEnabled(bool(text)) |
|
239 |
|
240 @pyqtSlot(str) |
|
241 def on_searchDirPicker_textChanged(self, text): |
227 def on_searchDirPicker_textChanged(self, text): |
242 """ |
228 """ |
243 Private slot to handle the textChanged signal of the search directory |
229 Private slot to handle the textChanged signal of the search directory |
244 edit. |
230 edit. |
245 |
231 |