def __init__(self, parent, **params): get_or_put(params, 'layout', QVBoxLayout()) super(FiltersWidget, self).__init__(parent, **params) self.params = Params(**params) self.data_accessor = self.params.data_accessor # alias #if self.params.use_apply_button == True: if 1 == 1: self.data_accessor.addListener(self, __FilterActivatedDataVectorListener__(self)) filtersGroup = GroupBoxWidget(self, layout=QVBoxLayout(), i18n_def=params.get('title', 'Filters')) annotation_widget_class = params.get('annotation_widget_class', False) if annotation_widget_class: self.__annotation_filter__ = annotation_widget_class( filtersGroup, data_accessor=self.data_accessor) else: self.__annotation_filter__ = CommonAnnotationFilterWidget( filtersGroup, data_accessor=self.data_accessor) self.__square_filter__ = SquareFilterWidget(filtersGroup, data_accessor=self.data_accessor, use_apply_button=self.params.use_apply_button) if params.get('restore_button', False): self.__restore_button__ = PushButtonWidget(filtersGroup, i18n_def='Back to unfiltered data', clicked_handler=self.__restore_handler__, enabled=False)
def __createHeaderPreviewGroup__(self): if hasattr(self, 'fileHeaderPreviewGroup'): self.fileHeaderPreviewGroup.deleteLater() self.fileHeaderPreviewGroup = GroupBoxWidget(self.tableViewComposite, i18n="datasource.file.header.preview", i18n_def="Header preview", layout=QVBoxLayout(), hidden=True, enabled=False)
def __createFilesGroupBox(self, pageLayout): self.filesGroupBox = GroupBoxWidget( self, i18n="datasource.files.group.title", i18n_def="Files", layout=QVBoxLayout()) self.__createFileConstraintsComposite__(self.filesGroupBox) self.__createReloadButton__(self.filesGroupBox) self.__createTableView__(self.filesGroupBox) self.__createFilesOperationsComposite__(self.filesGroupBox) self.changeEnablemend(False) self.chooseRootDirButton.setEnabled(True)