def __init__(self, parent, model, **params): super(TachogramPlotDatasourceListWidget, self).__init__(parent, add_widget_to_parent=True, layout=QVBoxLayout()) self.params = Params(**params) toolbars = ToolBarManager( self, CheckUncheckToolBarWidget, OperationalToolBarWidget, toolbar_close_handler=self.params.close_tachogram_plot_handler) self.layout().addWidget(toolbars) self.__showTachogramsButton__ = PushButtonWidget( self, i18n="poincare.plot.show.tachograms.button", i18n_def="Show tachograms", enabled=False, clicked_handler=self.__showTachogramsHandler__, enabled_precheck_handler=self.__enabledPrecheckHandler__) self.__allowTachogramsDuplicationButton__ = CheckBoxWidget( self, i18n="poincare.plot.allow.tachograms.duplications.button", i18n_def="Allow tachograms duplication", enabled=False, enabled_precheck_handler=self.__enabledPrecheckHandler__) self.__closeAllTachogramsButton__ = PushButtonWidget( self, i18n="poincare.plot.close.all.tachograms.button", i18n_def="Close all tachograms", enabled=False, clicked_handler=self.__closeTachogramsHandler__) self.__datasourceList__ = \ ListWidgetWidget(self, list_item_clicked_handler=self.__datasourceItemClickedHandler__, # @IgnorePep8 list_item_double_clicked_handler=self.__datasourceDoubleItemClickedHandler__, # @IgnorePep8 selectionMode=QAbstractItemView.MultiSelection, selectionBehavior=QAbstractItemView.SelectRows) if len(model) > 0: for row in range(len(model)): fileSpecification = model[row] ListWidgetItemWidget(self.__datasourceList__, text=fileSpecification.filename, data=fileSpecification) else: ListWidgetItemWidget(self.__datasourceList__, text='model not specified or incorrect type') self.__filesPreviewButton__ = PushButtonWidget( self, i18n="poincare.plot.files.preview.button", i18n_def="Files preview", enabled=False, clicked_handler=self.__filesPreviewHandler__, enabled_precheck_handler=self.__enabledPrecheckHandler__)
def __createFileConstraintsComposite__(self, parent): fileConstraintsComposite = CompositeWidget(parent, layout=QHBoxLayout()) self.chooseRootDirButton = PushButtonWidget( fileConstraintsComposite, i18n="datasource.datasource.choose.root.dir.button", i18n_def="Choose root dir", clicked_handler=self.chooseRootDirAction) LabelWidget(fileConstraintsComposite, i18n="datasource.root.dir.label", i18n_def="Root dir:") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) self.rootDirLabel = LabelWidget(fileConstraintsComposite, i18n="datasource.root.dir.label", i18n_def="[Not set]", sizePolicy=sizePolicy, stretch_after_widget=1) LabelWidget(fileConstraintsComposite, i18n="datasource.file.name.filter.label", i18n_def="Files name filter") self.filesExtension = LineEditWidget( fileConstraintsComposite, maxLength=15, width=get_width_of_n_letters(14), text="*", enabled_precheck_handler=self.enabledPrecheckHandler) self.recursively = CheckBoxWidget( fileConstraintsComposite, i18n="datasource.search.files.recursively.label", i18n_def="Search files recursively", clicked_handler=self.reload, enabled_precheck_handler=self.enabledPrecheckHandler) self.onlyKnownTypes = CheckBoxWidget( fileConstraintsComposite, i18n="datasource.only.known.types.checkbox", i18n_def="Only known types", checked=True, clicked_handler=self.reload, enabled_precheck_handler=self.enabledPrecheckHandler)
def __createAnnotationButtons__(self): self.__button_group__ = ButtonGroupWidget(self) unique_annotations0 = get_unique_annotations( self.data_accessor.annotation0) empty = is_empty(unique_annotations0) self.set_title(empty) self.__all_button__ = CheckBoxWidget( self, i18n_def='ALL', clicked_handler=self.__all_button_handler__) self.__button_group__.addButton(self.__all_button__) for unique_annotation in unique_annotations0: annotationCheckBox = CheckBoxWidget( self, i18n_def=str(unique_annotation)) self.__button_group__.addButton(annotationCheckBox) self.__button_group__.setExclusive(False) self.__button_group__.connect(self.__button_group__, BUTTON_CLICKED_SIGNAL, self.__button_handler__)
def __init__(self, _parent, _header_label, _header_elements): QWidget.__init__(self, parent=_parent) layout = QVBoxLayout(self) self.setLayout(layout) LabelWidget(self, i18n_def=_header_label) self.__buttons__ = {} for header_element in _header_elements: handler = __Handler__(header_element.handler, self) self.__buttons__[header_element.name] = CheckBoxWidget(self, i18n_def=header_element.label, clicked_handler=handler)
def __init__(self, parent, **params): super(GlobalSeparatorWidget, self).__init__(parent, **params) self.params = Params(**params) self.globalSettingsCheckBox = None if self.params.globalHandler: self.globalSettingsCheckBox = CheckBoxWidget( self.separatorsGroupBox, i18n="separator.global.separator", i18n_def="Global separator") self.separatorsGroupBox.connect(self.globalSettingsCheckBox, SIGNAL("clicked()"), self.globalSettingsButtonClicked)
def __createHeadersTablePreview__(self): self.__createHeaderPreviewGroup__() self.headersTablePreview = TableViewWidget(self.fileHeaderPreviewGroup, selectionBehavior=QAbstractItemView.SelectRows, selectionMode=QAbstractItemView.SingleSelection) self.__globalCheckBox__ = CheckBoxWidget( self.fileHeaderPreviewGroup, i18n="global.data.column.index", i18n_def="Global columns indexes", clicked_handler=self.__globalClicked__) if self.__globalIndex__.signal: self.__globalCheckBox__.setChecked(True)
def __init__(self, parent, **params): super(ActivityWidget, self).__init__(parent, layout=QHBoxLayout(), **params) self.activityButton = CheckBoxWidget( self, i18n="activity.button", i18n_def="Save as activity", clicked_handler=self.__clickedHandler__) LabelWidget(self, i18n="activity.description.label", i18n_def="Activity description (optional):") self.activityDescription = LineEditWidget(self, enabled=False)
def __createButtons__(self): buttons_composite = CompositeWidget(self, layout=QHBoxLayout()) self.__calculate_button__ = PushButtonWidget( buttons_composite, i18n_def="Calculate statistics", clicked_handler=self.__calculate_statistics_handler__) self.__enabled_calculation_button__(False) self.__save_outcomes_button__ = CheckBoxWidget( buttons_composite, i18n_def="Save outcomes", enabled=False) #if parameter save_outcomes_fixed_state is not None #then it's equal to checked state of save outcomes button #and this state couldn't be change later by a user if self.params.save_outcomes_fixed_state: self.__save_outcomes_button__.setChecked( self.params.save_outcomes_fixed_state)
def createActionButton(self): self.__action_button__ = CheckBoxWidget(self, i18n_def='Use filter') self.__action_button__.setChecked(False) self.__action_button__.setEnabled(False)