244 def __setDefaultFiltersLists(self, keepSelection=False): |
244 def __setDefaultFiltersLists(self, keepSelection=False): |
245 """ |
245 """ |
246 Private slot to set the default file filter combo boxes. |
246 Private slot to set the default file filter combo boxes. |
247 |
247 |
248 @param keepSelection flag indicating to keep the current selection |
248 @param keepSelection flag indicating to keep the current selection |
249 if possible (boolean) |
249 if possible |
|
250 @type bool |
250 """ |
251 """ |
251 if keepSelection: |
252 if keepSelection: |
252 selectedOpenFilter = self.openFilesFilterComboBox.currentText() |
253 selectedOpenFilter = self.openFilesFilterComboBox.currentText() |
253 selectedSaveFilter = self.saveFilesFilterComboBox.currentText() |
254 selectedSaveFilter = self.saveFilesFilterComboBox.currentText() |
254 |
255 |
289 |
290 |
290 def __checkFileFilter(self, fileFilter): |
291 def __checkFileFilter(self, fileFilter): |
291 """ |
292 """ |
292 Private method to check a file filter for validity. |
293 Private method to check a file filter for validity. |
293 |
294 |
294 @param fileFilter file filter pattern to check (string) |
295 @param fileFilter file filter pattern to check |
295 @return flag indicating validity (boolean) |
296 @type str |
|
297 @return flag indicating validity |
|
298 @rtype bool |
296 """ |
299 """ |
297 if not self.__showsOpenFilters and fileFilter.count("*") != 1: |
300 if not self.__showsOpenFilters and fileFilter.count("*") != 1: |
298 EricMessageBox.critical( |
301 EricMessageBox.critical( |
299 self, |
302 self, |
300 self.tr("Add File Filter"), |
303 self.tr("Add File Filter"), |
364 @pyqtSlot(bool) |
367 @pyqtSlot(bool) |
365 def on_openFiltersButton_toggled(self, checked): |
368 def on_openFiltersButton_toggled(self, checked): |
366 """ |
369 """ |
367 Private slot to switch the list of file filters. |
370 Private slot to switch the list of file filters. |
368 |
371 |
369 @param checked flag indicating the check state of the button (boolean) |
372 @param checked flag indicating the check state of the button |
|
373 @type bool |
370 """ |
374 """ |
371 self.__extractFileFilters() |
375 self.__extractFileFilters() |
372 self.__showsOpenFilters = checked |
376 self.__showsOpenFilters = checked |
373 self.fileFiltersList.clear() |
377 self.fileFiltersList.clear() |
374 if checked: |
378 if checked: |
379 @pyqtSlot(QListWidgetItem, QListWidgetItem) |
383 @pyqtSlot(QListWidgetItem, QListWidgetItem) |
380 def on_fileFiltersList_currentItemChanged(self, current, previous): |
384 def on_fileFiltersList_currentItemChanged(self, current, previous): |
381 """ |
385 """ |
382 Private slot to set the state of the edit and delete buttons. |
386 Private slot to set the state of the edit and delete buttons. |
383 |
387 |
384 @param current new current item (QListWidgetItem) |
388 @param current new current item |
385 @param previous previous current item (QListWidgetItem) |
389 @type QListWidgetItem |
|
390 @param previous previous current item |
|
391 @type QListWidgetItem |
386 """ |
392 """ |
387 self.editFileFilterButton.setEnabled(current is not None) |
393 self.editFileFilterButton.setEnabled(current is not None) |
388 self.deleteFileFilterButton.setEnabled(current is not None) |
394 self.deleteFileFilterButton.setEnabled(current is not None) |
389 |
395 |
390 @pyqtSlot() |
396 @pyqtSlot() |
410 def create(dlg): # noqa: U100 |
416 def create(dlg): # noqa: U100 |
411 """ |
417 """ |
412 Module function to create the configuration page. |
418 Module function to create the configuration page. |
413 |
419 |
414 @param dlg reference to the configuration dialog |
420 @param dlg reference to the configuration dialog |
415 @return reference to the instantiated page (ConfigurationPageBase) |
421 @type ConfigurationDialog |
|
422 @return reference to the instantiated page |
|
423 @rtype ConfigurationPageBase |
416 """ |
424 """ |
417 page = EditorFilePage() |
425 page = EditorFilePage() |
418 return page |
426 return page |