def setup_ui(self): super(SettingUI, self).setup_ui() max_width_label = QLabel(text="最大宽度", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) max_width_combo = QComboBox() max_width_combo.addItems(Globals.max_width_arr) max_width_combo.setCurrentIndex(self.max_width_index) max_width_combo.currentIndexChanged.connect(self.on_combo_changed) size_label = QLabel(text="输出字号", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) size_spin = QSpinBox() size_spin.setRange(10, 64) size_spin.setValue(Globals.config.get(Globals.UserData.font_size)) size_spin.valueChanged.connect(self.on_save_font_size) output_name_label = QLabel(text="输出名称", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) output_name_edit = QLineEdit( Globals.config.get(Globals.UserData.font_save_name)) output_name_edit.textEdited.connect(self.on_output_name_edited) output_label = QLabel(text="输出目录", alignment=QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) output_line_edit = QLineEdit( Globals.config.get(Globals.UserData.output_dir)) output_line_edit.setReadOnly(True) output_line_edit.cursorPositionChanged.connect( self.on_output_choose_clicked) mode_1_radio = QRadioButton("图集模式") mode_2_radio = QRadioButton("字体模式") mode_1_radio.setChecked(True) mode_1_radio.toggled.connect(self.on_mode_1_radio_toggled) mode_radio_group = QButtonGroup(self) mode_radio_group.addButton(mode_1_radio, 0) mode_radio_group.addButton(mode_2_radio, 1) self.main_layout.setColumnStretch(1, 1) self.main_layout.setColumnStretch(3, 1) self.main_layout.addWidget(mode_1_radio, 0, 0, 1, 1) self.main_layout.addWidget(mode_2_radio, 0, 1, 1, 1) self.main_layout.addWidget(output_name_label, 1, 0, 1, 1) self.main_layout.addWidget(output_name_edit, 1, 1, 1, 1) self.main_layout.addWidget(max_width_label, 1, 2, 1, 1) self.main_layout.addWidget(max_width_combo, 1, 3, 1, 1) self.main_layout.addWidget(output_label, 2, 0, 1, 1) self.main_layout.addWidget(output_line_edit, 2, 1, 1, 1) self.main_layout.addWidget(size_label, 2, 2, 1, 1) self.main_layout.addWidget(size_spin, 2, 3, 1, 1) self.max_width_combo = max_width_combo self.size_spin = size_spin self.output_name_edit = output_name_edit self.output_line_edit = output_line_edit
class IntSlider(QWidget): """THe IntSlider class provides controller with a handle which can be pulled back and forth to change the **integer**. """ def __init__(self): super().__init__() self._slider = QSlider(Qt.Horizontal) self._spinbox = QSpinBox() # setup signal self._slider.valueChanged.connect(self._value_changed) # type: ignore self._spinbox.valueChanged.connect(self._value_changed) # type: ignore # setup layout h_layout = AHBoxLayout(self) h_layout.addWidget(self._slider) h_layout.addWidget(self._spinbox) @property def current_value(self) -> int: return self._spinbox.value() @property def range(self) -> tuple[int, int]: return (self._slider.minimum(), self._slider.maximum()) @range.setter def range(self, range: tuple[int, int]) -> None: self._slider.setRange(*range) self._spinbox.setRange(*range) @Slot(int) # type: ignore def _value_changed(self, value: int) -> None: sender = self.sender() if sender is self._slider: self._spinbox.blockSignals(True) self._spinbox.setValue(value) self._spinbox.blockSignals(False) elif sender is self._spinbox: self._slider.blockSignals(True) self._slider.setValue(value) self._slider.blockSignals(False) def update_current_value(self, num: int) -> None: """Update current number of this widget. This method changes the display of the gui. Parameters ---------- num : int Integer. """ self._spinbox.setValue(num)
class WaitForImageWidget(StepBaseWidget): def __init__(self, step: Steps.WaitForImage): super(WaitForImageWidget, self).__init__(step) detail_layout: QFormLayout = self.ui.detailFrame.layout() # Image selection self.image_label = QLabel() self.image_button = QPushButton("Select Image") # Timeout Input self.timeout_spin = QSpinBox() # Signal/Slots self.timeout_spin.valueChanged.connect(self.update_timeout) self.image_button.clicked.connect(self.update_image) # Widget insert detail_layout.addRow("Image: ", self.image_label) detail_layout.addRow("", self.image_button) detail_layout.addRow("Timeout: ", self.timeout_spin) # Init self.image_label.setText(self.step.image) self.timeout_spin.setValue(self.step.timeout) if not self.image_label.text(): self.image_label.setText("No image selected") def update_image(self): file_name = QFileDialog.getOpenFileName( parent=None, caption="Choose Image to Find", dir=self.timeline.manager.resource_pool.as_posix(), filter="Images (*.png *.jpg)", ) if not file_name: print("Canceled selection") return self.step.image = file_name[0] self.image_label.setText(self.step.image) if not self.image_label.text(): self.image_label.setText("No image selected") def update_timeout(self): self.step.timeout = self.timeout_spin.value()
class Ui_CalcyOption(object): def setupUi(self, CalcyOption): if not CalcyOption.objectName(): CalcyOption.setObjectName(u"CalcyOption") CalcyOption.resize(516, 262) self.horizontalLayout_2 = QHBoxLayout(CalcyOption) self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.tabWidget = QTabWidget(CalcyOption) self.tabWidget.setObjectName(u"tabWidget") font = QFont() font.setFamilies([u"Verdana"]) font.setPointSize(10) self.tabWidget.setFont(font) self.tabOutput = QWidget() self.tabOutput.setObjectName(u"tabOutput") self.formLayout = QFormLayout(self.tabOutput) self.formLayout.setObjectName(u"formLayout") self.verticalLayout_5 = QVBoxLayout() self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.groupBox_2 = QGroupBox(self.tabOutput) self.groupBox_2.setObjectName(u"groupBox_2") self.verticalLayout_6 = QVBoxLayout(self.groupBox_2) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.radioButtonDecSepSystem = QRadioButton(self.groupBox_2) self.radioButtonDecSepSystem.setObjectName(u"radioButtonDecSepSystem") self.radioButtonDecSepSystem.setChecked(True) self.verticalLayout_6.addWidget(self.radioButtonDecSepSystem) self.radioButtonDecSepComa = QRadioButton(self.groupBox_2) self.radioButtonDecSepComa.setObjectName(u"radioButtonDecSepComa") self.verticalLayout_6.addWidget(self.radioButtonDecSepComa) self.radioButtonDecSepDot = QRadioButton(self.groupBox_2) self.radioButtonDecSepDot.setObjectName(u"radioButtonDecSepDot") self.verticalLayout_6.addWidget(self.radioButtonDecSepDot) self.verticalLayout_5.addWidget(self.groupBox_2) self.verticalLayout_4 = QVBoxLayout() self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.label = QLabel(self.tabOutput) self.label.setObjectName(u"label") self.horizontalLayout_3.addWidget(self.label) self.spinBoxOutputPrecision = QSpinBox(self.tabOutput) self.spinBoxOutputPrecision.setObjectName(u"spinBoxOutputPrecision") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.spinBoxOutputPrecision.sizePolicy().hasHeightForWidth()) self.spinBoxOutputPrecision.setSizePolicy(sizePolicy) self.spinBoxOutputPrecision.setMinimumSize(QSize(55, 0)) self.spinBoxOutputPrecision.setMaximumSize(QSize(60, 30)) self.spinBoxOutputPrecision.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.spinBoxOutputPrecision.setMinimum(1) self.spinBoxOutputPrecision.setMaximum(10) self.spinBoxOutputPrecision.setValue(3) self.horizontalLayout_3.addWidget(self.spinBoxOutputPrecision) self.verticalLayout_4.addLayout(self.horizontalLayout_3) self.checkBoxShowGrpSep = QCheckBox(self.tabOutput) self.checkBoxShowGrpSep.setObjectName(u"checkBoxShowGrpSep") self.checkBoxShowGrpSep.setChecked(False) self.verticalLayout_4.addWidget(self.checkBoxShowGrpSep) self.checkBoxCopyToClipboard = QCheckBox(self.tabOutput) self.checkBoxCopyToClipboard.setObjectName(u"checkBoxCopyToClipboard") self.checkBoxCopyToClipboard.setChecked(True) self.verticalLayout_4.addWidget(self.checkBoxCopyToClipboard) self.verticalLayout_5.addLayout(self.verticalLayout_4) self.formLayout.setLayout(0, QFormLayout.LabelRole, self.verticalLayout_5) self.tabWidget.addTab(self.tabOutput, "") self.tabRadix = QWidget() self.tabRadix.setObjectName(u"tabRadix") self.horizontalLayout_6 = QHBoxLayout(self.tabRadix) self.horizontalLayout_6.setObjectName(u"horizontalLayout_6") self.verticalLayout_3 = QVBoxLayout() self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.groupBox_3 = QGroupBox(self.tabRadix) self.groupBox_3.setObjectName(u"groupBox_3") self.horizontalLayout = QHBoxLayout(self.groupBox_3) self.horizontalLayout.setObjectName(u"horizontalLayout") self.checkBoxBinOut = QCheckBox(self.groupBox_3) self.checkBoxBinOut.setObjectName(u"checkBoxBinOut") self.checkBoxBinOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxBinOut) self.checkBoxOctOut = QCheckBox(self.groupBox_3) self.checkBoxOctOut.setObjectName(u"checkBoxOctOut") self.checkBoxOctOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxOctOut) self.checkBoxHexOut = QCheckBox(self.groupBox_3) self.checkBoxHexOut.setObjectName(u"checkBoxHexOut") self.checkBoxHexOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxHexOut) self.checkBoxSizeOut = QCheckBox(self.groupBox_3) self.checkBoxSizeOut.setObjectName(u"checkBoxSizeOut") self.checkBoxSizeOut.setChecked(True) self.horizontalLayout.addWidget(self.checkBoxSizeOut) self.verticalLayout_3.addWidget(self.groupBox_3) self.verticalLayout = QVBoxLayout() self.verticalLayout.setObjectName(u"verticalLayout") self.checkBoxShowBasePrefix = QCheckBox(self.tabRadix) self.checkBoxShowBasePrefix.setObjectName(u"checkBoxShowBasePrefix") self.checkBoxShowBasePrefix.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowBasePrefix) self.checkBoxShowLeadingZerosBin = QCheckBox(self.tabRadix) self.checkBoxShowLeadingZerosBin.setObjectName(u"checkBoxShowLeadingZerosBin") self.checkBoxShowLeadingZerosBin.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowLeadingZerosBin) self.checkBoxShowLeadingZerosOct = QCheckBox(self.tabRadix) self.checkBoxShowLeadingZerosOct.setObjectName(u"checkBoxShowLeadingZerosOct") self.checkBoxShowLeadingZerosOct.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowLeadingZerosOct) self.checkBoxShowLeadingZerosHex = QCheckBox(self.tabRadix) self.checkBoxShowLeadingZerosHex.setObjectName(u"checkBoxShowLeadingZerosHex") self.checkBoxShowLeadingZerosHex.setChecked(True) self.verticalLayout.addWidget(self.checkBoxShowLeadingZerosHex) self.verticalSpacer_2 = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.verticalLayout.addItem(self.verticalSpacer_2) self.verticalLayout_3.addLayout(self.verticalLayout) self.horizontalLayout_6.addLayout(self.verticalLayout_3) self.verticalLayout_2 = QVBoxLayout() self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.groupBoxBW = QGroupBox(self.tabRadix) self.groupBoxBW.setObjectName(u"groupBoxBW") self.horizontalLayout_5 = QHBoxLayout(self.groupBoxBW) self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.radioButtonBW64 = QRadioButton(self.groupBoxBW) self.radioButtonBW64.setObjectName(u"radioButtonBW64") self.horizontalLayout_5.addWidget(self.radioButtonBW64) self.radioButtonBW32 = QRadioButton(self.groupBoxBW) self.radioButtonBW32.setObjectName(u"radioButtonBW32") self.horizontalLayout_5.addWidget(self.radioButtonBW32) self.radioButtonBW16 = QRadioButton(self.groupBoxBW) self.radioButtonBW16.setObjectName(u"radioButtonBW16") self.radioButtonBW16.setChecked(True) self.horizontalLayout_5.addWidget(self.radioButtonBW16) self.radioButtonBW8 = QRadioButton(self.groupBoxBW) self.radioButtonBW8.setObjectName(u"radioButtonBW8") self.horizontalLayout_5.addWidget(self.radioButtonBW8) self.verticalLayout_2.addWidget(self.groupBoxBW) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.verticalLayout_2.addItem(self.verticalSpacer) self.horizontalLayout_6.addLayout(self.verticalLayout_2) self.tabWidget.addTab(self.tabRadix, "") self.horizontalLayout_2.addWidget(self.tabWidget) self.retranslateUi(CalcyOption) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(CalcyOption) # setupUi def retranslateUi(self, CalcyOption): CalcyOption.setWindowTitle(QCoreApplication.translate("CalcyOption", u"CalcyPy - Simple calculator", None)) self.groupBox_2.setTitle(QCoreApplication.translate("CalcyOption", u"Decimal point and group separator", None)) #if QT_CONFIG(tooltip) self.radioButtonDecSepSystem.setToolTip(QCoreApplication.translate("CalcyOption", u"Use system locale settings", None)) #endif // QT_CONFIG(tooltip) self.radioButtonDecSepSystem.setText(QCoreApplication.translate("CalcyOption", u"System default", None)) self.radioButtonDecSepComa.setText(QCoreApplication.translate("CalcyOption", u"Coma as decimal point and dot as group separator", None)) self.radioButtonDecSepDot.setText(QCoreApplication.translate("CalcyOption", u"Dot as decimal point and coma as group separator", None)) self.label.setText(QCoreApplication.translate("CalcyOption", u"Decimal output Precision", None)) #if QT_CONFIG(tooltip) self.spinBoxOutputPrecision.setToolTip(QCoreApplication.translate("CalcyOption", u"<html><head/><body><p>Sets the maximal number of digits</p></body></html>", None)) #endif // QT_CONFIG(tooltip) self.checkBoxShowGrpSep.setText(QCoreApplication.translate("CalcyOption", u"Show group separator in result", None)) #if QT_CONFIG(tooltip) self.checkBoxCopyToClipboard.setToolTip(QCoreApplication.translate("CalcyOption", u"If this option is enabled, pressing enter key will copy calculation result to clipboard.", None)) #endif // QT_CONFIG(tooltip) self.checkBoxCopyToClipboard.setText(QCoreApplication.translate("CalcyOption", u"Use Enter key to Copy result to Clipboard", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabOutput), QCoreApplication.translate("CalcyOption", u"General", None)) self.groupBox_3.setTitle(QCoreApplication.translate("CalcyOption", u"Show result as", None)) self.checkBoxBinOut.setText(QCoreApplication.translate("CalcyOption", u"Bin", None)) self.checkBoxOctOut.setText(QCoreApplication.translate("CalcyOption", u"Oct", None)) self.checkBoxHexOut.setText(QCoreApplication.translate("CalcyOption", u"Hex", None)) self.checkBoxSizeOut.setText(QCoreApplication.translate("CalcyOption", u"Size", None)) #if QT_CONFIG(tooltip) self.checkBoxShowBasePrefix.setToolTip(QCoreApplication.translate("CalcyOption", u"Show prefix for given number base in results (i.e. \"0x\" for hexadecimal numbers)", None)) #endif // QT_CONFIG(tooltip) self.checkBoxShowBasePrefix.setText(QCoreApplication.translate("CalcyOption", u"Show base prefix in result", None)) self.checkBoxShowLeadingZerosBin.setText(QCoreApplication.translate("CalcyOption", u"Show leading zeros in bin output", None)) self.checkBoxShowLeadingZerosOct.setText(QCoreApplication.translate("CalcyOption", u"Show leading zeros in oct output", None)) self.checkBoxShowLeadingZerosHex.setText(QCoreApplication.translate("CalcyOption", u"Show leading zeros in hex output", None)) self.groupBoxBW.setTitle(QCoreApplication.translate("CalcyOption", u"Calculation bit width", None)) self.radioButtonBW64.setText(QCoreApplication.translate("CalcyOption", u"64", None)) self.radioButtonBW32.setText(QCoreApplication.translate("CalcyOption", u"32", None)) self.radioButtonBW16.setText(QCoreApplication.translate("CalcyOption", u"16", None)) self.radioButtonBW8.setText(QCoreApplication.translate("CalcyOption", u"8", None)) self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabRadix), QCoreApplication.translate("CalcyOption", u"Radix", None))
class WindowNewExercise(QWidget): def __init__(self, parent): super().__init__(parent) self.setWindowFlag(Qt.Window) self.setWindowFlag(Qt.WindowStaysOnTopHint) self.setWindowTitle("Add New Exercise") self.setWindowModality(Qt.WindowModal) self.setLayout(QFormLayout()) self.label_name = QLabel("Exercise Name:", self) self.line_edit_name = QLineEdit(self) self.layout().addRow(self.label_name, self.line_edit_name) self.label_measures = QLabel("Number of Measures:", self) self.spin_box_measures = QSpinBox(self) self.min, self.max = 0, 5 self.spin_box_measures.setRange(self.min, self.max) self.spin_box_measures.valueChanged.connect( self.change_visibility_measure_widgets) self.layout().addRow(self.label_measures, self.spin_box_measures) self.labels_measure_type = [] self.comboboxes_type = [] self.labels_measure_name = [] self.line_edits_measure_name = [] for i in range(self.min, self.max): label_measure_type = QLabel(f"Type of Measure {i + 1}:", self) self.labels_measure_type.append(label_measure_type) combobox_type = QComboBox(self) self.comboboxes_type.append(combobox_type) self.layout().addRow(label_measure_type, combobox_type) combobox_type.hide() label_measure_type.hide() label_measure_name = QLabel(f"Name of Measure {i + 1}:", self) self.labels_measure_name.append(label_measure_name) line_edit_measure_name = QLineEdit(self) self.line_edits_measure_name.append(line_edit_measure_name) self.layout().addRow(label_measure_name, line_edit_measure_name) label_measure_name.hide() line_edit_measure_name.hide() self.button_discard = QPushButton("Discard Exercise", self) self.button_discard.clicked.connect(self.button_discard_action) self.button_add = QPushButton("Add Exercise", self) self.button_add.clicked.connect(self.button_add_action) self.layout().addRow(self.button_discard, self.button_add) def change_visibility_measure_widgets(self): number_measures = self.spin_box_measures.value() for i in range(self.min, self.max): if number_measures > i: self.labels_measure_type[i].show() self.comboboxes_type[i].show() self.labels_measure_name[i].show() self.line_edits_measure_name[i].show() else: self.labels_measure_type[i].hide() self.comboboxes_type[i].hide() self.labels_measure_name[i].hide() self.line_edits_measure_name[i].hide() def closeEvent(self, event: QCloseEvent) -> None: self.line_edit_name.setText("") self.spin_box_measures.setValue(0) for line_edit in self.line_edits_measure_name: line_edit.setText("") return super().closeEvent(event) def button_discard_action(self): self.close() def button_add_action(self): self.close()
class Ui_TaxExportDlg(object): def setupUi(self, TaxExportDlg): if not TaxExportDlg.objectName(): TaxExportDlg.setObjectName(u"TaxExportDlg") TaxExportDlg.resize(602, 315) self.gridLayout = QGridLayout(TaxExportDlg) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setHorizontalSpacing(6) self.gridLayout.setContentsMargins(9, 9, 9, 9) self.line = QFrame(TaxExportDlg) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.gridLayout.addWidget(self.line, 4, 0, 1, 4) self.XlsSelectBtn = QPushButton(TaxExportDlg) self.XlsSelectBtn.setObjectName(u"XlsSelectBtn") sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.XlsSelectBtn.sizePolicy().hasHeightForWidth()) self.XlsSelectBtn.setSizePolicy(sizePolicy) self.gridLayout.addWidget(self.XlsSelectBtn, 3, 2, 1, 1) self.WarningLbl = QLabel(TaxExportDlg) self.WarningLbl.setObjectName(u"WarningLbl") font = QFont() font.setItalic(True) self.WarningLbl.setFont(font) self.gridLayout.addWidget(self.WarningLbl, 5, 0, 1, 4) self.DlsgGroup = QGroupBox(TaxExportDlg) self.DlsgGroup.setObjectName(u"DlsgGroup") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.DlsgGroup.sizePolicy().hasHeightForWidth()) self.DlsgGroup.setSizePolicy(sizePolicy1) self.DlsgGroup.setFlat(False) self.DlsgGroup.setCheckable(True) self.DlsgGroup.setChecked(False) self.gridLayout_2 = QGridLayout(self.DlsgGroup) self.gridLayout_2.setSpacing(2) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setContentsMargins(6, 6, 6, 6) self.InitialFileLbl = QLabel(self.DlsgGroup) self.InitialFileLbl.setObjectName(u"InitialFileLbl") self.gridLayout_2.addWidget(self.InitialFileLbl, 0, 0, 1, 1) self.DlsgOutFileName = QLineEdit(self.DlsgGroup) self.DlsgOutFileName.setObjectName(u"DlsgOutFileName") self.gridLayout_2.addWidget(self.DlsgOutFileName, 1, 1, 1, 1) self.DlsgInFileName = QLineEdit(self.DlsgGroup) self.DlsgInFileName.setObjectName(u"DlsgInFileName") self.gridLayout_2.addWidget(self.DlsgInFileName, 0, 1, 1, 1) self.OutputFileLbl = QLabel(self.DlsgGroup) self.OutputFileLbl.setObjectName(u"OutputFileLbl") self.gridLayout_2.addWidget(self.OutputFileLbl, 1, 0, 1, 1) self.DividendsOnly = QCheckBox(self.DlsgGroup) self.DividendsOnly.setObjectName(u"DividendsOnly") self.gridLayout_2.addWidget(self.DividendsOnly, 3, 0, 1, 3) self.OutputSelectBtn = QPushButton(self.DlsgGroup) self.OutputSelectBtn.setObjectName(u"OutputSelectBtn") self.gridLayout_2.addWidget(self.OutputSelectBtn, 1, 2, 1, 1) self.InitialSelectBtn = QPushButton(self.DlsgGroup) self.InitialSelectBtn.setObjectName(u"InitialSelectBtn") self.gridLayout_2.addWidget(self.InitialSelectBtn, 0, 2, 1, 1) self.IncomeSourceBroker = QCheckBox(self.DlsgGroup) self.IncomeSourceBroker.setObjectName(u"IncomeSourceBroker") self.IncomeSourceBroker.setChecked(True) self.gridLayout_2.addWidget(self.IncomeSourceBroker, 2, 0, 1, 3) self.gridLayout.addWidget(self.DlsgGroup, 7, 0, 1, 4) self.Year = QSpinBox(TaxExportDlg) self.Year.setObjectName(u"Year") self.Year.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.Year.setMinimum(2010) self.Year.setMaximum(2030) self.Year.setValue(2020) self.gridLayout.addWidget(self.Year, 1, 1, 1, 2) self.XlsFileName = QLineEdit(TaxExportDlg) self.XlsFileName.setObjectName(u"XlsFileName") sizePolicy2 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.XlsFileName.sizePolicy().hasHeightForWidth()) self.XlsFileName.setSizePolicy(sizePolicy2) self.gridLayout.addWidget(self.XlsFileName, 3, 1, 1, 1) self.AccountWidget = AccountSelector(TaxExportDlg) self.AccountWidget.setObjectName(u"AccountWidget") self.gridLayout.addWidget(self.AccountWidget, 2, 1, 1, 2) self.YearLbl = QLabel(TaxExportDlg) self.YearLbl.setObjectName(u"YearLbl") self.gridLayout.addWidget(self.YearLbl, 1, 0, 1, 1) self.buttonBox = QDialogButtonBox(TaxExportDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Vertical) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 1, 3, 3, 1) self.AccountLbl = QLabel(TaxExportDlg) self.AccountLbl.setObjectName(u"AccountLbl") self.gridLayout.addWidget(self.AccountLbl, 2, 0, 1, 1) self.XlsFileLbl = QLabel(TaxExportDlg) self.XlsFileLbl.setObjectName(u"XlsFileLbl") self.gridLayout.addWidget(self.XlsFileLbl, 3, 0, 1, 1) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.verticalSpacer, 9, 0, 1, 1) self.NoSettlement = QCheckBox(TaxExportDlg) self.NoSettlement.setObjectName(u"NoSettlement") self.gridLayout.addWidget(self.NoSettlement, 8, 0, 1, 4) QWidget.setTabOrder(self.Year, self.XlsFileName) QWidget.setTabOrder(self.XlsFileName, self.XlsSelectBtn) QWidget.setTabOrder(self.XlsSelectBtn, self.DlsgGroup) QWidget.setTabOrder(self.DlsgGroup, self.DlsgInFileName) QWidget.setTabOrder(self.DlsgInFileName, self.InitialSelectBtn) QWidget.setTabOrder(self.InitialSelectBtn, self.DlsgOutFileName) QWidget.setTabOrder(self.DlsgOutFileName, self.OutputSelectBtn) self.retranslateUi(TaxExportDlg) self.buttonBox.accepted.connect(TaxExportDlg.accept) self.buttonBox.rejected.connect(TaxExportDlg.reject) QMetaObject.connectSlotsByName(TaxExportDlg) # setupUi def retranslateUi(self, TaxExportDlg): TaxExportDlg.setWindowTitle( QCoreApplication.translate( "TaxExportDlg", u"Select parameters and files for tax report", None)) #if QT_CONFIG(tooltip) self.XlsSelectBtn.setToolTip( QCoreApplication.translate("TaxExportDlg", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.XlsSelectBtn.setText( QCoreApplication.translate("TaxExportDlg", u"...", None)) self.WarningLbl.setText( QCoreApplication.translate( "TaxExportDlg", u"Below functions are experimental - use it with care", None)) self.DlsgGroup.setTitle( QCoreApplication.translate( "TaxExportDlg", u"Update file \"\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\" (*.dc0)", None)) self.InitialFileLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Initial file:", None)) #if QT_CONFIG(tooltip) self.DlsgOutFileName.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"File where to store russian tax form", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(tooltip) self.DlsgInFileName.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"File to use as a template for russian tax form", None)) #endif // QT_CONFIG(tooltip) self.OutputFileLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Output file:", None)) self.DividendsOnly.setText( QCoreApplication.translate( "TaxExportDlg", u"Update only information about dividends", None)) #if QT_CONFIG(tooltip) self.OutputSelectBtn.setToolTip( QCoreApplication.translate("TaxExportDlg", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.OutputSelectBtn.setText( QCoreApplication.translate("TaxExportDlg", u" ... ", None)) #if QT_CONFIG(tooltip) self.InitialSelectBtn.setToolTip( QCoreApplication.translate("TaxExportDlg", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.InitialSelectBtn.setText( QCoreApplication.translate("TaxExportDlg", u" ... ", None)) self.IncomeSourceBroker.setText( QCoreApplication.translate("TaxExportDlg", u"Use broker name as income source", None)) self.Year.setSuffix("") #if QT_CONFIG(tooltip) self.XlsFileName.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"File where to store tax report in Excel format", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(tooltip) self.AccountWidget.setToolTip( QCoreApplication.translate( "TaxExportDlg", u"Foreign account to prepare tax report for", None)) #endif // QT_CONFIG(tooltip) self.YearLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Year:", None)) self.AccountLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Account:", None)) self.XlsFileLbl.setText( QCoreApplication.translate("TaxExportDlg", u"Excel file:", None)) self.NoSettlement.setText( QCoreApplication.translate( "TaxExportDlg", u"Do not use settlement date for currency rates", None))
class RunICADialog(QDialog): def __init__(self, parent, nchan, methods): super().__init__(parent) self.setWindowTitle("Run ICA") vbox = QVBoxLayout(self) grid = QGridLayout() grid.addWidget(QLabel("Method:"), 0, 0) self.method = QComboBox() self.method.addItems(methods) self.method.setCurrentIndex(0) self.method.currentIndexChanged.connect(self.toggle_options) grid.addWidget(self.method, 0, 1) self.extended_label = QLabel("Extended:") grid.addWidget(self.extended_label, 1, 0) self.extended = QCheckBox() self.extended.setChecked(True) grid.addWidget(self.extended, 1, 1) self.ortho_label = QLabel("Orthogonal:") grid.addWidget(self.ortho_label, 2, 0) self.ortho = QCheckBox() self.ortho.setChecked(False) grid.addWidget(self.ortho, 2, 1) if "Picard" not in methods: self.ortho_label.hide() self.ortho.hide() grid.addWidget(QLabel("Number of components:"), 3, 0) self.n_components = QSpinBox() self.n_components.setRange(0, nchan) self.n_components.setValue(nchan) self.n_components.setAlignment(Qt.AlignRight) grid.addWidget(self.n_components, 3, 1) grid.addWidget(QLabel("Exclude bad segments:"), 4, 0) self.exclude_bad_segments = QCheckBox() self.exclude_bad_segments.setChecked(True) grid.addWidget(self.exclude_bad_segments, 4, 1) vbox.addLayout(grid) buttonbox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel) vbox.addWidget(buttonbox) buttonbox.accepted.connect(self.accept) buttonbox.rejected.connect(self.reject) vbox.setSizeConstraint(QVBoxLayout.SetFixedSize) self.toggle_options() @Slot() def toggle_options(self): """Toggle extended options.""" if self.method.currentText() == "Picard": # enable extended and ortho self.extended_label.setEnabled(True) self.extended.setEnabled(True) self.ortho_label.setEnabled(True) self.ortho.setEnabled(True) elif self.method.currentText() == "Infomax": # enable extended self.extended_label.setEnabled(True) self.extended.setEnabled(True) self.ortho_label.setEnabled(False) self.ortho.setChecked(False) self.ortho.setEnabled(False) else: self.extended_label.setEnabled(False) self.extended.setChecked(False) self.extended.setEnabled(False) self.ortho_label.setEnabled(False) self.ortho.setChecked(False) self.ortho.setEnabled(False)
class DeviceItem(QWidget): numberChanged = Signal() def __init__(self, device: RigDevice): super().__init__() self.device = device self._nameLabel = QLabel(device.serialNumber) self._statusLabel = QLabel("") self._startNumberDial = QSpinBox() self._startNumberDial.setMinimum(0) self._startNumberDial.setMaximum(9999) self._startNumberDial.setValue(device.startNumber) self._startNumberDial.valueChanged.connect(self.SetStartNumber) self._enableToggle = QToolButton() self._enableToggle.clicked.connect(self.ToggleEnable) self._enableToggle.setText("Disable") self._layout = QHBoxLayout() self.setLayout(self._layout) self._layout.addWidget(self._nameLabel, stretch=1) self._layout.addWidget(self._statusLabel, stretch=1) self._layout.addWidget(self._enableToggle) self._layout.addWidget(self._startNumberDial) self._layout.addStretch(1) solenoidLabelLayout = QVBoxLayout() solenoidLabelLayout.addWidget(QLabel("State"), alignment=Qt.AlignRight) solenoidLabelLayout.addWidget(QLabel("Invert"), alignment=Qt.AlignRight) self._layout.addLayout(solenoidLabelLayout) self._layout.addSpacing(5) self._solenoidButtons: List[SolenoidButton] = [] for solenoidNumber in range(24): newButton = SolenoidButton( solenoidNumber, device.solenoidPolarities[solenoidNumber]) newButton.solenoidClicked.connect( lambda s=newButton: self.ToggleSolenoid(s)) newButton.polarityClicked.connect( lambda s=newButton: self.TogglePolarity(s)) self._solenoidButtons.append(newButton) self._layout.addWidget(newButton, stretch=0) self.Update() def SetStartNumber(self): self.device.startNumber = self._startNumberDial.value() self.Update() self.numberChanged.emit() def ToggleEnable(self): self.device.SetEnabled(not self.device.isEnabled) self.Update() def ToggleSolenoid(self, button: 'SolenoidButton'): index = self._solenoidButtons.index(button) AppGlobals.Rig().SetSolenoidState( self.device.startNumber + index, not AppGlobals.Rig().GetSolenoidState(self.device.startNumber + index)) AppGlobals.Rig().FlushStates() self.Update() def TogglePolarity(self, button: 'SolenoidButton'): index = self._solenoidButtons.index(button) self.device.solenoidPolarities[ index] = not self.device.solenoidPolarities[index] AppGlobals.Rig().FlushStates() self.Update() def Update(self): if not self.device.IsDeviceAvailable(): self.deleteLater() return if self.device.isConnected: self._statusLabel.setText("Connected.") else: if self.device.isEnabled: self._statusLabel.setText(self.device.errorMessage) else: self._statusLabel.setText("Disabled.") self._enableToggle.setText({ False: "Enable", True: "Disable" }[self.device.isEnabled]) self._startNumberDial.setEnabled(self.device.isEnabled and self.device.isConnected) for i in range(24): self._solenoidButtons[i].setEnabled(self.device.isConnected and self.device.isEnabled) self._solenoidButtons[i].Update(self.device.startNumber + i, self.device.solenoidPolarities[i])
class Ui_ProjectSettings_UI(object): def setupUi(self, ProjectSettings_UI): if not ProjectSettings_UI.objectName(): ProjectSettings_UI.setObjectName(u"ProjectSettings_UI") ProjectSettings_UI.resize(575, 685) self.gridLayout_3 = QGridLayout(ProjectSettings_UI) self.gridLayout_3.setObjectName(u"gridLayout_3") self.buttonBox = QDialogButtonBox(ProjectSettings_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout_3.addWidget(self.buttonBox, 2, 0, 1, 1) self.tabWidget = QTabWidget(ProjectSettings_UI) self.tabWidget.setObjectName(u"tabWidget") self.tabWidget.setDocumentMode(True) self.tab = QWidget() self.tab.setObjectName(u"tab") self.gridLayout = QGridLayout(self.tab) self.gridLayout.setObjectName(u"gridLayout") self.previewparams = QPlainTextEdit(self.tab) self.previewparams.setObjectName(u"previewparams") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Maximum) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.previewparams.sizePolicy().hasHeightForWidth()) self.previewparams.setSizePolicy(sizePolicy) self.previewparams.setReadOnly(True) self.gridLayout.addWidget(self.previewparams, 7, 0, 1, 4) self.label_2 = QLabel(self.tab) self.label_2.setObjectName(u"label_2") self.gridLayout.addWidget(self.label_2, 5, 0, 1, 1) self.audio_thumbs = QCheckBox(self.tab) self.audio_thumbs.setObjectName(u"audio_thumbs") self.gridLayout.addWidget(self.audio_thumbs, 5, 2, 1, 1) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.label_7 = QLabel(self.tab) self.label_7.setObjectName(u"label_7") self.horizontalLayout_2.addWidget(self.label_7) self.video_tracks = QSpinBox(self.tab) self.video_tracks.setObjectName(u"video_tracks") self.horizontalLayout_2.addWidget(self.video_tracks) self.label_8 = QLabel(self.tab) self.label_8.setObjectName(u"label_8") self.horizontalLayout_2.addWidget(self.label_8) self.audio_tracks = QSpinBox(self.tab) self.audio_tracks.setObjectName(u"audio_tracks") self.horizontalLayout_2.addWidget(self.audio_tracks) self.label = QLabel(self.tab) self.label.setObjectName(u"label") self.horizontalLayout_2.addWidget(self.label) self.audio_channels = QComboBox(self.tab) self.audio_channels.addItem("") self.audio_channels.addItem("") self.audio_channels.addItem("") self.audio_channels.setObjectName(u"audio_channels") sizePolicy1 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.audio_channels.sizePolicy().hasHeightForWidth()) self.audio_channels.setSizePolicy(sizePolicy1) self.horizontalLayout_2.addWidget(self.audio_channels) self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 4) self.horizontalSpacer = QSpacerItem(229, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.horizontalSpacer, 5, 3, 1, 1) self.profile_box = QGroupBox(self.tab) self.profile_box.setObjectName(u"profile_box") sizePolicy2 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.MinimumExpanding) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.profile_box.sizePolicy().hasHeightForWidth()) self.profile_box.setSizePolicy(sizePolicy2) self.profile_box.setFlat(True) self.gridLayout.addWidget(self.profile_box, 3, 0, 1, 4) self.label_4 = QLabel(self.tab) self.label_4.setObjectName(u"label_4") self.gridLayout.addWidget(self.label_4, 0, 0, 1, 4) self.video_thumbs = QCheckBox(self.tab) self.video_thumbs.setObjectName(u"video_thumbs") self.gridLayout.addWidget(self.video_thumbs, 5, 1, 1, 1) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.label_25 = QLabel(self.tab) self.label_25.setObjectName(u"label_25") sizePolicy3 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred) sizePolicy3.setHorizontalStretch(0) sizePolicy3.setVerticalStretch(0) sizePolicy3.setHeightForWidth( self.label_25.sizePolicy().hasHeightForWidth()) self.label_25.setSizePolicy(sizePolicy3) self.horizontalLayout_4.addWidget(self.label_25) self.preview_profile = KComboBox(self.tab) self.preview_profile.setObjectName(u"preview_profile") sizePolicy1.setHeightForWidth( self.preview_profile.sizePolicy().hasHeightForWidth()) self.preview_profile.setSizePolicy(sizePolicy1) self.horizontalLayout_4.addWidget(self.preview_profile) self.preview_showprofileinfo = QToolButton(self.tab) self.preview_showprofileinfo.setObjectName(u"preview_showprofileinfo") self.preview_showprofileinfo.setCheckable(True) self.horizontalLayout_4.addWidget(self.preview_showprofileinfo) self.preview_manageprofile = QToolButton(self.tab) self.preview_manageprofile.setObjectName(u"preview_manageprofile") self.horizontalLayout_4.addWidget(self.preview_manageprofile) self.gridLayout.addLayout(self.horizontalLayout_4, 6, 0, 1, 4) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.custom_folder = QCheckBox(self.tab) self.custom_folder.setObjectName(u"custom_folder") self.horizontalLayout.addWidget(self.custom_folder) self.project_folder = KUrlRequester(self.tab) self.project_folder.setObjectName(u"project_folder") self.project_folder.setEnabled(False) self.horizontalLayout.addWidget(self.project_folder) self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 4) self.same_folder = QCheckBox(self.tab) self.same_folder.setObjectName(u"same_folder") self.gridLayout.addWidget(self.same_folder, 2, 0, 1, 4) self.tabWidget.addTab(self.tab, "") self.label_4.raise_() self.profile_box.raise_() self.label_2.raise_() self.video_thumbs.raise_() self.audio_thumbs.raise_() self.previewparams.raise_() self.same_folder.raise_() self.tab_4 = QWidget() self.tab_4.setObjectName(u"tab_4") self.verticalLayout = QVBoxLayout(self.tab_4) self.verticalLayout.setObjectName(u"verticalLayout") self.enable_proxy = QCheckBox(self.tab_4) self.enable_proxy.setObjectName(u"enable_proxy") self.verticalLayout.addWidget(self.enable_proxy) self.proxy_box = QGroupBox(self.tab_4) self.proxy_box.setObjectName(u"proxy_box") self.proxy_box.setEnabled(False) self.proxy_box.setFlat(True) self.proxy_box.setCheckable(False) self.proxy_box.setChecked(False) self.gridLayout_2 = QGridLayout(self.proxy_box) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setHorizontalSpacing(6) self.gridLayout_2.setContentsMargins(0, 0, 0, 0) self.l_relPathProxyToOrig = QLabel(self.proxy_box) self.l_relPathProxyToOrig.setObjectName(u"l_relPathProxyToOrig") self.gridLayout_2.addWidget(self.l_relPathProxyToOrig, 10, 1, 1, 1) self.generate_imageproxy = QCheckBox(self.proxy_box) self.generate_imageproxy.setObjectName(u"generate_imageproxy") self.gridLayout_2.addWidget(self.generate_imageproxy, 3, 0, 1, 2) self.l_prefix_proxy = QLabel(self.proxy_box) self.l_prefix_proxy.setObjectName(u"l_prefix_proxy") self.gridLayout_2.addWidget(self.l_prefix_proxy, 11, 1, 1, 1) self.proxy_imagesize = QSpinBox(self.proxy_box) self.proxy_imagesize.setObjectName(u"proxy_imagesize") self.proxy_imagesize.setEnabled(False) self.proxy_imagesize.setMinimum(200) self.proxy_imagesize.setMaximum(100000) self.proxy_imagesize.setValue(800) self.gridLayout_2.addWidget(self.proxy_imagesize, 4, 2, 1, 4) self.label_24 = QLabel(self.proxy_box) self.label_24.setObjectName(u"label_24") sizePolicy3.setHeightForWidth( self.label_24.sizePolicy().hasHeightForWidth()) self.label_24.setSizePolicy(sizePolicy3) self.gridLayout_2.addWidget(self.label_24, 1, 0, 1, 1) self.proxy_minsize = QSpinBox(self.proxy_box) self.proxy_minsize.setObjectName(u"proxy_minsize") self.proxy_minsize.setMaximum(10000) self.proxy_minsize.setValue(1000) self.gridLayout_2.addWidget(self.proxy_minsize, 0, 2, 1, 4) self.l_prefix_clip = QLabel(self.proxy_box) self.l_prefix_clip.setObjectName(u"l_prefix_clip") self.gridLayout_2.addWidget(self.l_prefix_clip, 8, 1, 1, 1) self.proxy_profile = KComboBox(self.proxy_box) self.proxy_profile.setObjectName(u"proxy_profile") sizePolicy1.setHeightForWidth( self.proxy_profile.sizePolicy().hasHeightForWidth()) self.proxy_profile.setSizePolicy(sizePolicy1) self.gridLayout_2.addWidget(self.proxy_profile, 1, 1, 1, 2) self.proxy_showprofileinfo = QToolButton(self.proxy_box) self.proxy_showprofileinfo.setObjectName(u"proxy_showprofileinfo") self.proxy_showprofileinfo.setCheckable(True) self.gridLayout_2.addWidget(self.proxy_showprofileinfo, 1, 4, 1, 1) self.generate_proxy = QCheckBox(self.proxy_box) self.generate_proxy.setObjectName(u"generate_proxy") self.gridLayout_2.addWidget(self.generate_proxy, 0, 0, 1, 2) self.proxyparams = QPlainTextEdit(self.proxy_box) self.proxyparams.setObjectName(u"proxyparams") sizePolicy.setHeightForWidth( self.proxyparams.sizePolicy().hasHeightForWidth()) self.proxyparams.setSizePolicy(sizePolicy) self.proxyparams.setReadOnly(True) self.gridLayout_2.addWidget(self.proxyparams, 2, 0, 1, 6) self.image_label = QLabel(self.proxy_box) self.image_label.setObjectName(u"image_label") self.image_label.setEnabled(False) self.gridLayout_2.addWidget(self.image_label, 4, 0, 1, 2) self.le_relPathProxyToOrig = QLineEdit(self.proxy_box) self.le_relPathProxyToOrig.setObjectName(u"le_relPathProxyToOrig") self.le_relPathProxyToOrig.setEnabled(False) self.gridLayout_2.addWidget(self.le_relPathProxyToOrig, 10, 3, 1, 1) self.le_prefix_proxy = QLineEdit(self.proxy_box) self.le_prefix_proxy.setObjectName(u"le_prefix_proxy") self.le_prefix_proxy.setEnabled(False) self.gridLayout_2.addWidget(self.le_prefix_proxy, 11, 3, 1, 1) self.l_suffix_proxy = QLabel(self.proxy_box) self.l_suffix_proxy.setObjectName(u"l_suffix_proxy") self.gridLayout_2.addWidget(self.l_suffix_proxy, 12, 1, 1, 1) self.le_prefix_clip = QLineEdit(self.proxy_box) self.le_prefix_clip.setObjectName(u"le_prefix_clip") self.le_prefix_clip.setEnabled(False) self.gridLayout_2.addWidget(self.le_prefix_clip, 8, 3, 1, 1) self.le_suffix_proxy = QLineEdit(self.proxy_box) self.le_suffix_proxy.setObjectName(u"le_suffix_proxy") self.le_suffix_proxy.setEnabled(False) self.gridLayout_2.addWidget(self.le_suffix_proxy, 12, 3, 1, 1) self.proxy_imageminsize = QSpinBox(self.proxy_box) self.proxy_imageminsize.setObjectName(u"proxy_imageminsize") self.proxy_imageminsize.setMinimum(500) self.proxy_imageminsize.setMaximum(100000) self.proxy_imageminsize.setValue(2000) self.gridLayout_2.addWidget(self.proxy_imageminsize, 3, 2, 1, 4) self.l_suffix_clip = QLabel(self.proxy_box) self.l_suffix_clip.setObjectName(u"l_suffix_clip") self.gridLayout_2.addWidget(self.l_suffix_clip, 9, 1, 1, 1) self.l_relPathOrigToProxy = QLabel(self.proxy_box) self.l_relPathOrigToProxy.setObjectName(u"l_relPathOrigToProxy") self.gridLayout_2.addWidget(self.l_relPathOrigToProxy, 7, 1, 1, 1) self.le_relPathOrigToProxy = QLineEdit(self.proxy_box) self.le_relPathOrigToProxy.setObjectName(u"le_relPathOrigToProxy") self.le_relPathOrigToProxy.setEnabled(False) self.gridLayout_2.addWidget(self.le_relPathOrigToProxy, 7, 3, 1, 1) self.external_proxy_profile = QComboBox(self.proxy_box) self.external_proxy_profile.setObjectName(u"external_proxy_profile") self.gridLayout_2.addWidget(self.external_proxy_profile, 6, 1, 1, 5) self.proxy_resize = QSpinBox(self.proxy_box) self.proxy_resize.setObjectName(u"proxy_resize") self.proxy_resize.setMinimum(200) self.proxy_resize.setMaximum(100000) self.gridLayout_2.addWidget(self.proxy_resize, 5, 2, 1, 4) self.le_suffix_clip = QLineEdit(self.proxy_box) self.le_suffix_clip.setObjectName(u"le_suffix_clip") self.le_suffix_clip.setEnabled(False) self.gridLayout_2.addWidget(self.le_suffix_clip, 9, 3, 1, 1) self.external_proxy = QCheckBox(self.proxy_box) self.external_proxy.setObjectName(u"external_proxy") self.gridLayout_2.addWidget(self.external_proxy, 6, 0, 1, 1) self.checkProxy = QToolButton(self.proxy_box) self.checkProxy.setObjectName(u"checkProxy") self.gridLayout_2.addWidget(self.checkProxy, 1, 3, 1, 1) self.label_3 = QLabel(self.proxy_box) self.label_3.setObjectName(u"label_3") self.gridLayout_2.addWidget(self.label_3, 5, 0, 1, 1) self.proxy_manageprofile = QToolButton(self.proxy_box) self.proxy_manageprofile.setObjectName(u"proxy_manageprofile") self.gridLayout_2.addWidget(self.proxy_manageprofile, 1, 5, 1, 1) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_2.addItem(self.verticalSpacer, 13, 1, 1, 1) self.verticalLayout.addWidget(self.proxy_box) self.tabWidget.addTab(self.tab_4, "") self.tab_3 = QWidget() self.tab_3.setObjectName(u"tab_3") self.gridLayout_6 = QGridLayout(self.tab_3) self.gridLayout_6.setObjectName(u"gridLayout_6") self.metadata_list = QTreeWidget(self.tab_3) self.metadata_list.setObjectName(u"metadata_list") self.metadata_list.setAlternatingRowColors(True) self.metadata_list.setRootIsDecorated(False) self.metadata_list.setAllColumnsShowFocus(True) self.metadata_list.setColumnCount(2) self.metadata_list.header().setVisible(False) self.gridLayout_6.addWidget(self.metadata_list, 0, 0, 1, 1) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.add_metadata = QToolButton(self.tab_3) self.add_metadata.setObjectName(u"add_metadata") self.horizontalLayout_3.addWidget(self.add_metadata) self.delete_metadata = QToolButton(self.tab_3) self.delete_metadata.setObjectName(u"delete_metadata") self.horizontalLayout_3.addWidget(self.delete_metadata) self.horizontalSpacer_3 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_3.addItem(self.horizontalSpacer_3) self.gridLayout_6.addLayout(self.horizontalLayout_3, 1, 0, 1, 1) self.tabWidget.addTab(self.tab_3, "") self.tab_2 = QWidget() self.tab_2.setObjectName(u"tab_2") self.gridLayout_4 = QGridLayout(self.tab_2) self.gridLayout_4.setObjectName(u"gridLayout_4") self.fonts_list = QListWidget(self.tab_2) self.fonts_list.setObjectName(u"fonts_list") self.fonts_list.setAlternatingRowColors(True) self.gridLayout_4.addWidget(self.fonts_list, 5, 0, 1, 5) self.files_list = QTreeWidget(self.tab_2) __qtreewidgetitem = QTreeWidgetItem() __qtreewidgetitem.setText(0, u"1") self.files_list.setHeaderItem(__qtreewidgetitem) self.files_list.setObjectName(u"files_list") self.files_list.setAlternatingRowColors(True) self.files_list.setRootIsDecorated(False) self.files_list.setItemsExpandable(False) self.files_list.setHeaderHidden(True) self.files_list.setExpandsOnDoubleClick(False) self.gridLayout_4.addWidget(self.files_list, 3, 0, 1, 5) self.label_12 = QLabel(self.tab_2) self.label_12.setObjectName(u"label_12") self.gridLayout_4.addWidget(self.label_12, 0, 0, 1, 2) self.used_count = QLabel(self.tab_2) self.used_count.setObjectName(u"used_count") self.gridLayout_4.addWidget(self.used_count, 0, 2, 1, 1) self.used_size = QLabel(self.tab_2) self.used_size.setObjectName(u"used_size") self.gridLayout_4.addWidget(self.used_size, 0, 3, 1, 1) self.label_6 = QLabel(self.tab_2) self.label_6.setObjectName(u"label_6") self.gridLayout_4.addWidget(self.label_6, 1, 0, 1, 1) self.unused_count = QLabel(self.tab_2) self.unused_count.setObjectName(u"unused_count") self.gridLayout_4.addWidget(self.unused_count, 1, 2, 1, 1) self.unused_size = QLabel(self.tab_2) self.unused_size.setObjectName(u"unused_size") self.gridLayout_4.addWidget(self.unused_size, 1, 3, 1, 1) self.delete_unused = QPushButton(self.tab_2) self.delete_unused.setObjectName(u"delete_unused") self.gridLayout_4.addWidget(self.delete_unused, 1, 4, 1, 1) self.list_search = KTreeWidgetSearchLine(self.tab_2) self.list_search.setObjectName(u"list_search") self.gridLayout_4.addWidget(self.list_search, 2, 3, 1, 2) self.label_13 = QLabel(self.tab_2) self.label_13.setObjectName(u"label_13") self.gridLayout_4.addWidget(self.label_13, 2, 0, 1, 1) self.label_fonts = QLabel(self.tab_2) self.label_fonts.setObjectName(u"label_fonts") self.gridLayout_4.addWidget(self.label_fonts, 4, 0, 1, 1) self.button_export = QPushButton(self.tab_2) self.button_export.setObjectName(u"button_export") self.gridLayout_4.addWidget(self.button_export, 6, 0, 1, 2) self.files_count = QLabel(self.tab_2) self.files_count.setObjectName(u"files_count") self.gridLayout_4.addWidget(self.files_count, 2, 2, 1, 1) self.tabWidget.addTab(self.tab_2, "") self.gridLayout_3.addWidget(self.tabWidget, 0, 0, 1, 1) self.retranslateUi(ProjectSettings_UI) self.buttonBox.accepted.connect(ProjectSettings_UI.accept) self.buttonBox.rejected.connect(ProjectSettings_UI.reject) self.custom_folder.toggled.connect(self.project_folder.setEnabled) self.enable_proxy.toggled.connect(self.proxy_box.setEnabled) self.external_proxy.toggled.connect( self.external_proxy_profile.setEnabled) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(ProjectSettings_UI) # setupUi def retranslateUi(self, ProjectSettings_UI): ProjectSettings_UI.setWindowTitle( QCoreApplication.translate("ProjectSettings_UI", u"Project Settings", None)) self.label_2.setText( QCoreApplication.translate("ProjectSettings_UI", u"Thumbnails:", None)) self.audio_thumbs.setText( QCoreApplication.translate("ProjectSettings_UI", u"Audio", None)) self.label_7.setText( QCoreApplication.translate("ProjectSettings_UI", u"Video tracks:", None)) self.label_8.setText( QCoreApplication.translate("ProjectSettings_UI", u"Audio tracks:", None)) self.label.setText( QCoreApplication.translate("ProjectSettings_UI", u"Audio channels:", None)) self.audio_channels.setItemText( 0, QCoreApplication.translate("ProjectSettings_UI", u"2 Channels (Stereo)", None)) self.audio_channels.setItemText( 1, QCoreApplication.translate("ProjectSettings_UI", u"4 Channels", None)) self.audio_channels.setItemText( 2, QCoreApplication.translate("ProjectSettings_UI", u"6 Channels", None)) self.label_4.setText( QCoreApplication.translate( "ProjectSettings_UI", u"Project folder to store proxy clips, thumbnails, previews", None)) self.video_thumbs.setText( QCoreApplication.translate("ProjectSettings_UI", u"Video", None)) self.label_25.setText( QCoreApplication.translate("ProjectSettings_UI", u"Preview profile:", None)) self.preview_showprofileinfo.setText( QCoreApplication.translate("ProjectSettings_UI", u"...", None)) self.preview_manageprofile.setText( QCoreApplication.translate("ProjectSettings_UI", u"...", None)) self.custom_folder.setText( QCoreApplication.translate("ProjectSettings_UI", u"Custom project folder:", None)) self.same_folder.setText( QCoreApplication.translate( "ProjectSettings_UI", u"Use parent folder of the project file as project folder", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QCoreApplication.translate("ProjectSettings_UI", u"Settings", None)) self.enable_proxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"Enable proxy clips", None)) self.l_relPathProxyToOrig.setText( QCoreApplication.translate("ProjectSettings_UI", u"Relative path from proxy to clip:", None)) self.generate_imageproxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"Generate for images larger than", None)) self.l_prefix_proxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"Prefix of proxy:", None)) self.proxy_imagesize.setSuffix( QCoreApplication.translate("ProjectSettings_UI", u"pixels", None)) self.label_24.setText( QCoreApplication.translate("ProjectSettings_UI", u"Encoding profile:", None)) self.proxy_minsize.setSuffix( QCoreApplication.translate("ProjectSettings_UI", u"pixels", None)) self.l_prefix_clip.setText( QCoreApplication.translate("ProjectSettings_UI", u"Prefix of clip:", None)) self.proxy_showprofileinfo.setText( QCoreApplication.translate("ProjectSettings_UI", u"...", None)) self.generate_proxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"Generate for videos larger than", None)) self.image_label.setText( QCoreApplication.translate("ProjectSettings_UI", u"Proxy image size", None)) self.l_suffix_proxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"Suffix of proxy:", None)) self.proxy_imageminsize.setSuffix( QCoreApplication.translate("ProjectSettings_UI", u"pixels", None)) self.l_suffix_clip.setText( QCoreApplication.translate("ProjectSettings_UI", u"Suffix of clip:", None)) self.l_relPathOrigToProxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"Relative path from clip to proxy:", None)) self.proxy_resize.setSuffix( QCoreApplication.translate("ProjectSettings_UI", u"pixels", None)) self.external_proxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"Use external proxy clips", None)) self.checkProxy.setText( QCoreApplication.translate("ProjectSettings_UI", u"...", None)) self.label_3.setText( QCoreApplication.translate("ProjectSettings_UI", u"Proxy video resize (width)", None)) self.proxy_manageprofile.setText( QCoreApplication.translate("ProjectSettings_UI", u"...", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_4), QCoreApplication.translate("ProjectSettings_UI", u"Proxy", None)) ___qtreewidgetitem = self.metadata_list.headerItem() ___qtreewidgetitem.setText( 1, QCoreApplication.translate("ProjectSettings_UI", u"2", None)) ___qtreewidgetitem.setText( 0, QCoreApplication.translate("ProjectSettings_UI", u"1", None)) self.add_metadata.setText( QCoreApplication.translate("ProjectSettings_UI", u"...", None)) self.delete_metadata.setText( QCoreApplication.translate("ProjectSettings_UI", u"...", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("ProjectSettings_UI", u"Metadata", None)) self.label_12.setText( QCoreApplication.translate("ProjectSettings_UI", u"Clips used in project:", None)) self.used_count.setText("") self.used_size.setText("") self.label_6.setText( QCoreApplication.translate("ProjectSettings_UI", u"Unused clips:", None)) self.unused_count.setText("") self.unused_size.setText("") self.delete_unused.setText( QCoreApplication.translate("ProjectSettings_UI", u"Delete files", None)) self.label_13.setText( QCoreApplication.translate("ProjectSettings_UI", u"Project files:", None)) self.label_fonts.setText( QCoreApplication.translate("ProjectSettings_UI", u"Fonts", None)) self.button_export.setText( QCoreApplication.translate("ProjectSettings_UI", u"Plain Text Export...", None)) self.files_count.setText("") self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("ProjectSettings_UI", u"Project Files", None))
class Window(QDialog): def __init__(self, parent=None): super(Window, self).__init__(parent) self.iconGroupBox = QGroupBox() self.iconLabel = QLabel() self.iconComboBox = QComboBox() self.showIconCheckBox = QCheckBox() self.messageGroupBox = QGroupBox() self.typeLabel = QLabel() self.durationLabel = QLabel() self.durationWarningLabel = QLabel() self.titleLabel = QLabel() self.bodyLabel = QLabel() self.typeComboBox = QComboBox() self.durationSpinBox = QSpinBox() self.titleEdit = QLineEdit() self.bodyEdit = QTextEdit() self.showMessageButton = QPushButton() self.minimizeAction = QAction() self.maximizeAction = QAction() self.restoreAction = QAction() self.quitAction = QAction() self.trayIcon = QSystemTrayIcon() self.trayIconMenu = QMenu() self.createIconGroupBox() self.createMessageGroupBox() self.iconLabel.setMinimumWidth(self.durationLabel.sizeHint().width()) self.createActions() self.createTrayIcon() self.showMessageButton.clicked.connect(self.showMessage) self.showIconCheckBox.toggled.connect(self.trayIcon.setVisible) self.iconComboBox.currentIndexChanged.connect(self.setIcon) self.trayIcon.messageClicked.connect(self.messageClicked) self.trayIcon.activated.connect(self.iconActivated) self.mainLayout = QVBoxLayout() self.mainLayout.addWidget(self.iconGroupBox) self.mainLayout.addWidget(self.messageGroupBox) self.setLayout(self.mainLayout) self.iconComboBox.setCurrentIndex(1) self.trayIcon.show() self.setWindowTitle("Systray") self.resize(400, 300) def setVisible(self, visible): self.minimizeAction.setEnabled(visible) self.maximizeAction.setEnabled(not self.isMaximized()) self.restoreAction.setEnabled(self.isMaximized() or not visible) super().setVisible(visible) def closeEvent(self, event): if not event.spontaneous() or not self.isVisible(): return if self.trayIcon.isVisible(): QMessageBox.information( self, "Systray", "The program will keep running in the system tray. " "To terminate the program, choose <b>Quit</b> in the context " "menu of the system tray entry.") self.hide() event.ignore() @Slot(int) def setIcon(self, index): icon = self.iconComboBox.itemIcon(index) self.trayIcon.setIcon(icon) self.setWindowIcon(icon) self.trayIcon.setToolTip(self.iconComboBox.itemText(index)) @Slot(str) def iconActivated(self, reason): if reason == QSystemTrayIcon.Trigger: pass if reason == QSystemTrayIcon.DoubleClick: self.iconComboBox.setCurrentIndex( (self.iconComboBox.currentIndex() + 1) % self.iconComboBox.count()) if reason == QSystemTrayIcon.MiddleClick: self.showMessage() @Slot() def showMessage(self): self.showIconCheckBox.setChecked(True) selectedIcon = self.typeComboBox.itemData( self.typeComboBox.currentIndex()) msgIcon = QSystemTrayIcon.MessageIcon(selectedIcon) if selectedIcon == -1: # custom icon icon = QIcon( self.iconComboBox.itemIcon(self.iconComboBox.currentIndex())) self.trayIcon.showMessage( self.titleEdit.text(), self.bodyEdit.toPlainText(), icon, self.durationSpinBox.value() * 1000, ) else: self.trayIcon.showMessage( self.titleEdit.text(), self.bodyEdit.toPlainText(), msgIcon, self.durationSpinBox.value() * 1000, ) @Slot() def messageClicked(self): QMessageBox.information( None, "Systray", "Sorry, I already gave what help I could.\n" "Maybe you should try asking a human?") def createIconGroupBox(self): self.iconGroupBox = QGroupBox("Tray Icon") self.iconLabel = QLabel("Icon:") self.iconComboBox = QComboBox() self.iconComboBox.addItem(QIcon(":/images/bad.png"), "Bad") self.iconComboBox.addItem(QIcon(":/images/heart.png"), "Heart") self.iconComboBox.addItem(QIcon(":/images/trash.png"), "Trash") self.showIconCheckBox = QCheckBox("Show icon") self.showIconCheckBox.setChecked(True) iconLayout = QHBoxLayout() iconLayout.addWidget(self.iconLabel) iconLayout.addWidget(self.iconComboBox) iconLayout.addStretch() iconLayout.addWidget(self.showIconCheckBox) self.iconGroupBox.setLayout(iconLayout) def createMessageGroupBox(self): self.messageGroupBox = QGroupBox("Balloon Message") self.typeLabel = QLabel("Type:") self.typeComboBox = QComboBox() self.typeComboBox.addItem("None", QSystemTrayIcon.NoIcon) self.typeComboBox.addItem( self.style().standardIcon(QStyle.SP_MessageBoxInformation), "Information", QSystemTrayIcon.Information, ) self.typeComboBox.addItem( self.style().standardIcon(QStyle.SP_MessageBoxWarning), "Warning", QSystemTrayIcon.Warning, ) self.typeComboBox.addItem( self.style().standardIcon(QStyle.SP_MessageBoxCritical), "Critical", QSystemTrayIcon.Critical, ) self.typeComboBox.addItem(QIcon(), "Custom icon", -1) self.typeComboBox.setCurrentIndex(1) self.durationLabel = QLabel("Duration:") self.durationSpinBox = QSpinBox() self.durationSpinBox.setRange(5, 60) self.durationSpinBox.setSuffix(" s") self.durationSpinBox.setValue(15) self.durationWarningLabel = QLabel( "(some systems might ignore this hint)") self.durationWarningLabel.setIndent(10) self.titleLabel = QLabel("Title:") self.titleEdit = QLineEdit("Cannot connect to network") self.bodyLabel = QLabel("Body:") self.bodyEdit = QTextEdit() self.bodyEdit.setPlainText( "Don't believe me. Honestly, I don't have a clue." "\nClick this balloon for details.") self.showMessageButton = QPushButton("Show Message") self.showMessageButton.setDefault(True) messageLayout = QGridLayout() messageLayout.addWidget(self.typeLabel, 0, 0) messageLayout.addWidget(self.typeComboBox, 0, 1, 1, 2) messageLayout.addWidget(self.durationLabel, 1, 0) messageLayout.addWidget(self.durationSpinBox, 1, 1) messageLayout.addWidget(self.durationWarningLabel, 1, 2, 1, 3) messageLayout.addWidget(self.titleLabel, 2, 0) messageLayout.addWidget(self.titleEdit, 2, 1, 1, 4) messageLayout.addWidget(self.bodyLabel, 3, 0) messageLayout.addWidget(self.bodyEdit, 3, 1, 2, 4) messageLayout.addWidget(self.showMessageButton, 5, 4) messageLayout.setColumnStretch(3, 1) messageLayout.setRowStretch(4, 1) self.messageGroupBox.setLayout(messageLayout) def createActions(self): self.minimizeAction = QAction("Minimize", self) self.minimizeAction.triggered.connect(self.hide) self.maximizeAction = QAction("Maximize", self) self.maximizeAction.triggered.connect(self.showMaximized) self.restoreAction = QAction("Restore", self) self.restoreAction.triggered.connect(self.showNormal) self.quitAction = QAction("Quit", self) self.quitAction.triggered.connect(qApp.quit) def createTrayIcon(self): self.trayIconMenu = QMenu(self) self.trayIconMenu.addAction(self.minimizeAction) self.trayIconMenu.addAction(self.maximizeAction) self.trayIconMenu.addAction(self.restoreAction) self.trayIconMenu.addSeparator() self.trayIconMenu.addAction(self.quitAction) self.trayIcon = QSystemTrayIcon(self) self.trayIcon.setContextMenu(self.trayIconMenu)
class Ui_opsWidget(object): def setupUi(self, opsWidget): if not opsWidget.objectName(): opsWidget.setObjectName(u"opsWidget") opsWidget.resize(484, 788) self.opLayout = QVBoxLayout(opsWidget) self.opLayout.setObjectName(u"opLayout") self.operationSelect = QGroupBox(opsWidget) self.operationSelect.setObjectName(u"operationSelect") self.operationSelect.setEnabled(True) self.operationSelect.setFlat(True) self.verticalLayout_3 = QVBoxLayout(self.operationSelect) self.verticalLayout_3.setSpacing(10) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(4, 4, 4, 4) self.formLayout = QFormLayout() self.formLayout.setObjectName(u"formLayout") self.formLayout.setVerticalSpacing(10) self.formLayout.setContentsMargins(5, 20, 5, 20) self.applyOpLabel = QLabel(self.operationSelect) self.applyOpLabel.setObjectName(u"applyOpLabel") self.formLayout.setWidget(1, QFormLayout.LabelRole, self.applyOpLabel) self.opCombo = QComboBox(self.operationSelect) self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.addItem("") self.opCombo.setObjectName(u"opCombo") self.opCombo.setEnabled(True) self.formLayout.setWidget(1, QFormLayout.FieldRole, self.opCombo) self.applyToLabel = QLabel(self.operationSelect) self.applyToLabel.setObjectName(u"applyToLabel") self.formLayout.setWidget(2, QFormLayout.LabelRole, self.applyToLabel) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.verticalLayout_18 = QVBoxLayout() self.verticalLayout_18.setObjectName(u"verticalLayout_18") self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.allDemoCheck = QCheckBox(self.operationSelect) self.allDemoCheck.setObjectName(u"allDemoCheck") self.allDemoCheck.setMaximumSize(QSize(10000, 16777215)) self.horizontalLayout_2.addWidget(self.allDemoCheck) self.allStepsCheck = QCheckBox(self.operationSelect) self.allStepsCheck.setObjectName(u"allStepsCheck") sizePolicy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.allStepsCheck.sizePolicy().hasHeightForWidth()) self.allStepsCheck.setSizePolicy(sizePolicy) self.allStepsCheck.setMinimumSize(QSize(180, 0)) self.allStepsCheck.setLayoutDirection(Qt.LeftToRight) self.horizontalLayout_2.addWidget(self.allStepsCheck) self.verticalLayout_18.addLayout(self.horizontalLayout_2) self.matchSubstringCheck = QCheckBox(self.operationSelect) self.matchSubstringCheck.setObjectName(u"matchSubstringCheck") self.verticalLayout_18.addWidget(self.matchSubstringCheck) self.horizontalLayout_13 = QHBoxLayout() self.horizontalLayout_13.setObjectName(u"horizontalLayout_13") self.label_16 = QLabel(self.operationSelect) self.label_16.setObjectName(u"label_16") self.label_16.setEnabled(False) self.horizontalLayout_13.addWidget(self.label_16) self.matchSubstringText = QLineEdit(self.operationSelect) self.matchSubstringText.setObjectName(u"matchSubstringText") self.matchSubstringText.setEnabled(False) self.horizontalLayout_13.addWidget(self.matchSubstringText) self.verticalLayout_18.addLayout(self.horizontalLayout_13) self.horizontalLayout.addLayout(self.verticalLayout_18) self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout) self.applyDemoLabel = QLabel(self.operationSelect) self.applyDemoLabel.setObjectName(u"applyDemoLabel") self.formLayout.setWidget(0, QFormLayout.LabelRole, self.applyDemoLabel) self.demoTargetCombo = QComboBox(self.operationSelect) self.demoTargetCombo.setObjectName(u"demoTargetCombo") self.formLayout.setWidget(0, QFormLayout.FieldRole, self.demoTargetCombo) self.verticalLayout_3.addLayout(self.formLayout) self.opLayout.addWidget(self.operationSelect) self.groupBox_6 = QGroupBox(opsWidget) self.groupBox_6.setObjectName(u"groupBox_6") self.groupBox_6.setEnabled(True) self.groupBox_6.setFlat(True) self.verticalLayout = QVBoxLayout(self.groupBox_6) self.verticalLayout.setObjectName(u"verticalLayout") self.verticalLayout.setContentsMargins(4, 4, 4, 4) self.opsParamsStack = QStackedWidget(self.groupBox_6) self.opsParamsStack.setObjectName(u"opsParamsStack") self.opsParamsStack.setAutoFillBackground(False) self.shellTab = QWidget() self.shellTab.setObjectName(u"shellTab") self.shellTab.setAutoFillBackground(False) self.formLayout_2 = QFormLayout(self.shellTab) self.formLayout_2.setObjectName(u"formLayout_2") self.formLayout_2.setLabelAlignment(Qt.AlignLeading | Qt.AlignLeft | Qt.AlignVCenter) self.formLayout_2.setFormAlignment(Qt.AlignLeading | Qt.AlignLeft | Qt.AlignVCenter) self.formLayout_2.setVerticalSpacing(40) self.formLayout_2.setContentsMargins(-1, 11, -1, -1) self.label = QLabel(self.shellTab) self.label.setObjectName(u"label") self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.shellImgPath = QLineEdit(self.shellTab) self.shellImgPath.setObjectName(u"shellImgPath") self.horizontalLayout_4.addWidget(self.shellImgPath) self.shellBrowseImgBtn = QPushButton(self.shellTab) self.shellBrowseImgBtn.setObjectName(u"shellBrowseImgBtn") self.horizontalLayout_4.addWidget(self.shellBrowseImgBtn) self.formLayout_2.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_4) self.label_2 = QLabel(self.shellTab) self.label_2.setObjectName(u"label_2") self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_2) self.horizontalLayout_7 = QHBoxLayout() self.horizontalLayout_7.setObjectName(u"horizontalLayout_7") self.label_3 = QLabel(self.shellTab) self.label_3.setObjectName(u"label_3") self.label_3.setAlignment(Qt.AlignCenter) self.horizontalLayout_7.addWidget(self.label_3) self.shellFgX = QSpinBox(self.shellTab) self.shellFgX.setObjectName(u"shellFgX") self.shellFgX.setMaximum(100000000) self.horizontalLayout_7.addWidget(self.shellFgX) self.label_4 = QLabel(self.shellTab) self.label_4.setObjectName(u"label_4") self.label_4.setAlignment(Qt.AlignCenter) self.horizontalLayout_7.addWidget(self.label_4) self.shellFgY = QSpinBox(self.shellTab) self.shellFgY.setObjectName(u"shellFgY") self.shellFgY.setMaximum(100000000) self.horizontalLayout_7.addWidget(self.shellFgY) self.formLayout_2.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_7) self.label_5 = QLabel(self.shellTab) self.label_5.setObjectName(u"label_5") self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_5) self.horizontalLayout_8 = QHBoxLayout() self.horizontalLayout_8.setObjectName(u"horizontalLayout_8") self.label_7 = QLabel(self.shellTab) self.label_7.setObjectName(u"label_7") self.label_7.setAlignment(Qt.AlignCenter) self.horizontalLayout_8.addWidget(self.label_7) self.shellFgW = QSpinBox(self.shellTab) self.shellFgW.setObjectName(u"shellFgW") self.shellFgW.setMaximum(100000000) self.horizontalLayout_8.addWidget(self.shellFgW) self.label_6 = QLabel(self.shellTab) self.label_6.setObjectName(u"label_6") self.label_6.setAlignment(Qt.AlignCenter) self.horizontalLayout_8.addWidget(self.label_6) self.shellFgH = QSpinBox(self.shellTab) self.shellFgH.setObjectName(u"shellFgH") self.shellFgH.setMaximum(10000000) self.horizontalLayout_8.addWidget(self.shellFgH) self.formLayout_2.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_8) self.opsParamsStack.addWidget(self.shellTab) self.insertTab = QWidget() self.insertTab.setObjectName(u"insertTab") self.formLayout_3 = QFormLayout(self.insertTab) self.formLayout_3.setObjectName(u"formLayout_3") self.formLayout_3.setVerticalSpacing(40) self.formLayout_3.setContentsMargins(-1, 40, -1, -1) self.label_32 = QLabel(self.insertTab) self.label_32.setObjectName(u"label_32") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_32) self.horizontalLayout_20 = QHBoxLayout() self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") self.insertImgPath = QLineEdit(self.insertTab) self.insertImgPath.setObjectName(u"insertImgPath") self.horizontalLayout_20.addWidget(self.insertImgPath) self.insertBrowseImgBtn = QPushButton(self.insertTab) self.insertBrowseImgBtn.setObjectName(u"insertBrowseImgBtn") self.horizontalLayout_20.addWidget(self.insertBrowseImgBtn) self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_20) self.label_13 = QLabel(self.insertTab) self.label_13.setObjectName(u"label_13") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_13) self.horizontalLayout_18 = QHBoxLayout() self.horizontalLayout_18.setObjectName(u"horizontalLayout_18") self.label_26 = QLabel(self.insertTab) self.label_26.setObjectName(u"label_26") self.label_26.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_26) self.insertFgX = QSpinBox(self.insertTab) self.insertFgX.setObjectName(u"insertFgX") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.insertFgX.sizePolicy().hasHeightForWidth()) self.insertFgX.setSizePolicy(sizePolicy1) self.insertFgX.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgX) self.label_29 = QLabel(self.insertTab) self.label_29.setObjectName(u"label_29") self.label_29.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_29) self.insertFgY = QSpinBox(self.insertTab) self.insertFgY.setObjectName(u"insertFgY") self.insertFgY.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgY) self.formLayout_3.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_18) self.label_12 = QLabel(self.insertTab) self.label_12.setObjectName(u"label_12") self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_12) self.horizontalLayout_21 = QHBoxLayout() self.horizontalLayout_21.setObjectName(u"horizontalLayout_21") self.label_33 = QLabel(self.insertTab) self.label_33.setObjectName(u"label_33") self.label_33.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_33) self.insertFgW = QSpinBox(self.insertTab) self.insertFgW.setObjectName(u"insertFgW") self.insertFgW.setBaseSize(QSize(1920, 0)) self.insertFgW.setMaximum(1000000) self.insertFgW.setValue(1920) self.horizontalLayout_21.addWidget(self.insertFgW) self.label_34 = QLabel(self.insertTab) self.label_34.setObjectName(u"label_34") self.label_34.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_34) self.insertFgH = QSpinBox(self.insertTab) self.insertFgH.setObjectName(u"insertFgH") self.insertFgH.setMaximum(1000000000) self.insertFgH.setValue(1080) self.horizontalLayout_21.addWidget(self.insertFgH) self.formLayout_3.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_21) self.opsParamsStack.addWidget(self.insertTab) self.sectionTab = QWidget() self.sectionTab.setObjectName(u"sectionTab") self.formLayout_6 = QFormLayout(self.sectionTab) self.formLayout_6.setObjectName(u"formLayout_6") self.sectionRulesListWidget = QListWidget(self.sectionTab) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) QListWidgetItem(self.sectionRulesListWidget) self.sectionRulesListWidget.setObjectName(u"sectionRulesListWidget") self.sectionRulesListWidget.setMaximumSize(QSize(16777215, 100)) self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.sectionRulesListWidget) self.label_10 = QLabel(self.sectionTab) self.label_10.setObjectName(u"label_10") self.label_10.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.label_10) self.sectionCoverageLabel = QLabel(self.sectionTab) self.sectionCoverageLabel.setObjectName(u"sectionCoverageLabel") self.sectionCoverageLabel.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.sectionCoverageLabel) self.label_11 = QLabel(self.sectionTab) self.label_11.setObjectName(u"label_11") self.label_11.setMaximumSize(QSize(16777215, 20)) self.formLayout_6.setWidget(3, QFormLayout.FieldRole, self.label_11) self.opsParamsStack.addWidget(self.sectionTab) self.audioTab = QWidget() self.audioTab.setObjectName(u"audioTab") self.formLayout_8 = QFormLayout(self.audioTab) self.formLayout_8.setObjectName(u"formLayout_8") self.comboBox = QComboBox(self.audioTab) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_8.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.label_8 = QLabel(self.audioTab) self.label_8.setObjectName(u"label_8") self.formLayout_8.setWidget(0, QFormLayout.LabelRole, self.label_8) self.opsParamsStack.addWidget(self.audioTab) self.cropTab = QWidget() self.cropTab.setObjectName(u"cropTab") self.formLayout_4 = QFormLayout(self.cropTab) self.formLayout_4.setObjectName(u"formLayout_4") self.formLayout_4.setVerticalSpacing(40) self.formLayout_4.setContentsMargins(-1, 40, -1, -1) self.label_14 = QLabel(self.cropTab) self.label_14.setObjectName(u"label_14") self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_14) self.horizontalLayout_19 = QHBoxLayout() self.horizontalLayout_19.setObjectName(u"horizontalLayout_19") self.label_30 = QLabel(self.cropTab) self.label_30.setObjectName(u"label_30") self.label_30.setAlignment(Qt.AlignCenter) self.horizontalLayout_19.addWidget(self.label_30) self.spinBox_21 = QSpinBox(self.cropTab) self.spinBox_21.setObjectName(u"spinBox_21") self.horizontalLayout_19.addWidget(self.spinBox_21) self.label_31 = QLabel(self.cropTab) self.label_31.setObjectName(u"label_31") self.label_31.setAlignment(Qt.AlignCenter) self.horizontalLayout_19.addWidget(self.label_31) self.spinBox_22 = QSpinBox(self.cropTab) self.spinBox_22.setObjectName(u"spinBox_22") self.horizontalLayout_19.addWidget(self.spinBox_22) self.formLayout_4.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_19) self.label_15 = QLabel(self.cropTab) self.label_15.setObjectName(u"label_15") self.formLayout_4.setWidget(1, QFormLayout.LabelRole, self.label_15) self.horizontalLayout_22 = QHBoxLayout() self.horizontalLayout_22.setObjectName(u"horizontalLayout_22") self.label_35 = QLabel(self.cropTab) self.label_35.setObjectName(u"label_35") self.label_35.setAlignment(Qt.AlignCenter) self.horizontalLayout_22.addWidget(self.label_35) self.spinBox_25 = QSpinBox(self.cropTab) self.spinBox_25.setObjectName(u"spinBox_25") self.horizontalLayout_22.addWidget(self.spinBox_25) self.label_36 = QLabel(self.cropTab) self.label_36.setObjectName(u"label_36") self.label_36.setAlignment(Qt.AlignCenter) self.horizontalLayout_22.addWidget(self.label_36) self.spinBox_26 = QSpinBox(self.cropTab) self.spinBox_26.setObjectName(u"spinBox_26") self.horizontalLayout_22.addWidget(self.spinBox_26) self.formLayout_4.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_22) self.opsParamsStack.addWidget(self.cropTab) self.composeTab = QWidget() self.composeTab.setObjectName(u"composeTab") self.verticalLayout_12 = QVBoxLayout(self.composeTab) self.verticalLayout_12.setObjectName(u"verticalLayout_12") self.verticalLayout_11 = QVBoxLayout() self.verticalLayout_11.setObjectName(u"verticalLayout_11") self.verticalLayout_12.addLayout(self.verticalLayout_11) self.opsParamsStack.addWidget(self.composeTab) self.resizeTab = QWidget() self.resizeTab.setObjectName(u"resizeTab") self.verticalLayout_10 = QVBoxLayout(self.resizeTab) self.verticalLayout_10.setObjectName(u"verticalLayout_10") self.verticalLayout_9 = QVBoxLayout() self.verticalLayout_9.setObjectName(u"verticalLayout_9") self.verticalLayout_10.addLayout(self.verticalLayout_9) self.opsParamsStack.addWidget(self.resizeTab) self.pacingTab = QWidget() self.pacingTab.setObjectName(u"pacingTab") self.verticalLayout_5 = QVBoxLayout(self.pacingTab) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.verticalLayout_5.setContentsMargins(0, 0, 0, 0) self.tabWidget = QTabWidget(self.pacingTab) self.tabWidget.setObjectName(u"tabWidget") self.tab = QWidget() self.tab.setObjectName(u"tab") self.tabWidget.addTab(self.tab, "") self.tab_2 = QWidget() self.tab_2.setObjectName(u"tab_2") self.tabWidget.addTab(self.tab_2, "") self.verticalLayout_5.addWidget(self.tabWidget) self.opsParamsStack.addWidget(self.pacingTab) self.animateTab = QWidget() self.animateTab.setObjectName(u"animateTab") self.verticalLayout_14 = QVBoxLayout(self.animateTab) self.verticalLayout_14.setObjectName(u"verticalLayout_14") self.verticalLayout_13 = QVBoxLayout() self.verticalLayout_13.setObjectName(u"verticalLayout_13") self.verticalLayout_14.addLayout(self.verticalLayout_13) self.opsParamsStack.addWidget(self.animateTab) self.renderTab = QWidget() self.renderTab.setObjectName(u"renderTab") self.verticalLayout_4 = QVBoxLayout(self.renderTab) self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.renderTabTabs = QTabWidget(self.renderTab) self.renderTabTabs.setObjectName(u"renderTabTabs") self.renderTabVideoTab = QWidget() self.renderTabVideoTab.setObjectName(u"renderTabVideoTab") self.verticalLayout_2 = QVBoxLayout(self.renderTabVideoTab) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.verticalLayout_2.setContentsMargins(5, 5, 5, 5) self.scrollArea = QScrollArea(self.renderTabVideoTab) self.scrollArea.setObjectName(u"scrollArea") self.scrollArea.setFrameShape(QFrame.Panel) self.scrollArea.setFrameShadow(QFrame.Plain) self.scrollArea.setLineWidth(0) self.scrollArea.setWidgetResizable(True) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName( u"scrollAreaWidgetContents") self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 438, 412)) self.formLayout_10 = QFormLayout(self.scrollAreaWidgetContents) self.formLayout_10.setObjectName(u"formLayout_10") self.videoTitleLabel = QLabel(self.scrollAreaWidgetContents) self.videoTitleLabel.setObjectName(u"videoTitleLabel") self.formLayout_10.setWidget(0, QFormLayout.LabelRole, self.videoTitleLabel) self.renderOutputTitle = QLineEdit(self.scrollAreaWidgetContents) self.renderOutputTitle.setObjectName(u"renderOutputTitle") self.formLayout_10.setWidget(0, QFormLayout.FieldRole, self.renderOutputTitle) self.videoDirectoryLabel = QLabel(self.scrollAreaWidgetContents) self.videoDirectoryLabel.setObjectName(u"videoDirectoryLabel") self.formLayout_10.setWidget(1, QFormLayout.LabelRole, self.videoDirectoryLabel) self.renderOutputDir = QLineEdit(self.scrollAreaWidgetContents) self.renderOutputDir.setObjectName(u"renderOutputDir") self.formLayout_10.setWidget(1, QFormLayout.FieldRole, self.renderOutputDir) self.videoFormatLabel = QLabel(self.scrollAreaWidgetContents) self.videoFormatLabel.setObjectName(u"videoFormatLabel") self.formLayout_10.setWidget(2, QFormLayout.LabelRole, self.videoFormatLabel) self.renderOutputFormat = QComboBox(self.scrollAreaWidgetContents) self.renderOutputFormat.addItem("") self.renderOutputFormat.addItem("") self.renderOutputFormat.setObjectName(u"renderOutputFormat") self.formLayout_10.setWidget(2, QFormLayout.FieldRole, self.renderOutputFormat) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout_2.addWidget(self.scrollArea) self.renderTabTabs.addTab(self.renderTabVideoTab, "") self.renderTabAudioTab = QWidget() self.renderTabAudioTab.setObjectName(u"renderTabAudioTab") self.verticalLayout_6 = QVBoxLayout(self.renderTabAudioTab) self.verticalLayout_6.setObjectName(u"verticalLayout_6") self.scrollArea_2 = QScrollArea(self.renderTabAudioTab) self.scrollArea_2.setObjectName(u"scrollArea_2") self.scrollArea_2.setWidgetResizable(True) self.scrollAreaWidgetContents_2 = QWidget() self.scrollAreaWidgetContents_2.setObjectName( u"scrollAreaWidgetContents_2") self.scrollAreaWidgetContents_2.setGeometry(QRect(0, 0, 428, 402)) self.formLayout_11 = QFormLayout(self.scrollAreaWidgetContents_2) self.formLayout_11.setObjectName(u"formLayout_11") self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) self.verticalLayout_6.addWidget(self.scrollArea_2) self.renderTabTabs.addTab(self.renderTabAudioTab, "") self.renderTabPacingTab = QWidget() self.renderTabPacingTab.setObjectName(u"renderTabPacingTab") self.verticalLayout_8 = QVBoxLayout(self.renderTabPacingTab) self.verticalLayout_8.setObjectName(u"verticalLayout_8") self.scrollArea_3 = QScrollArea(self.renderTabPacingTab) self.scrollArea_3.setObjectName(u"scrollArea_3") self.scrollArea_3.setWidgetResizable(True) self.scrollAreaWidgetContents_3 = QWidget() self.scrollAreaWidgetContents_3.setObjectName( u"scrollAreaWidgetContents_3") self.scrollAreaWidgetContents_3.setGeometry(QRect(0, 0, 428, 402)) self.formLayout_12 = QFormLayout(self.scrollAreaWidgetContents_3) self.formLayout_12.setObjectName(u"formLayout_12") self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3) self.verticalLayout_8.addWidget(self.scrollArea_3) self.renderTabTabs.addTab(self.renderTabPacingTab, "") self.verticalLayout_4.addWidget(self.renderTabTabs) self.opsParamsStack.addWidget(self.renderTab) self.extraTab = QWidget() self.extraTab.setObjectName(u"extraTab") self.formLayout_7 = QFormLayout(self.extraTab) self.formLayout_7.setObjectName(u"formLayout_7") self.opsParamsStack.addWidget(self.extraTab) self.verticalLayout.addWidget(self.opsParamsStack) self.opLayout.addWidget(self.groupBox_6) self.horizontalLayout_9 = QHBoxLayout() self.horizontalLayout_9.setObjectName(u"horizontalLayout_9") self.horizontalLayout_9.setContentsMargins(10, 10, 10, 10) self.resetStepParamsBtn = QPushButton(opsWidget) self.resetStepParamsBtn.setObjectName(u"resetStepParamsBtn") self.horizontalLayout_9.addWidget(self.resetStepParamsBtn) self.saveStepParamsBtn = QPushButton(opsWidget) self.saveStepParamsBtn.setObjectName(u"saveStepParamsBtn") self.horizontalLayout_9.addWidget(self.saveStepParamsBtn) self.opLayout.addLayout(self.horizontalLayout_9) self.retranslateUi(opsWidget) self.opCombo.currentIndexChanged.connect( self.opsParamsStack.setCurrentIndex) self.opsParamsStack.setCurrentIndex(9) self.renderTabTabs.setCurrentIndex(0) QMetaObject.connectSlotsByName(opsWidget) # setupUi def retranslateUi(self, opsWidget): self.operationSelect.setTitle( QCoreApplication.translate("opsWidget", u"Operation", None)) self.applyOpLabel.setText( QCoreApplication.translate("opsWidget", u"Operation", None)) self.opCombo.setItemText( 0, QCoreApplication.translate("opsWidget", u"Shell", None)) self.opCombo.setItemText( 1, QCoreApplication.translate("opsWidget", u"Insert", None)) self.opCombo.setItemText( 2, QCoreApplication.translate("opsWidget", u"Section", None)) self.opCombo.setItemText( 3, QCoreApplication.translate("opsWidget", u"Audio", None)) self.opCombo.setItemText( 4, QCoreApplication.translate("opsWidget", u"Crop", None)) self.opCombo.setItemText( 5, QCoreApplication.translate("opsWidget", u"Compose Demos", None)) self.opCombo.setItemText( 6, QCoreApplication.translate("opsWidget", u"Resize", None)) self.opCombo.setItemText( 7, QCoreApplication.translate("opsWidget", u"Add pacing", None)) self.opCombo.setItemText( 8, QCoreApplication.translate("opsWidget", u"Animate scroll steps", None)) self.opCombo.setItemText( 9, QCoreApplication.translate("opsWidget", u"Render to video", None)) self.applyToLabel.setText( QCoreApplication.translate("opsWidget", u"Apply to:", None)) self.allDemoCheck.setText( QCoreApplication.translate("opsWidget", u"Apply to all demos", None)) self.allStepsCheck.setText( QCoreApplication.translate("opsWidget", u"Apply to all steps", None)) self.matchSubstringCheck.setText( QCoreApplication.translate( "opsWidget", u"Apply to steps with matching substring:", None)) self.label_16.setText( QCoreApplication.translate("opsWidget", u"Steps containing:", None)) self.applyDemoLabel.setText( QCoreApplication.translate("opsWidget", u"Demo", None)) self.groupBox_6.setTitle( QCoreApplication.translate("opsWidget", u"Parameters", None)) self.label.setText( QCoreApplication.translate("opsWidget", u"Background", None)) #if QT_CONFIG(statustip) self.shellImgPath.setStatusTip( QCoreApplication.translate( "opsWidget", u"Filepath of image to be used as shell for demo assets", None)) #endif // QT_CONFIG(statustip) self.shellBrowseImgBtn.setText( QCoreApplication.translate("opsWidget", u"Browse", None)) self.label_2.setText( QCoreApplication.translate("opsWidget", u"Coordinates of assets on shell", None)) self.label_3.setText( QCoreApplication.translate("opsWidget", u"X", None)) self.label_4.setText( QCoreApplication.translate("opsWidget", u"Y", None)) self.label_5.setText( QCoreApplication.translate("opsWidget", u"Dimensions of assets on shell", None)) self.label_7.setText( QCoreApplication.translate("opsWidget", u"Width", None)) self.label_6.setText( QCoreApplication.translate("opsWidget", u"Height", None)) self.label_32.setText( QCoreApplication.translate("opsWidget", u"Image to paste", None)) self.insertBrowseImgBtn.setText( QCoreApplication.translate("opsWidget", u"Browse", None)) self.label_13.setText( QCoreApplication.translate("opsWidget", u"Coords of image on assets", None)) self.label_26.setText( QCoreApplication.translate("opsWidget", u"X", None)) self.label_29.setText( QCoreApplication.translate("opsWidget", u"Y", None)) self.label_12.setText( QCoreApplication.translate("opsWidget", u"Dimensions of image on assets", None)) self.label_33.setText( QCoreApplication.translate("opsWidget", u"Width", None)) self.label_34.setText( QCoreApplication.translate("opsWidget", u"Height", None)) __sortingEnabled = self.sectionRulesListWidget.isSortingEnabled() self.sectionRulesListWidget.setSortingEnabled(False) ___qlistwidgetitem = self.sectionRulesListWidget.item(0) ___qlistwidgetitem.setText( QCoreApplication.translate("opsWidget", u"Step has TP, next step without TP", None)) ___qlistwidgetitem1 = self.sectionRulesListWidget.item(1) ___qlistwidgetitem1.setText( QCoreApplication.translate("opsWidget", u"Step has TP, next step with TP", None)) ___qlistwidgetitem2 = self.sectionRulesListWidget.item(2) ___qlistwidgetitem2.setText( QCoreApplication.translate( "opsWidget", u"Step has TP, previous step without TP", None)) ___qlistwidgetitem3 = self.sectionRulesListWidget.item(3) ___qlistwidgetitem3.setText( QCoreApplication.translate("opsWidget", u"Step has TP, previous step with TP", None)) ___qlistwidgetitem4 = self.sectionRulesListWidget.item(4) ___qlistwidgetitem4.setText( QCoreApplication.translate("opsWidget", u"Step has fade-in", None)) ___qlistwidgetitem5 = self.sectionRulesListWidget.item(5) ___qlistwidgetitem5.setText( QCoreApplication.translate("opsWidget", u"Step has jump box", None)) ___qlistwidgetitem6 = self.sectionRulesListWidget.item(6) ___qlistwidgetitem6.setText( QCoreApplication.translate("opsWidget", u"Step TP contains text pattern...", None)) self.sectionRulesListWidget.setSortingEnabled(__sortingEnabled) self.label_10.setText( QCoreApplication.translate("opsWidget", u"Insert new section on...", None)) self.sectionCoverageLabel.setText( QCoreApplication.translate( "opsWidget", u"Covers 0 steps in selected sections/steps", None)) self.label_11.setText( QCoreApplication.translate( "opsWidget", u"May not match number of audio soundbites (audio not imported)", None)) self.comboBox.setItemText( 0, QCoreApplication.translate("opsWidget", u"Mixed section and step audio", None)) self.comboBox.setItemText( 1, QCoreApplication.translate("opsWidget", u"Section audio only", None)) self.comboBox.setItemText( 2, QCoreApplication.translate("opsWidget", u"Step audio only", None)) self.label_8.setText( QCoreApplication.translate("opsWidget", u"Audio attachment behavior", None)) self.label_14.setText( QCoreApplication.translate("opsWidget", u"Crop start coordinates", None)) self.label_30.setText( QCoreApplication.translate("opsWidget", u"X", None)) self.label_31.setText( QCoreApplication.translate("opsWidget", u"Y", None)) self.label_15.setText( QCoreApplication.translate("opsWidget", u"Crop dimensions", None)) self.label_35.setText( QCoreApplication.translate("opsWidget", u"Width", None)) self.label_36.setText( QCoreApplication.translate("opsWidget", u"Height", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QCoreApplication.translate("opsWidget", u"Tab 1", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("opsWidget", u"Tab 2", None)) self.videoTitleLabel.setText( QCoreApplication.translate("opsWidget", u"Video Title", None)) self.videoDirectoryLabel.setText( QCoreApplication.translate("opsWidget", u"Video Directory", None)) self.videoFormatLabel.setText( QCoreApplication.translate("opsWidget", u"Video Format", None)) self.renderOutputFormat.setItemText( 0, QCoreApplication.translate("opsWidget", u"avi", None)) self.renderOutputFormat.setItemText( 1, QCoreApplication.translate("opsWidget", u"mp4", None)) self.renderTabTabs.setTabText( self.renderTabTabs.indexOf(self.renderTabVideoTab), QCoreApplication.translate("opsWidget", u"Video", None)) self.renderTabTabs.setTabText( self.renderTabTabs.indexOf(self.renderTabAudioTab), QCoreApplication.translate("opsWidget", u"Audio", None)) self.renderTabTabs.setTabText( self.renderTabTabs.indexOf(self.renderTabPacingTab), QCoreApplication.translate("opsWidget", u"Pacing", None)) self.resetStepParamsBtn.setText( QCoreApplication.translate("opsWidget", u"Reset to default", None)) self.saveStepParamsBtn.setText( QCoreApplication.translate("opsWidget", u"Save step parameters", None)) pass
class Ui_MainWindow(object): def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(534, 188) self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout = QVBoxLayout(self.centralwidget) self.verticalLayout.setObjectName(u"verticalLayout") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.line_source = QLineEdit(self.centralwidget) self.line_source.setObjectName(u"line_source") self.line_source.setEnabled(True) self.line_source.setReadOnly(True) self.horizontalLayout.addWidget(self.line_source) self.button_source = QPushButton(self.centralwidget) self.button_source.setObjectName(u"button_source") self.horizontalLayout.addWidget(self.button_source) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.line_target = QLineEdit(self.centralwidget) self.line_target.setObjectName(u"line_target") self.line_target.setEnabled(True) self.line_target.setReadOnly(True) self.horizontalLayout_2.addWidget(self.line_target) self.button_target = QPushButton(self.centralwidget) self.button_target.setObjectName(u"button_target") self.horizontalLayout_2.addWidget(self.button_target) self.verticalLayout.addLayout(self.horizontalLayout_2) self.line = QFrame(self.centralwidget) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.label_2 = QLabel(self.centralwidget) self.label_2.setObjectName(u"label_2") self.horizontalLayout_3.addWidget(self.label_2) self.spin_memory = QSpinBox(self.centralwidget) self.spin_memory.setObjectName(u"spin_memory") self.horizontalLayout_3.addWidget(self.spin_memory) self.label_3 = QLabel(self.centralwidget) self.label_3.setObjectName(u"label_3") self.horizontalLayout_3.addWidget(self.label_3) self.spin_blur = QSpinBox(self.centralwidget) self.spin_blur.setObjectName(u"spin_blur") self.spin_blur.setValue(9) self.horizontalLayout_3.addWidget(self.spin_blur) self.label_5 = QLabel(self.centralwidget) self.label_5.setObjectName(u"label_5") self.horizontalLayout_3.addWidget(self.label_5) self.double_spin_threshold = QDoubleSpinBox(self.centralwidget) self.double_spin_threshold.setObjectName(u"double_spin_threshold") self.double_spin_threshold.setMaximum(1.000000000000000) self.double_spin_threshold.setSingleStep(0.050000000000000) self.double_spin_threshold.setValue(0.300000000000000) self.horizontalLayout_3.addWidget(self.double_spin_threshold) self.label_6 = QLabel(self.centralwidget) self.label_6.setObjectName(u"label_6") self.horizontalLayout_3.addWidget(self.label_6) self.double_spin_roimulti = QDoubleSpinBox(self.centralwidget) self.double_spin_roimulti.setObjectName(u"double_spin_roimulti") self.double_spin_roimulti.setMinimum(0.800000000000000) self.double_spin_roimulti.setMaximum(10.000000000000000) self.double_spin_roimulti.setSingleStep(0.050000000000000) self.double_spin_roimulti.setValue(1.000000000000000) self.horizontalLayout_3.addWidget(self.double_spin_roimulti) self.verticalLayout.addLayout(self.horizontalLayout_3) self.line_2 = QFrame(self.centralwidget) self.line_2.setObjectName(u"line_2") self.line_2.setFrameShape(QFrame.HLine) self.line_2.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line_2) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.label = QLabel(self.centralwidget) self.label.setObjectName(u"label") self.horizontalLayout_4.addWidget(self.label) self.combo_box_weights = QComboBox(self.centralwidget) self.combo_box_weights.setObjectName(u"combo_box_weights") self.horizontalLayout_4.addWidget(self.combo_box_weights) self.label_4 = QLabel(self.centralwidget) self.label_4.setObjectName(u"label_4") self.horizontalLayout_4.addWidget(self.label_4) self.combo_box_scale = QComboBox(self.centralwidget) self.combo_box_scale.addItem("") self.combo_box_scale.addItem("") self.combo_box_scale.addItem("") self.combo_box_scale.setObjectName(u"combo_box_scale") self.horizontalLayout_4.addWidget(self.combo_box_scale) self.label_7 = QLabel(self.centralwidget) self.label_7.setObjectName(u"label_7") self.horizontalLayout_4.addWidget(self.label_7) self.spin_quality = QSpinBox(self.centralwidget) self.spin_quality.setObjectName(u"spin_quality") self.spin_quality.setMaximum(10) self.spin_quality.setValue(5) self.horizontalLayout_4.addWidget(self.spin_quality) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_4.addItem(self.horizontalSpacer) self.verticalLayout.addLayout(self.horizontalLayout_4) self.line_3 = QFrame(self.centralwidget) self.line_3.setObjectName(u"line_3") self.line_3.setFrameShape(QFrame.HLine) self.line_3.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line_3) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.progress = QProgressBar(self.centralwidget) self.progress.setObjectName(u"progress") self.progress.setEnabled(True) self.progress.setValue(0) self.horizontalLayout_5.addWidget(self.progress) self.button_start = QPushButton(self.centralwidget) self.button_start.setObjectName(u"button_start") self.horizontalLayout_5.addWidget(self.button_start) self.button_abort = QPushButton(self.centralwidget) self.button_abort.setObjectName(u"button_abort") self.button_abort.setEnabled(False) self.horizontalLayout_5.addWidget(self.button_abort) self.verticalLayout.addLayout(self.horizontalLayout_5) MainWindow.setCentralWidget(self.centralwidget) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow) # setupUi def retranslateUi(self, MainWindow): MainWindow.setWindowTitle( QCoreApplication.translate("MainWindow", u"DashcamCleaner", None)) self.button_source.setText( QCoreApplication.translate("MainWindow", u"Select video", None)) self.button_target.setText( QCoreApplication.translate("MainWindow", u"Select target", None)) self.label_2.setText( QCoreApplication.translate("MainWindow", u"Frame memory:", None)) self.label_3.setText( QCoreApplication.translate("MainWindow", u"Blur size:", None)) self.label_5.setText( QCoreApplication.translate("MainWindow", u"Detection threshold:", None)) self.label_6.setText( QCoreApplication.translate("MainWindow", u"ROI enlargement", None)) self.label.setText( QCoreApplication.translate("MainWindow", u"Weights", None)) self.label_4.setText( QCoreApplication.translate("MainWindow", u"Inference size", None)) self.combo_box_scale.setItemText( 0, QCoreApplication.translate("MainWindow", u"360p", None)) self.combo_box_scale.setItemText( 1, QCoreApplication.translate("MainWindow", u"720p", None)) self.combo_box_scale.setItemText( 2, QCoreApplication.translate("MainWindow", u"1080p", None)) self.combo_box_scale.setCurrentText( QCoreApplication.translate("MainWindow", u"360p", None)) self.label_7.setText( QCoreApplication.translate("MainWindow", u"Output Quality", None)) self.button_start.setText( QCoreApplication.translate("MainWindow", u"Start", None)) self.button_abort.setText( QCoreApplication.translate("MainWindow", u"Abort", None))
class Ui_VehicleRentalDlg(object): def setupUi(self, VehicleRentalDlg): if not VehicleRentalDlg.objectName(): VehicleRentalDlg.setObjectName(u"VehicleRentalDlg") VehicleRentalDlg.resize(206, 246) self.gridLayout = QGridLayout(VehicleRentalDlg) # ifndef Q_OS_MAC self.gridLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout.setObjectName(u"gridLayout") self.buttonBox = QDialogButtonBox(VehicleRentalDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 4, 0, 1, 1) self.spacerItem = QSpacerItem(188, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.spacerItem, 3, 0, 1, 1) self.hboxLayout = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout.setSpacing(6) # endif self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.hboxLayout.setObjectName(u"hboxLayout") self.label_6 = QLabel(VehicleRentalDlg) self.label_6.setObjectName(u"label_6") self.hboxLayout.addWidget(self.label_6) self.mileageLabel = QLabel(VehicleRentalDlg) self.mileageLabel.setObjectName(u"mileageLabel") self.mileageLabel.setFrameShape(QFrame.StyledPanel) self.mileageLabel.setFrameShadow(QFrame.Sunken) self.mileageLabel.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.hboxLayout.addWidget(self.mileageLabel) self.gridLayout.addLayout(self.hboxLayout, 2, 0, 1, 1) self.stackedWidget = QStackedWidget(VehicleRentalDlg) self.stackedWidget.setObjectName(u"stackedWidget") self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.gridLayout1 = QGridLayout(self.page_2) # ifndef Q_OS_MAC self.gridLayout1.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout1.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout1.setObjectName(u"gridLayout1") self.colorComboBox = QComboBox(self.page_2) self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.addItem("") self.colorComboBox.setObjectName(u"colorComboBox") self.gridLayout1.addWidget(self.colorComboBox, 0, 1, 1, 1) self.label_4 = QLabel(self.page_2) self.label_4.setObjectName(u"label_4") self.gridLayout1.addWidget(self.label_4, 0, 0, 1, 1) self.label_5 = QLabel(self.page_2) self.label_5.setObjectName(u"label_5") self.gridLayout1.addWidget(self.label_5, 1, 0, 1, 1) self.seatsSpinBox = QSpinBox(self.page_2) self.seatsSpinBox.setObjectName(u"seatsSpinBox") self.seatsSpinBox.setAlignment(Qt.AlignRight) self.seatsSpinBox.setMinimum(2) self.seatsSpinBox.setMaximum(12) self.seatsSpinBox.setValue(4) self.gridLayout1.addWidget(self.seatsSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page_2) self.page = QWidget() self.page.setObjectName(u"page") self.gridLayout2 = QGridLayout(self.page) # ifndef Q_OS_MAC self.gridLayout2.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout2.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout2.setObjectName(u"gridLayout2") self.weightSpinBox = QSpinBox(self.page) self.weightSpinBox.setObjectName(u"weightSpinBox") self.weightSpinBox.setAlignment(Qt.AlignRight) self.weightSpinBox.setMinimum(1) self.weightSpinBox.setMaximum(8) self.gridLayout2.addWidget(self.weightSpinBox, 0, 1, 1, 1) self.label_3 = QLabel(self.page) self.label_3.setObjectName(u"label_3") self.gridLayout2.addWidget(self.label_3, 1, 0, 1, 1) self.label_2 = QLabel(self.page) self.label_2.setObjectName(u"label_2") self.gridLayout2.addWidget(self.label_2, 0, 0, 1, 1) self.volumeSpinBox = QSpinBox(self.page) self.volumeSpinBox.setObjectName(u"volumeSpinBox") self.volumeSpinBox.setAlignment(Qt.AlignRight) self.volumeSpinBox.setMinimum(4) self.volumeSpinBox.setMaximum(22) self.volumeSpinBox.setValue(10) self.gridLayout2.addWidget(self.volumeSpinBox, 1, 1, 1, 1) self.stackedWidget.addWidget(self.page) self.gridLayout.addWidget(self.stackedWidget, 1, 0, 1, 1) self.hboxLayout1 = QHBoxLayout() # ifndef Q_OS_MAC self.hboxLayout1.setSpacing(6) # endif self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.hboxLayout1.setObjectName(u"hboxLayout1") self.label = QLabel(VehicleRentalDlg) self.label.setObjectName(u"label") self.hboxLayout1.addWidget(self.label) self.vehicleComboBox = QComboBox(VehicleRentalDlg) self.vehicleComboBox.addItem("") self.vehicleComboBox.addItem("") self.vehicleComboBox.setObjectName(u"vehicleComboBox") self.hboxLayout1.addWidget(self.vehicleComboBox) self.gridLayout.addLayout(self.hboxLayout1, 0, 0, 1, 1) # if QT_CONFIG(shortcut) self.label_4.setBuddy(self.colorComboBox) self.label_5.setBuddy(self.seatsSpinBox) self.label_3.setBuddy(self.volumeSpinBox) self.label_2.setBuddy(self.seatsSpinBox) self.label.setBuddy(self.vehicleComboBox) # endif // QT_CONFIG(shortcut) self.retranslateUi(VehicleRentalDlg) self.vehicleComboBox.currentIndexChanged.connect( self.stackedWidget.setCurrentIndex) self.buttonBox.accepted.connect(VehicleRentalDlg.accept) self.buttonBox.rejected.connect(VehicleRentalDlg.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(VehicleRentalDlg) # setupUi def retranslateUi(self, VehicleRentalDlg): VehicleRentalDlg.setWindowTitle( QCoreApplication.translate("VehicleRentalDlg", u"Vehicle Rental", None)) self.label_6.setText( QCoreApplication.translate("VehicleRentalDlg", u"Max. Mileage:", None)) self.mileageLabel.setText( QCoreApplication.translate("VehicleRentalDlg", u"1000 miles", None)) self.colorComboBox.setItemText( 0, QCoreApplication.translate("VehicleRentalDlg", u"Black", None)) self.colorComboBox.setItemText( 1, QCoreApplication.translate("VehicleRentalDlg", u"Blue", None)) self.colorComboBox.setItemText( 2, QCoreApplication.translate("VehicleRentalDlg", u"Green", None)) self.colorComboBox.setItemText( 3, QCoreApplication.translate("VehicleRentalDlg", u"Red", None)) self.colorComboBox.setItemText( 4, QCoreApplication.translate("VehicleRentalDlg", u"Silver", None)) self.colorComboBox.setItemText( 5, QCoreApplication.translate("VehicleRentalDlg", u"White", None)) self.colorComboBox.setItemText( 6, QCoreApplication.translate("VehicleRentalDlg", u"Yellow", None)) self.label_4.setText( QCoreApplication.translate("VehicleRentalDlg", u"Co&lor:", None)) self.label_5.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Seats:", None)) self.weightSpinBox.setSuffix( QCoreApplication.translate("VehicleRentalDlg", u" tons", None)) self.label_3.setText( QCoreApplication.translate("VehicleRentalDlg", u"Volu&me:", None)) self.label_2.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Weight:", None)) self.volumeSpinBox.setSuffix( QCoreApplication.translate("VehicleRentalDlg", u" cu m", None)) self.label.setText( QCoreApplication.translate("VehicleRentalDlg", u"&Vehicle Type:", None)) self.vehicleComboBox.setItemText( 0, QCoreApplication.translate("VehicleRentalDlg", u"Car", None)) self.vehicleComboBox.setItemText( 1, QCoreApplication.translate("VehicleRentalDlg", u"Van", None))
class ImageFusionOptions(object): """ UI class that can be used by the AddOnOptions Class to allow the user customise their input parameters for auto-registration. """ def __init__(self, window_options): self.auto_image_fusion_frame = QtWidgets.QFrame() self.window = window_options self.moving_image = None self.fixed_image = None self.dict = {} self.setupUi() self.create_view() self.get_patients_info() def set_value(self, key, value): """ Stores values into a dictionary to the corresponding key. Parameters ---------- key (Any): value (Any): """ self.dict[key] = value def create_view(self): """ Create a table to hold all the ROI creation by isodose entries. """ self.auto_image_fusion_frame.setVisible(False) def setVisible(self, visibility): """ Custom setVisible function that will set the visibility of the GUI. Args: visibility (bool): flag for setting the GUI to visible """ self.auto_image_fusion_frame.setVisible(visibility) def setupUi(self): """ Constructs the GUI and sets the limit of each input field. """ # Create a vertical Widget to hold Vertical Layout self.vertical_layout_widget = QWidget() self.vertical_layout = QtWidgets.QVBoxLayout() # Create a Widget and set layout to a GridLayout self.gridLayoutWidget = QWidget() self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget) self.gridLayout.setSizeConstraint(QLayout.SetDefaultConstraint) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setVerticalSpacing(0) # Create horizontal spacer in the middle of the grid hspacer = QtWidgets.QSpacerItem(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) self.gridLayout.addItem(hspacer, 0, 5, 16, 1) # Labels self.fixed_image_label = QLabel("Fixed Image: ") fixed_image_sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred) fixed_image_sizePolicy.setHorizontalStretch(0) fixed_image_sizePolicy.setVerticalStretch(0) fixed_image_sizePolicy.setHeightForWidth( self.fixed_image_label.sizePolicy().hasHeightForWidth()) self.fixed_image_label.setAlignment(Qt.AlignRight | Qt.AlignTrailing | Qt.AlignVCenter) self.fixed_image_placeholder \ = QLabel("This is a placeholder for fixed image") self.fixed_image_placeholder.setWordWrap(False) self.fixed_image_placeholder.setText(str(self.fixed_image)) self.fixed_image_placeholder.setMaximumSize(200, 50) self.moving_image_label = QLabel("Moving Image: ") moving_image_label_sizePolicy = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum) moving_image_label_sizePolicy.setHorizontalStretch(0) moving_image_label_sizePolicy.setVerticalStretch(0) moving_image_label_sizePolicy.setHeightForWidth( self.moving_image_label.sizePolicy().hasHeightForWidth()) self.moving_image_label.setSizePolicy(moving_image_label_sizePolicy) self.moving_image_placeholder = QLabel("This is a placeholder") self.moving_image_placeholder.setWordWrap(False) self.moving_image_placeholder.setText(str(self.moving_image)) self.moving_image_placeholder.setMaximumSize(200, 50) self.gridLayout.addWidget(self.fixed_image_label, 0, 0) self.gridLayout.addWidget(self.fixed_image_placeholder, 0, 1) self.gridLayout.addWidget(self.moving_image_label, 0, 2) self.gridLayout.addWidget(self.moving_image_placeholder, 0, 3) # Default Numbers self.default_numbers_label = QLabel("Default Numbers") self.default_numbers_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.default_numbers_label, 1, 0) self.default_number_spinBox = QSpinBox(self.gridLayoutWidget) self.default_number_spinBox.setRange(-2147483648, 2147483647) self.default_number_spinBox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) self.default_number_spinBox.setToolTip( "Default voxel value. Defaults to -1000.") self.gridLayout.addWidget(self.default_number_spinBox, 1, 1) # Final Interp self.interp_order_label = QLabel("Final Interp") self.interp_order_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.interp_order_label, 2, 0) self.interp_order_spinbox = QSpinBox(self.gridLayoutWidget) self.interp_order_spinbox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) self.interp_order_spinbox.setToolTip("The final interpolation order.") self.gridLayout.addWidget(self.interp_order_spinbox, 2, 1) # Metric self.metric_label = QLabel("Metric") self.metric_label.setAlignment(QtCore.Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.metric_label, 3, 0) self.metric_comboBox = QComboBox() self.metric_comboBox.addItem("correlation") self.metric_comboBox.addItem("mean_squares") self.metric_comboBox.addItem("mattes_mi") self.metric_comboBox.addItem("joint_hist_mi") self.metric_comboBox.setToolTip( "The metric to be optimised during image registration.") self.gridLayout.addWidget(self.metric_comboBox, 3, 1) # Number of Iterations self.no_of_iterations_label = QLabel("Number of Iterations") self.no_of_iterations_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.no_of_iterations_label, 4, 0) self.no_of_iterations_spinBox = QSpinBox(self.gridLayoutWidget) self.no_of_iterations_spinBox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) self.no_of_iterations_spinBox.setRange(0, 100) self.no_of_iterations_spinBox.setToolTip( "Number of iterations in each multi-resolution step.") self.gridLayout.addWidget(self.no_of_iterations_spinBox, 4, 1) # Shrink Factor self.shrink_factor_label = QLabel("Shrink Factor") self.shrink_factor_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.shrink_factor_label, 5, 0) self.shrink_factor_qLineEdit = QLineEdit() self.shrink_factor_qLineEdit.resize( self.shrink_factor_qLineEdit.sizeHint().width(), self.shrink_factor_qLineEdit.sizeHint().height()) self.shrink_factor_qLineEdit.setValidator( QRegularExpressionValidator( QRegularExpression("^[0-9]*[,]?[0-9]*[,]?[0-9]"))) self.shrink_factor_qLineEdit.setToolTip( "The multi-resolution downsampling factors. Can be up to three " "integer elements in an array. Example [8, 2, 1]") self.gridLayout.addWidget(self.shrink_factor_qLineEdit, 5, 1) # Optimiser self.optimiser_label = QLabel("Optimiser") self.optimiser_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.optimiser_label, 1, 2) self.optimiser_comboBox = QComboBox(self.gridLayoutWidget) self.optimiser_comboBox.addItem("lbfgsb") self.optimiser_comboBox.addItem("gradient_descent") self.optimiser_comboBox.addItem("gradient_descent_line_search") self.optimiser_comboBox.setToolTip( "The optimiser algorithm used for image registration.") self.gridLayout.addWidget(self.optimiser_comboBox, 1, 3) # Reg Method self.reg_method_label = QLabel("Reg Method") self.reg_method_label.setAlignment(QtCore.Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.reg_method_label, 2, 2) self.reg_method_comboBox = QComboBox() self.reg_method_comboBox.addItem("translation") self.reg_method_comboBox.addItem("rigid") self.reg_method_comboBox.addItem("similarity") self.reg_method_comboBox.addItem("affine") self.reg_method_comboBox.addItem("scaleversor") self.reg_method_comboBox.addItem("scaleskewversor") self.reg_method_comboBox.setToolTip( "The linear transformation model to be used for image " "registration.") self.gridLayout.addWidget(self.reg_method_comboBox, 2, 3) # Sampling Rate self.sampling_rate_label = QLabel("Sampling Rate") self.sampling_rate_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.sampling_rate_label, 3, 2) self.sampling_rate_spinBox = QDoubleSpinBox(self.gridLayoutWidget) self.sampling_rate_spinBox.setMinimum(0) self.sampling_rate_spinBox.setMaximum(1) self.sampling_rate_spinBox.setSingleStep(0.01) self.sampling_rate_spinBox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) self.sampling_rate_spinBox.setToolTip("The fraction of voxels sampled " "during each iteration.") self.gridLayout.addWidget(self.sampling_rate_spinBox, 3, 3) # Smooth Sigmas self.smooth_sigma_label = QLabel("Smooth Sigma") self.smooth_sigma_label.setAlignment(Qt.AlignLeft | Qt.AlignTrailing | Qt.AlignVCenter) self.gridLayout.addWidget(self.smooth_sigma_label, 4, 2) self.smooth_sigmas_qLineEdit = QLineEdit() self.smooth_sigmas_qLineEdit.resize( self.smooth_sigmas_qLineEdit.sizeHint().width(), self.smooth_sigmas_qLineEdit.sizeHint().height()) self.smooth_sigmas_qLineEdit.setValidator( QRegularExpressionValidator( QRegularExpression("^[0-9]*[,]?[0-9]*[,]?[0-9]"))) self.smooth_sigmas_qLineEdit.setToolTip( "The multi-resolution smoothing kernal scale (Gaussian). Can be " "up to three integer elements in an array. Example [4, 2, 1]") self.gridLayout.addWidget(self.smooth_sigmas_qLineEdit, 4, 3) # Label to hold warning labels. self.warning_label = QLabel() # Button for fast mode self.fast_mode_button = QtWidgets.QPushButton("Fast Mode") self.fast_mode_button.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.fast_mode_button.clicked.connect(self.set_fast_mode) # Add Widgets to the vertical layout self.vertical_layout.addWidget(self.fast_mode_button) self.vertical_layout.addWidget(self.gridLayoutWidget) self.vertical_layout.addWidget(self.warning_label) # Set layout of frame to the gridlayout widget self.auto_image_fusion_frame.setLayout(self.vertical_layout) def set_gridLayout(self): """ Set the UI based on the values taken from the JSON """ msg = "" # If-Elif statements for setting the dict # this can only be done in if-else statements. if self.dict["reg_method"] == "translation": self.reg_method_comboBox.setCurrentIndex(0) elif self.dict["reg_method"] == "rigid": self.reg_method_comboBox.setCurrentIndex(1) elif self.dict["reg_method"] == "similarity": self.reg_method_comboBox.setCurrentIndex(2) elif self.dict["reg_method"] == "affine": self.reg_method_comboBox.setCurrentIndex(3) elif self.dict["reg_method"] == "scaleversor": self.reg_method_comboBox.setCurrentIndex(4) elif self.dict["reg_method"] == "scaleskewversor": self.reg_method_comboBox.setCurrentIndex(5) else: msg += 'There was an error setting the reg_method value.\n' self.warning_label.setText(msg) if self.dict["metric"] == "coorelation": self.metric_comboBox.setCurrentIndex(0) elif self.dict["metric"] == "mean_squares": self.metric_comboBox.setCurrentIndex(1) elif self.dict["metric"] == "mattes_mi": self.metric_comboBox.setCurrentIndex(2) elif self.dict["metric"] == "joint_hist_mi": self.metric_comboBox.setCurrentIndex(3) else: msg += 'There was an error setting the metric value.\n' self.warning_label.setText(msg) if self.dict["optimiser"] == "lbfgsb": self.optimiser_comboBox.setCurrentIndex(0) elif self.dict["optimiser"] == "gradient_descent": self.optimiser_comboBox.setCurrentIndex(1) elif self.dict["optimiser"] == "gradient_descent_line_search": self.optimiser_comboBox.setCurrentIndex(2) else: msg += 'There was an error setting the optimiser value.\n' self.warning_label.setText(msg) # Check if all elements in list are ints if all(isinstance(x, int) for x in self.dict["shrink_factors"]): # Shrink_factors is stored as a list in JSON convert the list into # a string. shrink_factor_list_json = ', '.join( str(e) for e in self.dict["shrink_factors"]) self.shrink_factor_qLineEdit.setText(shrink_factor_list_json) else: msg += 'There was an error setting the Shrink Factors value.\n' self.warning_label.setText(msg) # Check if all elements in list are ints if all(isinstance(x, int) for x in self.dict["smooth_sigmas"]): # Since smooth_sigma is stored as a list in JSON convert the list # into a string. smooth_sigma_list_json = ', '.join( str(e) for e in self.dict["smooth_sigmas"]) self.smooth_sigmas_qLineEdit.setText(smooth_sigma_list_json) else: msg += 'There was an error setting the Smooth Sigmas value.\n' self.warning_label.setText(msg) try: self.sampling_rate_spinBox.setValue( float(self.dict["sampling_rate"])) except ValueError: msg += 'There was an error setting the Sampling Rate value.\n' self.warning_label.setText(msg) try: self.interp_order_spinbox.setValue(int(self.dict["final_interp"])) except ValueError: msg += 'There was an error setting the Final Interp value.\n' self.warning_label.setText(msg) try: self.no_of_iterations_spinBox.setValue( int(self.dict["number_of_iterations"])) except ValueError: msg += 'There was an error setting the Number of iterations ' \ 'value.\n' self.warning_label.setText(msg) try: self.default_number_spinBox.setValue( int(self.dict["default_value"])) except ValueError: msg += 'There was an error setting the Default Number' self.warning_label.setText(msg) def get_patients_info(self): """ Retrieve the patient's study description of the fixed image and for the moving image (if it exists). """ patient_dict_container = PatientDictContainer() if not patient_dict_container.is_empty(): filename = patient_dict_container.filepaths[0] dicom_tree_slice = DicomTree(filename) dict_tree = dicom_tree_slice.dict try: self.fixed_image = dict_tree["Series Instance UID"][0] except: self.fixed_image = "" self.warning_label.setText( 'Couldn\'t find the series instance ' 'UID for the Fixed Image.') moving_dict_container = MovingDictContainer() if not moving_dict_container.is_empty(): filename = moving_dict_container.filepaths[0] dicom_tree_slice = DicomTree(filename) dict_tree = dicom_tree_slice.dict try: self.moving_image = dict_tree["Series Instance UID"][0] except: self.moving_image = "" self.warning_label.setText( 'Couldn\'t find the series instance ' 'UID for the Moving Image.') if moving_dict_container.is_empty() and self.moving_image != "": self.moving_image = "" self.fixed_image_placeholder.setText(str(self.fixed_image)) self.moving_image_placeholder.setText(str(self.moving_image)) def get_values_from_UI(self): """ Sets values from the GUI to the dict that will be used to store the relevant parameters to imageFusion.json. """ self.dict["reg_method"] = str(self.reg_method_comboBox.currentText()) self.dict["metric"] = str(self.metric_comboBox.currentText()) self.dict["optimiser"] = str(self.optimiser_comboBox.currentText()) a_string = self.shrink_factor_qLineEdit.text().split(",") a_int = list(map(int, a_string)) self.dict["shrink_factors"] = a_int a_string = self.smooth_sigmas_qLineEdit.text().split(",") a_int = list(map(int, a_string)) self.dict["smooth_sigmas"] = a_int self.dict["sampling_rate"] = self.sampling_rate_spinBox.value() self.dict["final_interp"] = self.interp_order_spinbox.value() self.dict[ "number_of_iterations"] = self.no_of_iterations_spinBox.value() self.dict["default_value"] = self.default_number_spinBox.value() return self.dict def check_parameter(self): """ Check the number of values of the smooth sigma and shrink factors of that are parameters used for images fusion. """ len_smooth_sigmas = len(self.dict["smooth_sigmas"]) len_shrink_factor = len(self.dict["shrink_factors"]) if len_smooth_sigmas != len_shrink_factor: raise ValueError def set_fast_mode(self): """These settings are customised to be fast for images fusion.""" self.reg_method_comboBox.setCurrentIndex(1) self.metric_comboBox.setCurrentIndex(1) self.optimiser_comboBox.setCurrentIndex(1) self.shrink_factor_qLineEdit.setText("8") self.smooth_sigmas_qLineEdit.setText("10") self.sampling_rate_spinBox.setValue(0.25) self.interp_order_spinbox.setValue(2) self.no_of_iterations_spinBox.setValue(50) self.default_number_spinBox.setValue(-1000)
class Ui_TaxWidget(object): def setupUi(self, TaxWidget): if not TaxWidget.objectName(): TaxWidget.setObjectName(u"TaxWidget") TaxWidget.resize(696, 408) self.gridLayout = QGridLayout(TaxWidget) self.gridLayout.setObjectName(u"gridLayout") self.AccountLbl = QLabel(TaxWidget) self.AccountLbl.setObjectName(u"AccountLbl") self.gridLayout.addWidget(self.AccountLbl, 1, 0, 1, 1) self.AccountWidget = AccountSelector(TaxWidget) self.AccountWidget.setObjectName(u"AccountWidget") self.gridLayout.addWidget(self.AccountWidget, 1, 1, 1, 2) self.YearLbl = QLabel(TaxWidget) self.YearLbl.setObjectName(u"YearLbl") self.gridLayout.addWidget(self.YearLbl, 0, 0, 1, 1) self.Year = QSpinBox(TaxWidget) self.Year.setObjectName(u"Year") self.Year.setAlignment(Qt.AlignRight|Qt.AlignTrailing|Qt.AlignVCenter) self.Year.setMinimum(2010) self.Year.setMaximum(2030) self.Year.setValue(2020) self.gridLayout.addWidget(self.Year, 0, 1, 1, 2) self.verticalSpacer = QSpacerItem(20, 52, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.verticalSpacer, 8, 0, 1, 1) self.line = QFrame(TaxWidget) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.gridLayout.addWidget(self.line, 3, 0, 1, 3) self.DlsgGroup = QGroupBox(TaxWidget) self.DlsgGroup.setObjectName(u"DlsgGroup") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.DlsgGroup.sizePolicy().hasHeightForWidth()) self.DlsgGroup.setSizePolicy(sizePolicy) self.DlsgGroup.setFlat(False) self.DlsgGroup.setCheckable(True) self.DlsgGroup.setChecked(False) self.gridLayout_2 = QGridLayout(self.DlsgGroup) self.gridLayout_2.setSpacing(2) self.gridLayout_2.setObjectName(u"gridLayout_2") self.gridLayout_2.setContentsMargins(6, 6, 6, 6) self.DlsgFileLbl = QLabel(self.DlsgGroup) self.DlsgFileLbl.setObjectName(u"DlsgFileLbl") self.gridLayout_2.addWidget(self.DlsgFileLbl, 0, 0, 1, 1) self.IncomeSourceBroker = QCheckBox(self.DlsgGroup) self.IncomeSourceBroker.setObjectName(u"IncomeSourceBroker") self.IncomeSourceBroker.setChecked(True) self.gridLayout_2.addWidget(self.IncomeSourceBroker, 1, 0, 1, 3) self.DividendsOnly = QCheckBox(self.DlsgGroup) self.DividendsOnly.setObjectName(u"DividendsOnly") self.gridLayout_2.addWidget(self.DividendsOnly, 2, 0, 1, 3) self.DlsgSelectBtn = QPushButton(self.DlsgGroup) self.DlsgSelectBtn.setObjectName(u"DlsgSelectBtn") self.gridLayout_2.addWidget(self.DlsgSelectBtn, 0, 2, 1, 1) self.DlsgFileName = QLineEdit(self.DlsgGroup) self.DlsgFileName.setObjectName(u"DlsgFileName") self.gridLayout_2.addWidget(self.DlsgFileName, 0, 1, 1, 1) self.gridLayout.addWidget(self.DlsgGroup, 5, 0, 1, 3) self.XlsFileLbl = QLabel(TaxWidget) self.XlsFileLbl.setObjectName(u"XlsFileLbl") self.gridLayout.addWidget(self.XlsFileLbl, 2, 0, 1, 1) self.XlsFileName = QLineEdit(TaxWidget) self.XlsFileName.setObjectName(u"XlsFileName") sizePolicy1 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.XlsFileName.sizePolicy().hasHeightForWidth()) self.XlsFileName.setSizePolicy(sizePolicy1) self.gridLayout.addWidget(self.XlsFileName, 2, 1, 1, 1) self.XlsSelectBtn = QPushButton(TaxWidget) self.XlsSelectBtn.setObjectName(u"XlsSelectBtn") sizePolicy2 = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth(self.XlsSelectBtn.sizePolicy().hasHeightForWidth()) self.XlsSelectBtn.setSizePolicy(sizePolicy2) self.gridLayout.addWidget(self.XlsSelectBtn, 2, 2, 1, 1) self.horizontalSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.horizontalSpacer, 5, 3, 1, 1) self.NoSettlement = QCheckBox(TaxWidget) self.NoSettlement.setObjectName(u"NoSettlement") self.gridLayout.addWidget(self.NoSettlement, 6, 0, 1, 4) self.SaveButton = QPushButton(TaxWidget) self.SaveButton.setObjectName(u"SaveButton") self.gridLayout.addWidget(self.SaveButton, 7, 2, 1, 1) self.WarningLbl = QLabel(TaxWidget) self.WarningLbl.setObjectName(u"WarningLbl") font = QFont() font.setItalic(True) self.WarningLbl.setFont(font) self.gridLayout.addWidget(self.WarningLbl, 4, 0, 1, 3) self.retranslateUi(TaxWidget) QMetaObject.connectSlotsByName(TaxWidget) # setupUi def retranslateUi(self, TaxWidget): TaxWidget.setWindowTitle(QCoreApplication.translate("TaxWidget", u"Taxes", None)) self.AccountLbl.setText(QCoreApplication.translate("TaxWidget", u"Account:", None)) #if QT_CONFIG(tooltip) self.AccountWidget.setToolTip(QCoreApplication.translate("TaxWidget", u"Foreign account to prepare tax report for", None)) #endif // QT_CONFIG(tooltip) self.YearLbl.setText(QCoreApplication.translate("TaxWidget", u"Year:", None)) self.Year.setSuffix("") self.DlsgGroup.setTitle(QCoreApplication.translate("TaxWidget", u"Create tax form in \"\u0414\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\" program format (*.dcX)", None)) self.DlsgFileLbl.setText(QCoreApplication.translate("TaxWidget", u"Output file:", None)) self.IncomeSourceBroker.setText(QCoreApplication.translate("TaxWidget", u"Use broker name as income source", None)) self.DividendsOnly.setText(QCoreApplication.translate("TaxWidget", u"Update only information about dividends", None)) #if QT_CONFIG(tooltip) self.DlsgSelectBtn.setToolTip(QCoreApplication.translate("TaxWidget", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.DlsgSelectBtn.setText(QCoreApplication.translate("TaxWidget", u" ... ", None)) #if QT_CONFIG(tooltip) self.DlsgFileName.setToolTip(QCoreApplication.translate("TaxWidget", u"File where to store russian tax form", None)) #endif // QT_CONFIG(tooltip) self.XlsFileLbl.setText(QCoreApplication.translate("TaxWidget", u"Excel file:", None)) #if QT_CONFIG(tooltip) self.XlsFileName.setToolTip(QCoreApplication.translate("TaxWidget", u"File where to store tax report in Excel format", None)) #endif // QT_CONFIG(tooltip) #if QT_CONFIG(tooltip) self.XlsSelectBtn.setToolTip(QCoreApplication.translate("TaxWidget", u"Select file", None)) #endif // QT_CONFIG(tooltip) self.XlsSelectBtn.setText(QCoreApplication.translate("TaxWidget", u"...", None)) self.NoSettlement.setText(QCoreApplication.translate("TaxWidget", u"Do not use settlement date for currency rates", None)) self.SaveButton.setText(QCoreApplication.translate("TaxWidget", u"Save Report", None)) self.WarningLbl.setText(QCoreApplication.translate("TaxWidget", u"Below functions are experimental - use it with care", None))
class PomoTimer(QWidget, BaseTimer): """ PomoTimer: Pomodoro タイマーを提供する。 1 pomodoro: 25min short break: 5min long break: 15min long break after 4pomodoro. """ paused = Signal() def __init__(self): super().__init__() self.simple_timer = SimpleTimer(self) self.settings = { 'pomo': 25, 'short_break': 5, 'long_break': 15, 'long_break_after': 4 } self.state_dict = { 'work': 'Work!', 'break': 'Break.', 'pause': 'Pause', 'wait': "Let's start." } self.work_timer = QTimer(self) self.work_timer.setSingleShot(True) self.break_timer = QTimer(self) self.break_timer.setSingleShot(True) self.pomo_count = 0 self.pomo_count_lbl = QLabel(self) self.pomo_count_lbl.setText(f'{self.pomo_count} pomodoro finished.') self.state_lbl = QLabel(self) self.state_lbl.setText(self.state_dict['wait']) self.estimate_pomo = 0 self.estimate_label = QLabel(self) self.estimate_label.setText('Estimate: ') self.estimate_pomo_widget = QSpinBox(self) self.estimate_pomo_widget.setValue(4) self.estimate_pomo_widget.setSuffix(' pomo') self.estimate_pomo_widget.setRange(1, 20) self.set_ui() self.set_connection() def set_ui(self): layout = self.simple_timer.layout() i = layout.indexOf(self.simple_timer.timer_edit) layout.takeAt(i) hlayout = QHBoxLayout() hlayout.addWidget(self.estimate_label) hlayout.addWidget(self.estimate_pomo_widget) vlayout = QVBoxLayout() vlayout.addLayout(hlayout) vlayout.addWidget(self.pomo_count_lbl) vlayout.addWidget(self.state_lbl) vlayout.addWidget(self.simple_timer) self.setLayout(vlayout) def set_connection(self): self.work_timer.timeout.connect(self.timeout) self.break_timer.timeout.connect(self.start_work) def start(self): self.estimate_pomo = self.estimate_pomo_widget.value() self.start_work() def start_work(self): """ Start timer for working on the task. :return: """ self.state_lbl.setText(self.state_dict['work']) self.simple_timer.timer = self.work_timer self.simple_timer.timer_edit.setValue(self.settings['pomo']) self.simple_timer.start() self.started.emit() def start_break(self): """ Start timer for working on the rest. Short break is normal break, long break comes every some tasks(default 4). :return: """ self.state_lbl.setText(self.state_dict['break']) self.simple_timer.timer = self.break_timer if self.pomo_count % self.settings['long_break_after']: self.simple_timer.timer_edit.setValue(self.settings['short_break']) else: self.simple_timer.timer_edit.setValue(self.settings['long_break']) self.simple_timer.start() self.started.emit() def abort(self): self.reset() self.aborted.emit() def pause(self): self.state_lbl.setText(self.state_dict['pause']) self.simple_timer.pause() self.paused.emit() def resume(self): self.state_lbl.setText(self.state_dict['work']) self.simple_timer.resume() self.started.emit() def timeout(self): self.pomo_count += 1 if self.pomo_count >= self.estimate_pomo: self.reset() self.finished.emit() else: self.start_break() def reset(self): self.pomo_count = 0 self.simple_timer.reset() self.work_timer.stop() self.break_timer.stop() self.state_lbl.setText(self.state_dict['wait']) def get_notify_message(self): return '' @property def name(self): return 'Pomo Timer' def fake_start(self): self.simple_timer.setting_time = self.simple_timer.timer_edit.value() self.simple_timer.timer.start(self.simple_timer.setting_time * 1000) self.simple_timer.set_remain_update() self.simple_timer.started.emit()
class Ui_Dialog(object): def setupUi(self, Dialog): if not Dialog.objectName(): Dialog.setObjectName(u"Dialog") Dialog.resize(688, 530) Dialog.setMinimumSize(QSize(600, 0)) Dialog.setMaximumSize(QSize(1000000, 16777215)) self.verticalLayout = QVBoxLayout(Dialog) self.verticalLayout.setObjectName(u"verticalLayout") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.verticalFrame = QFrame(Dialog) self.verticalFrame.setObjectName(u"verticalFrame") self.verticalFrame.setMaximumSize(QSize(250, 16777215)) self.verticalLayout_2 = QVBoxLayout(self.verticalFrame) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.label = QLabel(self.verticalFrame) self.label.setObjectName(u"label") self.verticalLayout_2.addWidget(self.label) self.treeWidget = QTreeWidget(self.verticalFrame) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) QTreeWidgetItem(self.treeWidget) self.treeWidget.setObjectName(u"treeWidget") font = QFont() font.setFamilies([u"Segoe UI"]) font.setPointSize(10) self.treeWidget.setFont(font) self.treeWidget.setFrameShape(QFrame.VLine) self.treeWidget.setFrameShadow(QFrame.Plain) self.treeWidget.setTabKeyNavigation(True) self.treeWidget.setAlternatingRowColors(False) self.verticalLayout_2.addWidget(self.treeWidget) self.horizontalLayout.addWidget(self.verticalFrame) self.line = QFrame(Dialog) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.VLine) self.line.setFrameShadow(QFrame.Sunken) self.horizontalLayout.addWidget(self.line) self.stackedWidget = QStackedWidget(Dialog) self.stackedWidget.setObjectName(u"stackedWidget") self.page = QWidget() self.page.setObjectName(u"page") self.verticalLayout_3 = QVBoxLayout(self.page) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.groupBox = QGroupBox(self.page) self.groupBox.setObjectName(u"groupBox") self.formLayout_4 = QFormLayout(self.groupBox) self.formLayout_4.setObjectName(u"formLayout_4") self.label_2 = QLabel(self.groupBox) self.label_2.setObjectName(u"label_2") self.formLayout_4.setWidget(0, QFormLayout.LabelRole, self.label_2) self.comboBox = QComboBox(self.groupBox) self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.addItem("") self.comboBox.setObjectName(u"comboBox") self.formLayout_4.setWidget(0, QFormLayout.FieldRole, self.comboBox) self.verticalLayout_3.addWidget(self.groupBox) self.groupBox_2 = QGroupBox(self.page) self.groupBox_2.setObjectName(u"groupBox_2") self.formLayout_3 = QFormLayout(self.groupBox_2) self.formLayout_3.setObjectName(u"formLayout_3") self.label_3 = QLabel(self.groupBox_2) self.label_3.setObjectName(u"label_3") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_3) self.spinBox = QSpinBox(self.groupBox_2) self.spinBox.setObjectName(u"spinBox") self.spinBox.setValue(11) self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.spinBox) self.label_4 = QLabel(self.groupBox_2) self.label_4.setObjectName(u"label_4") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4) self.fontComboBox = QFontComboBox(self.groupBox_2) self.fontComboBox.setObjectName(u"fontComboBox") self.formLayout_3.setWidget(0, QFormLayout.FieldRole, self.fontComboBox) self.verticalLayout_3.addWidget(self.groupBox_2) self.stackedWidget.addWidget(self.page) self.page_2 = QWidget() self.page_2.setObjectName(u"page_2") self.verticalLayout_5 = QVBoxLayout(self.page_2) self.verticalLayout_5.setObjectName(u"verticalLayout_5") self.verticalLayout_4 = QVBoxLayout() self.verticalLayout_4.setObjectName(u"verticalLayout_4") self.verticalLayout_5.addLayout(self.verticalLayout_4) self.stackedWidget.addWidget(self.page_2) self.horizontalLayout.addWidget(self.stackedWidget) self.verticalLayout.addLayout(self.horizontalLayout) self.buttonBox = QDialogButtonBox(Dialog) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Apply | QDialogButtonBox.Close | QDialogButtonBox.Save) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) self.buttonBox.accepted.connect(Dialog.accept) self.buttonBox.rejected.connect(Dialog.reject) self.stackedWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(Dialog) # setupUi def retranslateUi(self, Dialog): Dialog.setWindowTitle( QCoreApplication.translate("Dialog", u"Dialog", None)) self.label.setText( QCoreApplication.translate("Dialog", u"Preferences", None)) ___qtreewidgetitem = self.treeWidget.headerItem() ___qtreewidgetitem.setText( 0, QCoreApplication.translate("Dialog", u"General", None)) __sortingEnabled = self.treeWidget.isSortingEnabled() self.treeWidget.setSortingEnabled(False) ___qtreewidgetitem1 = self.treeWidget.topLevelItem(0) ___qtreewidgetitem1.setText( 0, QCoreApplication.translate("Dialog", u"Appearance", None)) ___qtreewidgetitem2 = self.treeWidget.topLevelItem(1) ___qtreewidgetitem2.setText( 0, QCoreApplication.translate("Dialog", u"Behavior", None)) ___qtreewidgetitem3 = self.treeWidget.topLevelItem(2) ___qtreewidgetitem3.setText( 0, QCoreApplication.translate("Dialog", u"Advanced", None)) self.treeWidget.setSortingEnabled(__sortingEnabled) self.groupBox.setTitle( QCoreApplication.translate("Dialog", u"Theme", None)) self.label_2.setText( QCoreApplication.translate("Dialog", u"Window style", None)) self.comboBox.setItemText( 0, QCoreApplication.translate("Dialog", u"Native", None)) self.comboBox.setItemText( 1, QCoreApplication.translate("Dialog", u"Fusion", None)) self.comboBox.setItemText( 2, QCoreApplication.translate("Dialog", u"Fusion dark", None)) self.groupBox_2.setTitle( QCoreApplication.translate("Dialog", u"Accessibility", None)) self.label_3.setText( QCoreApplication.translate("Dialog", u"Font size", None)) self.label_4.setText( QCoreApplication.translate("Dialog", u"Font", None))
class Ui_Config(object): def setupUi(self, Config): if not Config.objectName(): Config.setObjectName(u"Config") Config.resize(600, 650) Config.setSizeGripEnabled(True) self.vboxLayout = QVBoxLayout(Config) self.vboxLayout.setSpacing(6) self.vboxLayout.setContentsMargins(11, 11, 11, 11) self.vboxLayout.setObjectName(u"vboxLayout") self.vboxLayout.setContentsMargins(8, 8, 8, 8) self.hboxLayout = QHBoxLayout() self.hboxLayout.setSpacing(6) self.hboxLayout.setObjectName(u"hboxLayout") self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.ButtonGroup1 = QGroupBox(Config) self.ButtonGroup1.setObjectName(u"ButtonGroup1") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ButtonGroup1.sizePolicy().hasHeightForWidth()) self.ButtonGroup1.setSizePolicy(sizePolicy) self.vboxLayout1 = QVBoxLayout(self.ButtonGroup1) self.vboxLayout1.setSpacing(6) self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.vboxLayout1.setObjectName(u"vboxLayout1") self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.size_176_220 = QRadioButton(self.ButtonGroup1) self.size_176_220.setObjectName(u"size_176_220") self.vboxLayout1.addWidget(self.size_176_220) self.size_240_320 = QRadioButton(self.ButtonGroup1) self.size_240_320.setObjectName(u"size_240_320") self.vboxLayout1.addWidget(self.size_240_320) self.size_320_240 = QRadioButton(self.ButtonGroup1) self.size_320_240.setObjectName(u"size_320_240") self.vboxLayout1.addWidget(self.size_320_240) self.size_640_480 = QRadioButton(self.ButtonGroup1) self.size_640_480.setObjectName(u"size_640_480") self.vboxLayout1.addWidget(self.size_640_480) self.size_800_600 = QRadioButton(self.ButtonGroup1) self.size_800_600.setObjectName(u"size_800_600") self.vboxLayout1.addWidget(self.size_800_600) self.size_1024_768 = QRadioButton(self.ButtonGroup1) self.size_1024_768.setObjectName(u"size_1024_768") self.vboxLayout1.addWidget(self.size_1024_768) self.hboxLayout1 = QHBoxLayout() self.hboxLayout1.setSpacing(6) self.hboxLayout1.setObjectName(u"hboxLayout1") self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.size_custom = QRadioButton(self.ButtonGroup1) self.size_custom.setObjectName(u"size_custom") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.size_custom.sizePolicy().hasHeightForWidth()) self.size_custom.setSizePolicy(sizePolicy1) self.hboxLayout1.addWidget(self.size_custom) self.size_width = QSpinBox(self.ButtonGroup1) self.size_width.setObjectName(u"size_width") self.size_width.setMinimum(1) self.size_width.setMaximum(1280) self.size_width.setSingleStep(16) self.size_width.setValue(400) self.hboxLayout1.addWidget(self.size_width) self.size_height = QSpinBox(self.ButtonGroup1) self.size_height.setObjectName(u"size_height") self.size_height.setMinimum(1) self.size_height.setMaximum(1024) self.size_height.setSingleStep(16) self.size_height.setValue(300) self.hboxLayout1.addWidget(self.size_height) self.vboxLayout1.addLayout(self.hboxLayout1) self.hboxLayout.addWidget(self.ButtonGroup1) self.ButtonGroup2 = QGroupBox(Config) self.ButtonGroup2.setObjectName(u"ButtonGroup2") self.vboxLayout2 = QVBoxLayout(self.ButtonGroup2) self.vboxLayout2.setSpacing(6) self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.vboxLayout2.setObjectName(u"vboxLayout2") self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.depth_1 = QRadioButton(self.ButtonGroup2) self.depth_1.setObjectName(u"depth_1") self.vboxLayout2.addWidget(self.depth_1) self.depth_4gray = QRadioButton(self.ButtonGroup2) self.depth_4gray.setObjectName(u"depth_4gray") self.vboxLayout2.addWidget(self.depth_4gray) self.depth_8 = QRadioButton(self.ButtonGroup2) self.depth_8.setObjectName(u"depth_8") self.vboxLayout2.addWidget(self.depth_8) self.depth_12 = QRadioButton(self.ButtonGroup2) self.depth_12.setObjectName(u"depth_12") self.vboxLayout2.addWidget(self.depth_12) self.depth_15 = QRadioButton(self.ButtonGroup2) self.depth_15.setObjectName(u"depth_15") self.vboxLayout2.addWidget(self.depth_15) self.depth_16 = QRadioButton(self.ButtonGroup2) self.depth_16.setObjectName(u"depth_16") self.vboxLayout2.addWidget(self.depth_16) self.depth_18 = QRadioButton(self.ButtonGroup2) self.depth_18.setObjectName(u"depth_18") self.vboxLayout2.addWidget(self.depth_18) self.depth_24 = QRadioButton(self.ButtonGroup2) self.depth_24.setObjectName(u"depth_24") self.vboxLayout2.addWidget(self.depth_24) self.depth_32 = QRadioButton(self.ButtonGroup2) self.depth_32.setObjectName(u"depth_32") self.vboxLayout2.addWidget(self.depth_32) self.depth_32_argb = QRadioButton(self.ButtonGroup2) self.depth_32_argb.setObjectName(u"depth_32_argb") self.vboxLayout2.addWidget(self.depth_32_argb) self.hboxLayout.addWidget(self.ButtonGroup2) self.vboxLayout.addLayout(self.hboxLayout) self.hboxLayout2 = QHBoxLayout() self.hboxLayout2.setSpacing(6) self.hboxLayout2.setObjectName(u"hboxLayout2") self.hboxLayout2.setContentsMargins(0, 0, 0, 0) self.TextLabel1_3 = QLabel(Config) self.TextLabel1_3.setObjectName(u"TextLabel1_3") self.hboxLayout2.addWidget(self.TextLabel1_3) self.skin = QComboBox(Config) self.skin.addItem("") self.skin.setObjectName(u"skin") sizePolicy2 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.skin.sizePolicy().hasHeightForWidth()) self.skin.setSizePolicy(sizePolicy2) self.hboxLayout2.addWidget(self.skin) self.vboxLayout.addLayout(self.hboxLayout2) self.touchScreen = QCheckBox(Config) self.touchScreen.setObjectName(u"touchScreen") self.vboxLayout.addWidget(self.touchScreen) self.lcdScreen = QCheckBox(Config) self.lcdScreen.setObjectName(u"lcdScreen") self.vboxLayout.addWidget(self.lcdScreen) self.spacerItem = QSpacerItem(20, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) self.vboxLayout.addItem(self.spacerItem) self.TextLabel1 = QLabel(Config) self.TextLabel1.setObjectName(u"TextLabel1") sizePolicy.setHeightForWidth( self.TextLabel1.sizePolicy().hasHeightForWidth()) self.TextLabel1.setSizePolicy(sizePolicy) self.TextLabel1.setWordWrap(True) self.vboxLayout.addWidget(self.TextLabel1) self.GroupBox1 = QGroupBox(Config) self.GroupBox1.setObjectName(u"GroupBox1") self.gridLayout = QGridLayout(self.GroupBox1) self.gridLayout.setSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setHorizontalSpacing(6) self.gridLayout.setVerticalSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.TextLabel3 = QLabel(self.GroupBox1) self.TextLabel3.setObjectName(u"TextLabel3") self.gridLayout.addWidget(self.TextLabel3, 6, 0, 1, 1) self.bslider = QSlider(self.GroupBox1) self.bslider.setObjectName(u"bslider") palette = QPalette() brush = QBrush(QColor(128, 128, 128, 255)) brush.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.WindowText, brush) brush1 = QBrush(QColor(0, 0, 255, 255)) brush1.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Button, brush1) brush2 = QBrush(QColor(127, 127, 255, 255)) brush2.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Light, brush2) brush3 = QBrush(QColor(38, 38, 255, 255)) brush3.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Midlight, brush3) brush4 = QBrush(QColor(0, 0, 127, 255)) brush4.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Dark, brush4) brush5 = QBrush(QColor(0, 0, 170, 255)) brush5.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Mid, brush5) brush6 = QBrush(QColor(0, 0, 0, 255)) brush6.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Text, brush6) brush7 = QBrush(QColor(255, 255, 255, 255)) brush7.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette.setBrush(QPalette.Active, QPalette.Base, brush7) brush8 = QBrush(QColor(220, 220, 220, 255)) brush8.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Window, brush8) palette.setBrush(QPalette.Active, QPalette.Shadow, brush6) brush9 = QBrush(QColor(10, 95, 137, 255)) brush9.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Active, QPalette.Link, brush6) palette.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) brush10 = QBrush(QColor(232, 232, 232, 255)) brush10.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette.setBrush(QPalette.Inactive, QPalette.Button, brush1) palette.setBrush(QPalette.Inactive, QPalette.Light, brush2) palette.setBrush(QPalette.Inactive, QPalette.Midlight, brush3) palette.setBrush(QPalette.Inactive, QPalette.Dark, brush4) palette.setBrush(QPalette.Inactive, QPalette.Mid, brush5) palette.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette.setBrush(QPalette.Disabled, QPalette.Button, brush1) palette.setBrush(QPalette.Disabled, QPalette.Light, brush2) palette.setBrush(QPalette.Disabled, QPalette.Midlight, brush3) palette.setBrush(QPalette.Disabled, QPalette.Dark, brush4) palette.setBrush(QPalette.Disabled, QPalette.Mid, brush5) palette.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.bslider.setPalette(palette) self.bslider.setMaximum(400) self.bslider.setValue(100) self.bslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.bslider, 6, 1, 1, 1) self.blabel = QLabel(self.GroupBox1) self.blabel.setObjectName(u"blabel") self.gridLayout.addWidget(self.blabel, 6, 2, 1, 1) self.TextLabel2 = QLabel(self.GroupBox1) self.TextLabel2.setObjectName(u"TextLabel2") self.gridLayout.addWidget(self.TextLabel2, 4, 0, 1, 1) self.gslider = QSlider(self.GroupBox1) self.gslider.setObjectName(u"gslider") palette1 = QPalette() palette1.setBrush(QPalette.Active, QPalette.WindowText, brush) brush11 = QBrush(QColor(0, 255, 0, 255)) brush11.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Button, brush11) brush12 = QBrush(QColor(127, 255, 127, 255)) brush12.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Light, brush12) brush13 = QBrush(QColor(38, 255, 38, 255)) brush13.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Midlight, brush13) brush14 = QBrush(QColor(0, 127, 0, 255)) brush14.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Dark, brush14) brush15 = QBrush(QColor(0, 170, 0, 255)) brush15.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Mid, brush15) palette1.setBrush(QPalette.Active, QPalette.Text, brush6) palette1.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Active, QPalette.Base, brush7) palette1.setBrush(QPalette.Active, QPalette.Window, brush8) palette1.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Active, QPalette.Link, brush6) palette1.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Button, brush11) palette1.setBrush(QPalette.Inactive, QPalette.Light, brush12) palette1.setBrush(QPalette.Inactive, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Inactive, QPalette.Dark, brush14) palette1.setBrush(QPalette.Inactive, QPalette.Mid, brush15) palette1.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette1.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette1.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette1.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Button, brush11) palette1.setBrush(QPalette.Disabled, QPalette.Light, brush12) palette1.setBrush(QPalette.Disabled, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Disabled, QPalette.Dark, brush14) palette1.setBrush(QPalette.Disabled, QPalette.Mid, brush15) palette1.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette1.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette1.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette1.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gslider.setPalette(palette1) self.gslider.setMaximum(400) self.gslider.setValue(100) self.gslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gslider, 4, 1, 1, 1) self.glabel = QLabel(self.GroupBox1) self.glabel.setObjectName(u"glabel") self.gridLayout.addWidget(self.glabel, 4, 2, 1, 1) self.TextLabel7 = QLabel(self.GroupBox1) self.TextLabel7.setObjectName(u"TextLabel7") self.gridLayout.addWidget(self.TextLabel7, 0, 0, 1, 1) self.TextLabel8 = QLabel(self.GroupBox1) self.TextLabel8.setObjectName(u"TextLabel8") self.gridLayout.addWidget(self.TextLabel8, 0, 2, 1, 1) self.gammaslider = QSlider(self.GroupBox1) self.gammaslider.setObjectName(u"gammaslider") palette2 = QPalette() palette2.setBrush(QPalette.Active, QPalette.WindowText, brush) palette2.setBrush(QPalette.Active, QPalette.Button, brush7) palette2.setBrush(QPalette.Active, QPalette.Light, brush7) palette2.setBrush(QPalette.Active, QPalette.Midlight, brush7) brush16 = QBrush(QColor(127, 127, 127, 255)) brush16.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Dark, brush16) brush17 = QBrush(QColor(170, 170, 170, 255)) brush17.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Mid, brush17) palette2.setBrush(QPalette.Active, QPalette.Text, brush6) palette2.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Active, QPalette.Base, brush7) palette2.setBrush(QPalette.Active, QPalette.Window, brush8) palette2.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Active, QPalette.Link, brush6) palette2.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Button, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Light, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Dark, brush16) palette2.setBrush(QPalette.Inactive, QPalette.Mid, brush17) palette2.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette2.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette2.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette2.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Button, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Light, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Dark, brush16) palette2.setBrush(QPalette.Disabled, QPalette.Mid, brush17) palette2.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette2.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette2.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette2.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gammaslider.setPalette(palette2) self.gammaslider.setMaximum(400) self.gammaslider.setValue(100) self.gammaslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gammaslider, 0, 1, 1, 1) self.TextLabel1_2 = QLabel(self.GroupBox1) self.TextLabel1_2.setObjectName(u"TextLabel1_2") self.gridLayout.addWidget(self.TextLabel1_2, 2, 0, 1, 1) self.rlabel = QLabel(self.GroupBox1) self.rlabel.setObjectName(u"rlabel") self.gridLayout.addWidget(self.rlabel, 2, 2, 1, 1) self.rslider = QSlider(self.GroupBox1) self.rslider.setObjectName(u"rslider") palette3 = QPalette() palette3.setBrush(QPalette.Active, QPalette.WindowText, brush) brush18 = QBrush(QColor(255, 0, 0, 255)) brush18.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Button, brush18) brush19 = QBrush(QColor(255, 127, 127, 255)) brush19.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Light, brush19) brush20 = QBrush(QColor(255, 38, 38, 255)) brush20.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Midlight, brush20) brush21 = QBrush(QColor(127, 0, 0, 255)) brush21.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Dark, brush21) brush22 = QBrush(QColor(170, 0, 0, 255)) brush22.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Mid, brush22) palette3.setBrush(QPalette.Active, QPalette.Text, brush6) palette3.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Active, QPalette.Base, brush7) palette3.setBrush(QPalette.Active, QPalette.Window, brush8) palette3.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Active, QPalette.Link, brush6) palette3.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Button, brush18) palette3.setBrush(QPalette.Inactive, QPalette.Light, brush19) palette3.setBrush(QPalette.Inactive, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Inactive, QPalette.Dark, brush21) palette3.setBrush(QPalette.Inactive, QPalette.Mid, brush22) palette3.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette3.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette3.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette3.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Button, brush18) palette3.setBrush(QPalette.Disabled, QPalette.Light, brush19) palette3.setBrush(QPalette.Disabled, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Disabled, QPalette.Dark, brush21) palette3.setBrush(QPalette.Disabled, QPalette.Mid, brush22) palette3.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette3.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette3.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette3.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.rslider.setPalette(palette3) self.rslider.setMaximum(400) self.rslider.setValue(100) self.rslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.rslider, 2, 1, 1, 1) self.PushButton3 = QPushButton(self.GroupBox1) self.PushButton3.setObjectName(u"PushButton3") self.gridLayout.addWidget(self.PushButton3, 8, 0, 1, 3) self.MyCustomWidget1 = GammaView(self.GroupBox1) self.MyCustomWidget1.setObjectName(u"MyCustomWidget1") self.gridLayout.addWidget(self.MyCustomWidget1, 0, 3, 9, 1) self.vboxLayout.addWidget(self.GroupBox1) self.hboxLayout3 = QHBoxLayout() self.hboxLayout3.setSpacing(6) self.hboxLayout3.setObjectName(u"hboxLayout3") self.hboxLayout3.setContentsMargins(0, 0, 0, 0) self.spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.hboxLayout3.addItem(self.spacerItem1) self.buttonOk = QPushButton(Config) self.buttonOk.setObjectName(u"buttonOk") self.buttonOk.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonOk) self.buttonCancel = QPushButton(Config) self.buttonCancel.setObjectName(u"buttonCancel") self.buttonCancel.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonCancel) self.vboxLayout.addLayout(self.hboxLayout3) self.retranslateUi(Config) self.size_width.valueChanged.connect(self.size_custom.click) self.size_height.valueChanged.connect(self.size_custom.click) self.buttonOk.setDefault(True) QMetaObject.connectSlotsByName(Config) # setupUi def retranslateUi(self, Config): Config.setWindowTitle( QCoreApplication.translate("Config", u"Configure", None)) self.ButtonGroup1.setTitle( QCoreApplication.translate("Config", u"Size", None)) self.size_176_220.setText( QCoreApplication.translate("Config", u"176x220 \"SmartPhone\"", None)) self.size_240_320.setText( QCoreApplication.translate("Config", u"240x320 \"PDA\"", None)) self.size_320_240.setText( QCoreApplication.translate("Config", u"320x240 \"TV\" / \"QVGA\"", None)) self.size_640_480.setText( QCoreApplication.translate("Config", u"640x480 \"VGA\"", None)) self.size_800_600.setText( QCoreApplication.translate("Config", u"800x600", None)) self.size_1024_768.setText( QCoreApplication.translate("Config", u"1024x768", None)) self.size_custom.setText( QCoreApplication.translate("Config", u"Custom", None)) self.ButtonGroup2.setTitle( QCoreApplication.translate("Config", u"Depth", None)) self.depth_1.setText( QCoreApplication.translate("Config", u"1 bit monochrome", None)) self.depth_4gray.setText( QCoreApplication.translate("Config", u"4 bit grayscale", None)) self.depth_8.setText( QCoreApplication.translate("Config", u"8 bit", None)) self.depth_12.setText( QCoreApplication.translate("Config", u"12 (16) bit", None)) self.depth_15.setText( QCoreApplication.translate("Config", u"15 bit", None)) self.depth_16.setText( QCoreApplication.translate("Config", u"16 bit", None)) self.depth_18.setText( QCoreApplication.translate("Config", u"18 bit", None)) self.depth_24.setText( QCoreApplication.translate("Config", u"24 bit", None)) self.depth_32.setText( QCoreApplication.translate("Config", u"32 bit", None)) self.depth_32_argb.setText( QCoreApplication.translate("Config", u"32 bit ARGB", None)) self.TextLabel1_3.setText( QCoreApplication.translate("Config", u"Skin", None)) self.skin.setItemText( 0, QCoreApplication.translate("Config", u"None", None)) self.touchScreen.setText( QCoreApplication.translate( "Config", u"Emulate touch screen (no mouse move)", None)) self.lcdScreen.setText( QCoreApplication.translate( "Config", u"Emulate LCD screen (Only with fixed zoom of 3.0 times magnification)", None)) self.TextLabel1.setText( QCoreApplication.translate( "Config", u"<p>Note that any applications using the virtual framebuffer will be terminated if you change the Size or Depth <i>above</i>. You may freely modify the Gamma <i>below</i>.", None)) self.GroupBox1.setTitle( QCoreApplication.translate("Config", u"Gamma", None)) self.TextLabel3.setText( QCoreApplication.translate("Config", u"Blue", None)) self.blabel.setText(QCoreApplication.translate("Config", u"1.0", None)) self.TextLabel2.setText( QCoreApplication.translate("Config", u"Green", None)) self.glabel.setText(QCoreApplication.translate("Config", u"1.0", None)) self.TextLabel7.setText( QCoreApplication.translate("Config", u"All", None)) self.TextLabel8.setText( QCoreApplication.translate("Config", u"1.0", None)) self.TextLabel1_2.setText( QCoreApplication.translate("Config", u"Red", None)) self.rlabel.setText(QCoreApplication.translate("Config", u"1.0", None)) self.PushButton3.setText( QCoreApplication.translate("Config", u"Set all to 1.0", None)) self.buttonOk.setText( QCoreApplication.translate("Config", u"&OK", None)) self.buttonCancel.setText( QCoreApplication.translate("Config", u"&Cancel", None))
class Ui_Form(object): def setupUi(self, insertTab): if not insertTab.objectName(): insertTab.setObjectName(u"insertTab") self.formLayout_3 = QFormLayout(insertTab) self.formLayout_3.setObjectName(u"formLayout_3") self.formLayout_3.setVerticalSpacing(40) self.formLayout_3.setContentsMargins(-1, 40, -1, -1) self.label_32 = QLabel(insertTab) self.label_32.setObjectName(u"label_32") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_32) self.horizontalLayout_20 = QHBoxLayout() self.horizontalLayout_20.setObjectName(u"horizontalLayout_20") self.insertImgPath = QLineEdit(insertTab) self.insertImgPath.setObjectName(u"insertImgPath") self.horizontalLayout_20.addWidget(self.insertImgPath) self.insertBrowseImgBtn = QPushButton(insertTab) self.insertBrowseImgBtn.setObjectName(u"insertBrowseImgBtn") self.horizontalLayout_20.addWidget(self.insertBrowseImgBtn) self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_20) self.label_13 = QLabel(insertTab) self.label_13.setObjectName(u"label_13") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_13) self.horizontalLayout_18 = QHBoxLayout() self.horizontalLayout_18.setObjectName(u"horizontalLayout_18") self.label_26 = QLabel(insertTab) self.label_26.setObjectName(u"label_26") self.label_26.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_26) self.insertFgX = QSpinBox(insertTab) self.insertFgX.setObjectName(u"insertFgX") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.insertFgX.sizePolicy().hasHeightForWidth()) self.insertFgX.setSizePolicy(sizePolicy) self.insertFgX.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgX) self.label_29 = QLabel(insertTab) self.label_29.setObjectName(u"label_29") self.label_29.setAlignment(Qt.AlignCenter) self.horizontalLayout_18.addWidget(self.label_29) self.insertFgY = QSpinBox(insertTab) self.insertFgY.setObjectName(u"insertFgY") self.insertFgY.setMaximum(10000000) self.horizontalLayout_18.addWidget(self.insertFgY) self.formLayout_3.setLayout(1, QFormLayout.FieldRole, self.horizontalLayout_18) self.label_12 = QLabel(insertTab) self.label_12.setObjectName(u"label_12") self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_12) self.horizontalLayout_21 = QHBoxLayout() self.horizontalLayout_21.setObjectName(u"horizontalLayout_21") self.label_33 = QLabel(insertTab) self.label_33.setObjectName(u"label_33") self.label_33.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_33) self.insertFgW = QSpinBox(insertTab) self.insertFgW.setObjectName(u"insertFgW") self.insertFgW.setBaseSize(QSize(1920, 0)) self.insertFgW.setMaximum(1000000) self.insertFgW.setValue(1920) self.horizontalLayout_21.addWidget(self.insertFgW) self.label_34 = QLabel(insertTab) self.label_34.setObjectName(u"label_34") self.label_34.setAlignment(Qt.AlignCenter) self.horizontalLayout_21.addWidget(self.label_34) self.insertFgH = QSpinBox(insertTab) self.insertFgH.setObjectName(u"insertFgH") self.insertFgH.setMaximum(1000000000) self.insertFgH.setValue(1080) self.horizontalLayout_21.addWidget(self.insertFgH) self.formLayout_3.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_21) self.retranslateUi(insertTab) QMetaObject.connectSlotsByName(insertTab) # setupUi def retranslateUi(self, insertTab): self.label_32.setText( QCoreApplication.translate("Form", u"Image to paste", None)) self.insertBrowseImgBtn.setText( QCoreApplication.translate("Form", u"Browse", None)) self.label_13.setText( QCoreApplication.translate("Form", u"Coords of image on assets", None)) self.label_26.setText(QCoreApplication.translate("Form", u"X", None)) self.label_29.setText(QCoreApplication.translate("Form", u"Y", None)) self.label_12.setText( QCoreApplication.translate("Form", u"Dimensions of image on assets", None)) self.label_33.setText( QCoreApplication.translate("Form", u"Width", None)) self.label_34.setText( QCoreApplication.translate("Form", u"Height", None)) pass
class Ui_PaymentDlg(object): def setupUi(self, PaymentDlg): if not PaymentDlg.objectName(): PaymentDlg.setObjectName(u"PaymentDlg") PaymentDlg.resize(399, 276) self.gridLayout = QGridLayout(PaymentDlg) # ifndef Q_OS_MAC self.gridLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout.setObjectName(u"gridLayout") self.buttonBox = QDialogButtonBox(PaymentDlg) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.NoButton | QDialogButtonBox.Ok) self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 1) self.spacerItem = QSpacerItem(381, 16, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.spacerItem, 2, 0, 1, 1) self.tabWidget = QTabWidget(PaymentDlg) self.tabWidget.setObjectName(u"tabWidget") self.tab = QWidget() self.tab.setObjectName(u"tab") self.hboxLayout = QHBoxLayout(self.tab) # ifndef Q_OS_MAC self.hboxLayout.setSpacing(6) # endif # ifndef Q_OS_MAC self.hboxLayout.setContentsMargins(9, 9, 9, 9) # endif self.hboxLayout.setObjectName(u"hboxLayout") self.paidCheckBox = QCheckBox(self.tab) self.paidCheckBox.setObjectName(u"paidCheckBox") self.hboxLayout.addWidget(self.paidCheckBox) self.tabWidget.addTab(self.tab, "") self.tab_2 = QWidget() self.tab_2.setObjectName(u"tab_2") self.gridLayout1 = QGridLayout(self.tab_2) # ifndef Q_OS_MAC self.gridLayout1.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout1.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout1.setObjectName(u"gridLayout1") self.sortCodeLineEdit = QLineEdit(self.tab_2) self.sortCodeLineEdit.setObjectName(u"sortCodeLineEdit") self.gridLayout1.addWidget(self.sortCodeLineEdit, 1, 3, 1, 1) self.label_8 = QLabel(self.tab_2) self.label_8.setObjectName(u"label_8") self.gridLayout1.addWidget(self.label_8, 1, 2, 1, 1) self.bankLineEdit = QLineEdit(self.tab_2) self.bankLineEdit.setObjectName(u"bankLineEdit") self.gridLayout1.addWidget(self.bankLineEdit, 0, 3, 1, 1) self.label_7 = QLabel(self.tab_2) self.label_7.setObjectName(u"label_7") self.gridLayout1.addWidget(self.label_7, 0, 2, 1, 1) self.accountNumLineEdit = QLineEdit(self.tab_2) self.accountNumLineEdit.setObjectName(u"accountNumLineEdit") self.gridLayout1.addWidget(self.accountNumLineEdit, 1, 1, 1, 1) self.label_6 = QLabel(self.tab_2) self.label_6.setObjectName(u"label_6") self.gridLayout1.addWidget(self.label_6, 1, 0, 1, 1) self.checkNumLineEdit = QLineEdit(self.tab_2) self.checkNumLineEdit.setObjectName(u"checkNumLineEdit") self.gridLayout1.addWidget(self.checkNumLineEdit, 0, 1, 1, 1) self.label_2 = QLabel(self.tab_2) self.label_2.setObjectName(u"label_2") self.gridLayout1.addWidget(self.label_2, 0, 0, 1, 1) self.tabWidget.addTab(self.tab_2, "") self.tab_3 = QWidget() self.tab_3.setObjectName(u"tab_3") self.gridLayout2 = QGridLayout(self.tab_3) # ifndef Q_OS_MAC self.gridLayout2.setSpacing(6) # endif # ifndef Q_OS_MAC self.gridLayout2.setContentsMargins(9, 9, 9, 9) # endif self.gridLayout2.setObjectName(u"gridLayout2") self.creditCardLineEdit = QLineEdit(self.tab_3) self.creditCardLineEdit.setObjectName(u"creditCardLineEdit") self.gridLayout2.addWidget(self.creditCardLineEdit, 0, 1, 1, 3) self.label_11 = QLabel(self.tab_3) self.label_11.setObjectName(u"label_11") self.gridLayout2.addWidget(self.label_11, 0, 0, 1, 1) self.expiryDateEdit = QDateEdit(self.tab_3) self.expiryDateEdit.setObjectName(u"expiryDateEdit") self.expiryDateEdit.setAlignment(Qt.AlignRight) self.gridLayout2.addWidget(self.expiryDateEdit, 1, 3, 1, 1) self.label_10 = QLabel(self.tab_3) self.label_10.setObjectName(u"label_10") self.gridLayout2.addWidget(self.label_10, 1, 2, 1, 1) self.validFromDateEdit = QDateEdit(self.tab_3) self.validFromDateEdit.setObjectName(u"validFromDateEdit") self.validFromDateEdit.setAlignment(Qt.AlignRight) self.gridLayout2.addWidget(self.validFromDateEdit, 1, 1, 1, 1) self.label_9 = QLabel(self.tab_3) self.label_9.setObjectName(u"label_9") self.gridLayout2.addWidget(self.label_9, 1, 0, 1, 1) self.tabWidget.addTab(self.tab_3, "") self.gridLayout.addWidget(self.tabWidget, 1, 0, 1, 1) self.gridLayout3 = QGridLayout() # ifndef Q_OS_MAC self.gridLayout3.setSpacing(6) # endif self.gridLayout3.setContentsMargins(0, 0, 0, 0) self.gridLayout3.setObjectName(u"gridLayout3") self.label_3 = QLabel(PaymentDlg) self.label_3.setObjectName(u"label_3") self.gridLayout3.addWidget(self.label_3, 0, 2, 1, 1) self.amountSpinBox = QDoubleSpinBox(PaymentDlg) self.amountSpinBox.setObjectName(u"amountSpinBox") self.amountSpinBox.setAlignment(Qt.AlignRight) self.amountSpinBox.setMaximum(999999.000000000000000) self.gridLayout3.addWidget(self.amountSpinBox, 1, 3, 1, 1) self.label = QLabel(PaymentDlg) self.label.setObjectName(u"label") self.gridLayout3.addWidget(self.label, 0, 0, 1, 1) self.label_5 = QLabel(PaymentDlg) self.label_5.setObjectName(u"label_5") self.gridLayout3.addWidget(self.label_5, 1, 0, 1, 1) self.surnameLineEdit = QLineEdit(PaymentDlg) self.surnameLineEdit.setObjectName(u"surnameLineEdit") self.gridLayout3.addWidget(self.surnameLineEdit, 0, 3, 1, 1) self.forenameLineEdit = QLineEdit(PaymentDlg) self.forenameLineEdit.setObjectName(u"forenameLineEdit") self.gridLayout3.addWidget(self.forenameLineEdit, 0, 1, 1, 1) self.label_4 = QLabel(PaymentDlg) self.label_4.setObjectName(u"label_4") self.gridLayout3.addWidget(self.label_4, 1, 2, 1, 1) self.invoiceNumSpinBox = QSpinBox(PaymentDlg) self.invoiceNumSpinBox.setObjectName(u"invoiceNumSpinBox") self.invoiceNumSpinBox.setAlignment(Qt.AlignRight) self.invoiceNumSpinBox.setMaximum(999999999) self.invoiceNumSpinBox.setMinimum(1000000) self.invoiceNumSpinBox.setValue(1000000) self.gridLayout3.addWidget(self.invoiceNumSpinBox, 1, 1, 1, 1) self.gridLayout.addLayout(self.gridLayout3, 0, 0, 1, 1) # if QT_CONFIG(shortcut) self.label_8.setBuddy(self.sortCodeLineEdit) self.label_7.setBuddy(self.bankLineEdit) self.label_6.setBuddy(self.accountNumLineEdit) self.label_2.setBuddy(self.checkNumLineEdit) self.label_11.setBuddy(self.creditCardLineEdit) self.label_10.setBuddy(self.expiryDateEdit) self.label_9.setBuddy(self.validFromDateEdit) self.label_3.setBuddy(self.surnameLineEdit) self.label.setBuddy(self.forenameLineEdit) self.label_5.setBuddy(self.invoiceNumSpinBox) self.label_4.setBuddy(self.amountSpinBox) # endif // QT_CONFIG(shortcut) QWidget.setTabOrder(self.forenameLineEdit, self.surnameLineEdit) QWidget.setTabOrder(self.surnameLineEdit, self.invoiceNumSpinBox) QWidget.setTabOrder(self.invoiceNumSpinBox, self.amountSpinBox) QWidget.setTabOrder(self.amountSpinBox, self.tabWidget) QWidget.setTabOrder(self.tabWidget, self.paidCheckBox) QWidget.setTabOrder(self.paidCheckBox, self.checkNumLineEdit) QWidget.setTabOrder(self.checkNumLineEdit, self.accountNumLineEdit) QWidget.setTabOrder(self.accountNumLineEdit, self.bankLineEdit) QWidget.setTabOrder(self.bankLineEdit, self.sortCodeLineEdit) QWidget.setTabOrder(self.sortCodeLineEdit, self.creditCardLineEdit) QWidget.setTabOrder(self.creditCardLineEdit, self.validFromDateEdit) QWidget.setTabOrder(self.validFromDateEdit, self.expiryDateEdit) self.retranslateUi(PaymentDlg) self.buttonBox.accepted.connect(PaymentDlg.accept) self.buttonBox.rejected.connect(PaymentDlg.reject) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(PaymentDlg) # setupUi def retranslateUi(self, PaymentDlg): PaymentDlg.setWindowTitle( QCoreApplication.translate("PaymentDlg", u"Payment Form", None)) self.paidCheckBox.setText( QCoreApplication.translate("PaymentDlg", u"&Paid", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QCoreApplication.translate("PaymentDlg", u"Cas&h", None), ) self.label_8.setText( QCoreApplication.translate("PaymentDlg", u"S&ort Code:", None)) self.label_7.setText( QCoreApplication.translate("PaymentDlg", u"&Bank:", None)) self.label_6.setText( QCoreApplication.translate("PaymentDlg", u"A&ccount No.:", None)) self.label_2.setText( QCoreApplication.translate("PaymentDlg", u"Check &No.:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_2), QCoreApplication.translate("PaymentDlg", u"Chec&k", None), ) self.label_11.setText( QCoreApplication.translate("PaymentDlg", u"&Number:", None)) self.expiryDateEdit.setDisplayFormat( QCoreApplication.translate("PaymentDlg", u"MMM yyyy", None)) self.label_10.setText( QCoreApplication.translate("PaymentDlg", u"E&xpiry Date", None)) self.validFromDateEdit.setDisplayFormat( QCoreApplication.translate("PaymentDlg", u"MMM yyyy", None)) self.label_9.setText( QCoreApplication.translate("PaymentDlg", u"&Valid From:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab_3), QCoreApplication.translate("PaymentDlg", u"Credit Car&d", None), ) self.label_3.setText( QCoreApplication.translate("PaymentDlg", u"&Surname:", None)) self.amountSpinBox.setPrefix( QCoreApplication.translate("PaymentDlg", u"$ ", None)) self.label.setText( QCoreApplication.translate("PaymentDlg", u"&Forename:", None)) self.label_5.setText( QCoreApplication.translate("PaymentDlg", u"&Invoice No.:", None)) self.label_4.setText( QCoreApplication.translate("PaymentDlg", u"&Amount:", None))
class SimpleTimer(QWidget, BaseTimer): paused = Signal() def __init__(self, parent=None): super().__init__(parent) self.timer = QTimer(self) self.timer.setSingleShot(True) self.update_timer = QTimer(self) self.setting_time = 0 self.remaining = 0 self.remain_label = QLabel('00:00', self) self.remain_label.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.remain_label.setScaledContents(True) font = QFont() font.setPointSize(86) self.remain_label.setFont(font) self.timer_edit = QSpinBox(self) self.timer_edit.setRange(1, 99) self.timer_edit.setValue(25) self.set_ui() self.set_connection() self.show() def set_ui(self): vlayout = QVBoxLayout() vlayout.addWidget(self.remain_label, alignment=Qt.AlignHCenter) vlayout.addWidget(self.timer_edit) self.setLayout(vlayout) def set_connection(self): self.timer.timeout.connect(self.stop) self.update_timer.timeout.connect(self.remain_update) def start(self): self.setting_time = self.timer_edit.value() self.timer.start(self.setting_time * 60 * 1000) self.set_remain_update() self.started.emit() def set_remain_update(self): self.remain_update() self.update_timer.start(250) def stop(self): self.reset() self.finished.emit() def abort(self): self.reset() self.timer.stop() self.aborted.emit() def pause(self): self.update_timer.stop() self.remaining = self.timer.remainingTime() self.timer.stop() self.paused.emit() def resume(self): self.timer.start(self.remaining) self.set_remain_update() self.started.emit() def reset(self): self.timer.stop() self.update_timer.stop() self.remain_label.setText('00:00') self.remaining = 0 def get_notify_message(self): remaining = self.timer.remainingTime() / 1000 return '{0} minutes have passed.'.format(self.setting_time - int(remaining/60)) def remain_update(self): remaining = self.timer.remainingTime() / 1000 self.remain_label.setText('{min:02}:{sec:02}'.format( min=int(remaining / 60), sec=int(remaining % 60))) @property def name(self): return 'Simple Timer'
class Ui_EditRenderPreset_UI(object): def setupUi(self, EditRenderPreset_UI): if not EditRenderPreset_UI.objectName(): EditRenderPreset_UI.setObjectName(u"EditRenderPreset_UI") EditRenderPreset_UI.resize(463, 630) self.verticalLayout_2 = QVBoxLayout(EditRenderPreset_UI) self.verticalLayout_2.setObjectName(u"verticalLayout_2") self.mainBox = QHBoxLayout() self.mainBox.setObjectName(u"mainBox") self.formLayout_6 = QFormLayout() self.formLayout_6.setObjectName(u"formLayout_6") self.formLayout_6.setContentsMargins(-1, 20, 10, -1) self.groupLabel = QLabel(EditRenderPreset_UI) self.groupLabel.setObjectName(u"groupLabel") self.formLayout_6.setWidget(0, QFormLayout.LabelRole, self.groupLabel) self.presetNameLabel = QLabel(EditRenderPreset_UI) self.presetNameLabel.setObjectName(u"presetNameLabel") self.formLayout_6.setWidget(1, QFormLayout.LabelRole, self.presetNameLabel) self.preset_name = QLineEdit(EditRenderPreset_UI) self.preset_name.setObjectName(u"preset_name") self.formLayout_6.setWidget(1, QFormLayout.FieldRole, self.preset_name) self.label_2 = QLabel(EditRenderPreset_UI) self.label_2.setObjectName(u"label_2") self.formLayout_6.setWidget(2, QFormLayout.LabelRole, self.label_2) self.formatCombo = QComboBox(EditRenderPreset_UI) self.formatCombo.setObjectName(u"formatCombo") self.formLayout_6.setWidget(2, QFormLayout.FieldRole, self.formatCombo) self.tabWidget = QTabWidget(EditRenderPreset_UI) self.tabWidget.setObjectName(u"tabWidget") self.video_tab = QWidget() self.video_tab.setObjectName(u"video_tab") self.verticalLayout_3 = QVBoxLayout(self.video_tab) self.verticalLayout_3.setObjectName(u"verticalLayout_3") self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.scrollArea = QScrollArea(self.video_tab) self.scrollArea.setObjectName(u"scrollArea") sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.scrollArea.sizePolicy().hasHeightForWidth()) self.scrollArea.setSizePolicy(sizePolicy) self.scrollArea.setFrameShape(QFrame.NoFrame) self.scrollArea.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.scrollAreaWidgetContents = QWidget() self.scrollAreaWidgetContents.setObjectName( u"scrollAreaWidgetContents") self.scrollAreaWidgetContents.setGeometry(QRect(0, 0, 428, 650)) self.formLayout_3 = QFormLayout(self.scrollAreaWidgetContents) self.formLayout_3.setObjectName(u"formLayout_3") self.formLayout_3.setContentsMargins(-1, -1, 40, -1) self.label_4 = QLabel(self.scrollAreaWidgetContents) self.label_4.setObjectName(u"label_4") self.formLayout_3.setWidget(0, QFormLayout.LabelRole, self.label_4) self.horizontalLayout_3 = QHBoxLayout() self.horizontalLayout_3.setObjectName(u"horizontalLayout_3") self.resWidth = QSpinBox(self.scrollAreaWidgetContents) self.resWidth.setObjectName(u"resWidth") self.resWidth.setMinimum(1) self.resWidth.setMaximum(8192) self.resWidth.setSingleStep(2) self.resWidth.setValue(1) self.horizontalLayout_3.addWidget(self.resWidth) self.label_9 = QLabel(self.scrollAreaWidgetContents) self.label_9.setObjectName(u"label_9") self.label_9.setMinimumSize(QSize(10, 0)) self.label_9.setText(u"x") self.label_9.setAlignment(Qt.AlignCenter) self.horizontalLayout_3.addWidget(self.label_9) self.resHeight = QSpinBox(self.scrollAreaWidgetContents) self.resHeight.setObjectName(u"resHeight") self.resHeight.setMinimum(1) self.resHeight.setMaximum(8192) self.resHeight.setSingleStep(2) self.horizontalLayout_3.addWidget(self.resHeight) self.linkResoultion = QToolButton(self.scrollAreaWidgetContents) self.linkResoultion.setObjectName(u"linkResoultion") icon = QIcon() iconThemeName = u"link" if QIcon.hasThemeIcon(iconThemeName): icon = QIcon.fromTheme(iconThemeName) else: icon.addFile(u".", QSize(), QIcon.Normal, QIcon.Off) self.linkResoultion.setIcon(icon) self.linkResoultion.setCheckable(True) self.linkResoultion.setAutoRaise(True) self.horizontalLayout_3.addWidget(self.linkResoultion) self.formLayout_3.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_3) self.label_6 = QLabel(self.scrollAreaWidgetContents) self.label_6.setObjectName(u"label_6") self.formLayout_3.setWidget(1, QFormLayout.LabelRole, self.label_6) self.parCombo = QComboBox(self.scrollAreaWidgetContents) self.parCombo.setObjectName(u"parCombo") self.parCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_3.setWidget(1, QFormLayout.FieldRole, self.parCombo) self.label_16 = QLabel(self.scrollAreaWidgetContents) self.label_16.setObjectName(u"label_16") self.formLayout_3.setWidget(2, QFormLayout.LabelRole, self.label_16) self.horizontalLayout_4 = QHBoxLayout() self.horizontalLayout_4.setObjectName(u"horizontalLayout_4") self.displayAspectNum = QSpinBox(self.scrollAreaWidgetContents) self.displayAspectNum.setObjectName(u"displayAspectNum") self.displayAspectNum.setMinimum(1) self.displayAspectNum.setMaximum(8192) self.horizontalLayout_4.addWidget(self.displayAspectNum) self.label_17 = QLabel(self.scrollAreaWidgetContents) self.label_17.setObjectName(u"label_17") self.label_17.setMinimumSize(QSize(10, 0)) self.label_17.setText(u":") self.label_17.setAlignment(Qt.AlignCenter) self.horizontalLayout_4.addWidget(self.label_17) self.displayAspectDen = QSpinBox(self.scrollAreaWidgetContents) self.displayAspectDen.setObjectName(u"displayAspectDen") self.displayAspectDen.setMinimum(1) self.displayAspectDen.setMaximum(8192) self.horizontalLayout_4.addWidget(self.displayAspectDen) self.formLayout_3.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_4) self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.framerateNum = QSpinBox(self.scrollAreaWidgetContents) self.framerateNum.setObjectName(u"framerateNum") self.framerateNum.setMinimum(1) self.framerateNum.setMaximum(1000000) self.horizontalLayout.addWidget(self.framerateNum) self.label_8 = QLabel(self.scrollAreaWidgetContents) self.label_8.setObjectName(u"label_8") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.label_8.sizePolicy().hasHeightForWidth()) self.label_8.setSizePolicy(sizePolicy1) self.label_8.setMinimumSize(QSize(10, 0)) self.label_8.setText(u"/") self.label_8.setAlignment(Qt.AlignCenter) self.horizontalLayout.addWidget(self.label_8) self.framerateDen = QSpinBox(self.scrollAreaWidgetContents) self.framerateDen.setObjectName(u"framerateDen") self.framerateDen.setMinimum(1) self.framerateDen.setMaximum(9999) self.horizontalLayout.addWidget(self.framerateDen) self.formLayout_3.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout) self.label_3 = QLabel(self.scrollAreaWidgetContents) self.label_3.setObjectName(u"label_3") self.formLayout_3.setWidget(3, QFormLayout.LabelRole, self.label_3) self.label_22 = QLabel(self.scrollAreaWidgetContents) self.label_22.setObjectName(u"label_22") self.formLayout_3.setWidget(4, QFormLayout.LabelRole, self.label_22) self.frameRateDisplay = QLabel(self.scrollAreaWidgetContents) self.frameRateDisplay.setObjectName(u"frameRateDisplay") self.frameRateDisplay.setEnabled(True) self.formLayout_3.setWidget(4, QFormLayout.FieldRole, self.frameRateDisplay) self.label_7 = QLabel(self.scrollAreaWidgetContents) self.label_7.setObjectName(u"label_7") self.formLayout_3.setWidget(5, QFormLayout.LabelRole, self.label_7) self.scanningCombo = QComboBox(self.scrollAreaWidgetContents) self.scanningCombo.addItem("") self.scanningCombo.addItem("") self.scanningCombo.setObjectName(u"scanningCombo") self.formLayout_3.setWidget(5, QFormLayout.FieldRole, self.scanningCombo) self.fieldOrderLabel = QLabel(self.scrollAreaWidgetContents) self.fieldOrderLabel.setObjectName(u"fieldOrderLabel") self.formLayout_3.setWidget(6, QFormLayout.LabelRole, self.fieldOrderLabel) self.fieldOrderCombo = QComboBox(self.scrollAreaWidgetContents) self.fieldOrderCombo.addItem("") self.fieldOrderCombo.addItem("") self.fieldOrderCombo.setObjectName(u"fieldOrderCombo") self.fieldOrderCombo.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_3.setWidget(6, QFormLayout.FieldRole, self.fieldOrderCombo) self.colorspaceLabel = QLabel(self.scrollAreaWidgetContents) self.colorspaceLabel.setObjectName(u"colorspaceLabel") self.colorspaceLabel.setEnabled(False) self.formLayout_3.setWidget(7, QFormLayout.LabelRole, self.colorspaceLabel) self.colorspaceCombo = QComboBox(self.scrollAreaWidgetContents) self.colorspaceCombo.setObjectName(u"colorspaceCombo") self.colorspaceCombo.setEnabled(False) self.formLayout_3.setWidget(7, QFormLayout.FieldRole, self.colorspaceCombo) self.vCodecCombo = QComboBox(self.scrollAreaWidgetContents) self.vCodecCombo.setObjectName(u"vCodecCombo") sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.vCodecCombo.sizePolicy().hasHeightForWidth()) self.vCodecCombo.setSizePolicy(sizePolicy2) self.formLayout_3.setWidget(8, QFormLayout.FieldRole, self.vCodecCombo) self.vRateControlCombo = QComboBox(self.scrollAreaWidgetContents) self.vRateControlCombo.setObjectName(u"vRateControlCombo") sizePolicy2.setHeightForWidth( self.vRateControlCombo.sizePolicy().hasHeightForWidth()) self.vRateControlCombo.setSizePolicy(sizePolicy2) self.formLayout_3.setWidget(9, QFormLayout.FieldRole, self.vRateControlCombo) self.label_24 = QLabel(self.scrollAreaWidgetContents) self.label_24.setObjectName(u"label_24") self.formLayout_3.setWidget(8, QFormLayout.LabelRole, self.label_24) self.label_12 = QLabel(self.scrollAreaWidgetContents) self.label_12.setObjectName(u"label_12") self.formLayout_3.setWidget(9, QFormLayout.LabelRole, self.label_12) self.default_vbitrate_label = QLabel(self.scrollAreaWidgetContents) self.default_vbitrate_label.setObjectName(u"default_vbitrate_label") self.formLayout_3.setWidget(10, QFormLayout.LabelRole, self.default_vbitrate_label) self.default_vbitrate = QSpinBox(self.scrollAreaWidgetContents) self.default_vbitrate.setObjectName(u"default_vbitrate") self.default_vbitrate.setMaximum(500000) self.formLayout_3.setWidget(10, QFormLayout.FieldRole, self.default_vbitrate) self.vBuffer_label = QLabel(self.scrollAreaWidgetContents) self.vBuffer_label.setObjectName(u"vBuffer_label") self.formLayout_3.setWidget(11, QFormLayout.LabelRole, self.vBuffer_label) self.vBuffer = QSpinBox(self.scrollAreaWidgetContents) self.vBuffer.setObjectName(u"vBuffer") self.vBuffer.setMaximum(9999) self.formLayout_3.setWidget(11, QFormLayout.FieldRole, self.vBuffer) self.vquality_label = QLabel(self.scrollAreaWidgetContents) self.vquality_label.setObjectName(u"vquality_label") self.formLayout_3.setWidget(12, QFormLayout.LabelRole, self.vquality_label) self.default_vquality = QSpinBox(self.scrollAreaWidgetContents) self.default_vquality.setObjectName(u"default_vquality") self.default_vquality.setMaximum(500000) self.formLayout_3.setWidget(12, QFormLayout.FieldRole, self.default_vquality) self.label_26 = QLabel(self.scrollAreaWidgetContents) self.label_26.setObjectName(u"label_26") self.formLayout_3.setWidget(13, QFormLayout.LabelRole, self.label_26) self.gopSpinner = QSpinBox(self.scrollAreaWidgetContents) self.gopSpinner.setObjectName(u"gopSpinner") self.gopSpinner.setMaximum(999) self.gopSpinner.setSingleStep(1) self.formLayout_3.setWidget(13, QFormLayout.FieldRole, self.gopSpinner) self.fixedGop = QCheckBox(self.scrollAreaWidgetContents) self.fixedGop.setObjectName(u"fixedGop") self.fixedGop.setEnabled(False) self.formLayout_3.setWidget(14, QFormLayout.FieldRole, self.fixedGop) self.bFramesSpinner = QSpinBox(self.scrollAreaWidgetContents) self.bFramesSpinner.setObjectName(u"bFramesSpinner") self.bFramesSpinner.setEnabled(False) self.bFramesSpinner.setMinimum(-1) self.bFramesSpinner.setMaximum(8) self.bFramesSpinner.setValue(-1) self.formLayout_3.setWidget(15, QFormLayout.FieldRole, self.bFramesSpinner) self.bFramesLabel = QLabel(self.scrollAreaWidgetContents) self.bFramesLabel.setObjectName(u"bFramesLabel") self.formLayout_3.setWidget(15, QFormLayout.LabelRole, self.bFramesLabel) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout_3.addWidget(self.scrollArea) self.tabWidget.addTab(self.video_tab, "") self.audio_tab = QWidget() self.audio_tab.setObjectName(u"audio_tab") self.formLayout_2 = QFormLayout(self.audio_tab) self.formLayout_2.setObjectName(u"formLayout_2") self.label_15 = QLabel(self.audio_tab) self.label_15.setObjectName(u"label_15") self.formLayout_2.setWidget(0, QFormLayout.LabelRole, self.label_15) self.audioChannels = QComboBox(self.audio_tab) self.audioChannels.setObjectName(u"audioChannels") self.formLayout_2.setWidget(0, QFormLayout.FieldRole, self.audioChannels) self.label_13 = QLabel(self.audio_tab) self.label_13.setObjectName(u"label_13") self.formLayout_2.setWidget(1, QFormLayout.LabelRole, self.label_13) self.aCodecCombo = QComboBox(self.audio_tab) self.aCodecCombo.setObjectName(u"aCodecCombo") self.formLayout_2.setWidget(1, QFormLayout.FieldRole, self.aCodecCombo) self.label_11 = QLabel(self.audio_tab) self.label_11.setObjectName(u"label_11") self.formLayout_2.setWidget(2, QFormLayout.LabelRole, self.label_11) self.horizontalLayout_5 = QHBoxLayout() self.horizontalLayout_5.setObjectName(u"horizontalLayout_5") self.audioSampleRate = QComboBox(self.audio_tab) self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.addItem("") self.audioSampleRate.setObjectName(u"audioSampleRate") self.audioSampleRate.setEditable(True) self.horizontalLayout_5.addWidget(self.audioSampleRate) self.label_20 = QLabel(self.audio_tab) self.label_20.setObjectName(u"label_20") self.horizontalLayout_5.addWidget(self.label_20) self.formLayout_2.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_5) self.label_14 = QLabel(self.audio_tab) self.label_14.setObjectName(u"label_14") self.formLayout_2.setWidget(3, QFormLayout.LabelRole, self.label_14) self.aRateControlCombo = QComboBox(self.audio_tab) self.aRateControlCombo.setObjectName(u"aRateControlCombo") self.formLayout_2.setWidget(3, QFormLayout.FieldRole, self.aRateControlCombo) self.label_18 = QLabel(self.audio_tab) self.label_18.setObjectName(u"label_18") self.formLayout_2.setWidget(4, QFormLayout.LabelRole, self.label_18) self.aBitrate = QSpinBox(self.audio_tab) self.aBitrate.setObjectName(u"aBitrate") self.aBitrate.setMaximum(500000) self.formLayout_2.setWidget(4, QFormLayout.FieldRole, self.aBitrate) self.label_19 = QLabel(self.audio_tab) self.label_19.setObjectName(u"label_19") self.formLayout_2.setWidget(5, QFormLayout.LabelRole, self.label_19) self.aQuality = QSpinBox(self.audio_tab) self.aQuality.setObjectName(u"aQuality") self.aQuality.setMaximum(500000) self.formLayout_2.setWidget(5, QFormLayout.FieldRole, self.aQuality) self.tabWidget.addTab(self.audio_tab, "") self.tab = QWidget() self.tab.setObjectName(u"tab") self.verticalLayout = QVBoxLayout(self.tab) self.verticalLayout.setObjectName(u"verticalLayout") self.speedsLabel = QLabel(self.tab) self.speedsLabel.setObjectName(u"speedsLabel") self.verticalLayout.addWidget(self.speedsLabel) self.speeds_list = QTextEdit(self.tab) self.speeds_list.setObjectName(u"speeds_list") self.speeds_list.setAcceptRichText(False) self.verticalLayout.addWidget(self.speeds_list) self.label = QLabel(self.tab) self.label.setObjectName(u"label") self.verticalLayout.addWidget(self.label) self.overrideParamsWarning = KMessageWidget(self.tab) self.overrideParamsWarning.setObjectName(u"overrideParamsWarning") self.overrideParamsWarning.setProperty("wordWrap", True) self.overrideParamsWarning.setProperty("closeButtonVisible", False) self.verticalLayout.addWidget(self.overrideParamsWarning) self.additionalParams = QPlainTextEdit(self.tab) self.additionalParams.setObjectName(u"additionalParams") self.verticalLayout.addWidget(self.additionalParams) self.parametersLabel = QLabel(self.tab) self.parametersLabel.setObjectName(u"parametersLabel") self.parametersLabel.setTextFormat(Qt.RichText) self.parametersLabel.setWordWrap(True) self.parametersLabel.setOpenExternalLinks(True) self.verticalLayout.addWidget(self.parametersLabel) self.tabWidget.addTab(self.tab, "") self.formLayout_6.setWidget(4, QFormLayout.SpanningRole, self.tabWidget) self.parameters = QTextEdit(EditRenderPreset_UI) self.parameters.setObjectName(u"parameters") self.parameters.setReadOnly(True) self.parameters.setAcceptRichText(False) self.formLayout_6.setWidget(5, QFormLayout.SpanningRole, self.parameters) self.groupName = QComboBox(EditRenderPreset_UI) self.groupName.setObjectName(u"groupName") sizePolicy2.setHeightForWidth( self.groupName.sizePolicy().hasHeightForWidth()) self.groupName.setSizePolicy(sizePolicy2) self.groupName.setEditable(True) self.groupName.setSizeAdjustPolicy(QComboBox.AdjustToContents) self.formLayout_6.setWidget(0, QFormLayout.FieldRole, self.groupName) self.mainBox.addLayout(self.formLayout_6) self.verticalLayout_2.addLayout(self.mainBox) self.buttonBox = QDialogButtonBox(EditRenderPreset_UI) self.buttonBox.setObjectName(u"buttonBox") self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.verticalLayout_2.addWidget(self.buttonBox) self.retranslateUi(EditRenderPreset_UI) self.buttonBox.rejected.connect(EditRenderPreset_UI.reject) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(EditRenderPreset_UI) # setupUi def retranslateUi(self, EditRenderPreset_UI): EditRenderPreset_UI.setWindowTitle( QCoreApplication.translate("EditRenderPreset_UI", u"Save Render Preset", None)) self.groupLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Group:", None)) self.presetNameLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Preset name:", None)) self.label_2.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Container:", None)) self.label_4.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Resolution:", None)) self.linkResoultion.setText( QCoreApplication.translate("EditRenderPreset_UI", u"...", None)) self.label_6.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Pixel Aspect Ratio:", None)) self.label_16.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Display Aspect Ratio:", None)) self.label_3.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Frame Rate:", None)) self.label_22.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Fields per Second:", None)) self.frameRateDisplay.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Placeholder", None)) self.label_7.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Scanning:", None)) self.scanningCombo.setItemText( 0, QCoreApplication.translate("EditRenderPreset_UI", u"Interlaced", None)) self.scanningCombo.setItemText( 1, QCoreApplication.translate("EditRenderPreset_UI", u"Progressive", None)) self.fieldOrderLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Field Order:", None)) self.fieldOrderCombo.setItemText( 0, QCoreApplication.translate("EditRenderPreset_UI", u"Bottom Field First", None)) self.fieldOrderCombo.setItemText( 1, QCoreApplication.translate("EditRenderPreset_UI", u"Top Field First", None)) self.colorspaceLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Colorspace:", None)) self.label_24.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Codec:", None)) self.label_12.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Rate Control:", None)) self.default_vbitrate_label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Bitrate:", None)) self.default_vbitrate.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u"k", None)) self.vBuffer_label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Buffer Size:", None)) self.vBuffer.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u" KiB", None)) self.vquality_label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Quality:", None)) #if QT_CONFIG(tooltip) self.label_26.setToolTip( QCoreApplication.translate("EditRenderPreset_UI", u"GOP = Group of Pictures", None)) #endif // QT_CONFIG(tooltip) self.label_26.setText( QCoreApplication.translate("EditRenderPreset_UI", u"GOP:", None)) self.gopSpinner.setSpecialValueText( QCoreApplication.translate("EditRenderPreset_UI", u"Auto", None)) self.gopSpinner.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u" frame(s)", None)) #if QT_CONFIG(tooltip) self.fixedGop.setToolTip( QCoreApplication.translate( "EditRenderPreset_UI", u"A fixed GOP means that keyframes will not be inserted at detected scene changes.", None)) #endif // QT_CONFIG(tooltip) self.fixedGop.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Fixed", None)) self.bFramesSpinner.setSpecialValueText( QCoreApplication.translate("EditRenderPreset_UI", u"Auto", None)) self.bFramesSpinner.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u" frame(s)", None)) self.bFramesLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"B Frames:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.video_tab), QCoreApplication.translate("EditRenderPreset_UI", u"Video", None)) self.label_15.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Channels:", None)) self.label_13.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Codec:", None)) self.label_11.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Sample Rate:", None)) self.audioSampleRate.setItemText( 0, QCoreApplication.translate("EditRenderPreset_UI", u"8000", None)) self.audioSampleRate.setItemText( 1, QCoreApplication.translate("EditRenderPreset_UI", u"12000", None)) self.audioSampleRate.setItemText( 2, QCoreApplication.translate("EditRenderPreset_UI", u"16000", None)) self.audioSampleRate.setItemText( 3, QCoreApplication.translate("EditRenderPreset_UI", u"22050", None)) self.audioSampleRate.setItemText( 4, QCoreApplication.translate("EditRenderPreset_UI", u"32000", None)) self.audioSampleRate.setItemText( 5, QCoreApplication.translate("EditRenderPreset_UI", u"44100", None)) self.audioSampleRate.setItemText( 6, QCoreApplication.translate("EditRenderPreset_UI", u"48000", None)) self.audioSampleRate.setItemText( 7, QCoreApplication.translate("EditRenderPreset_UI", u"96000", None)) self.label_20.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Hz", None)) self.label_14.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Rate Control:", None)) self.label_18.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Bitrate:", None)) self.aBitrate.setSuffix( QCoreApplication.translate("EditRenderPreset_UI", u"k", None)) self.label_19.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Quality:", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.audio_tab), QCoreApplication.translate("EditRenderPreset_UI", u"Audio", None)) self.speedsLabel.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Speed options:", None)) #if QT_CONFIG(tooltip) self.speeds_list.setToolTip( QCoreApplication.translate( "EditRenderPreset_UI", u"One line of options per speedup step, from slowest to fastest", None)) #endif // QT_CONFIG(tooltip) self.label.setText( QCoreApplication.translate("EditRenderPreset_UI", u"Additional Parameters:", None)) self.parametersLabel.setText( QCoreApplication.translate( "EditRenderPreset_UI", u"<html><head/><body><p>See <a href=\"https://www.mltframework.org/plugins/ConsumerAvformat/\"><span style=\" text-decoration: underline; color:#2980b9;\">MLT documentation</span></a> for reference.</p></body></html>", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.tab), QCoreApplication.translate("EditRenderPreset_UI", u"Other", None))
class ValveChipItem(WidgetChipItem): def __init__(self, valve: Valve): super().__init__() AppGlobals.Instance().onChipModified.connect(self.CheckForValve) self._valve = valve self.valveToggleButton = QToolButton() self.valveNumberLabel = QLabel("Number") self.valveNumberDial = QSpinBox() self.valveNumberDial.setMinimum(0) self.valveNumberDial.setValue(self._valve.solenoidNumber) self.valveNumberDial.setMaximum(9999) self.valveNumberDial.valueChanged.connect(self.UpdateValve) self.valveNameLabel = QLabel("Name") self.valveNameField = QLineEdit(self._valve.name) self.valveNameField.textChanged.connect(self.UpdateValve) mainLayout = QVBoxLayout() mainLayout.addWidget(self.valveToggleButton, alignment=Qt.AlignCenter) layout = QGridLayout() layout.addWidget(self.valveNameLabel, 0, 0) layout.addWidget(self.valveNameField, 0, 1) layout.addWidget(self.valveNumberLabel, 1, 0) layout.addWidget(self.valveNumberDial, 1, 1) mainLayout.addLayout(layout) self.containerWidget.setLayout(mainLayout) self.valveToggleButton.clicked.connect(self.Toggle) self.Update() self.Move(QPointF()) def CheckForValve(self): if self._valve not in AppGlobals.Chip().valves: self.RemoveItem() def Move(self, delta: QPointF): if delta != QPointF(): AppGlobals.Instance().onChipDataModified.emit() self._valve.position += delta self.GraphicsObject().setPos(self._valve.position) def SetEditDisplay(self, editing: bool): self.valveNameField.setVisible(editing) self.valveNameLabel.setVisible(editing) self.valveNumberLabel.setVisible(editing) self.valveNumberDial.setVisible(editing) super().SetEditDisplay(editing) def UpdateValve(self): self._valve.solenoidNumber = self.valveNumberDial.value() self._valve.name = self.valveNameField.text() AppGlobals.Instance().onChipDataModified.emit() def Toggle(self): AppGlobals.Rig().SetSolenoidState( self._valve.solenoidNumber, not AppGlobals.Rig().GetSolenoidState(self._valve.solenoidNumber), True) def RequestDelete(self): AppGlobals.Chip().valves.remove(self._valve) AppGlobals.Instance().onChipModified.emit() def Duplicate(self) -> 'ChipItem': newValve = Valve() newValve.position = QPointF(self._valve.position) newValve.name = self._valve.name newValve.solenoidNumber = AppGlobals.Chip().NextSolenoidNumber() AppGlobals.Chip().valves.append(newValve) AppGlobals.Instance().onChipModified.emit() return ValveChipItem(newValve) def Update(self): text = self._valve.name + "\n(" + str(self._valve.solenoidNumber) + ")" if text != self.valveToggleButton.text(): self.valveToggleButton.setText(text) lastState = self.valveToggleButton.property("valveState") newState = { True: "OPEN", False: "CLOSED" }[AppGlobals.Rig().GetSolenoidState(self._valve.solenoidNumber)] if lastState != newState: self.valveToggleButton.setProperty("valveState", newState) self.valveToggleButton.setStyle(self.valveToggleButton.style())
class Ui_ConfigCapture_UI(object): def setupUi(self, ConfigCapture_UI): if not ConfigCapture_UI.objectName(): ConfigCapture_UI.setObjectName(u"ConfigCapture_UI") ConfigCapture_UI.resize(525, 520) self.gridLayout_8 = QGridLayout(ConfigCapture_UI) self.gridLayout_8.setObjectName(u"gridLayout_8") self.gridLayout_8.setContentsMargins(0, 0, -1, -1) self.label = QLabel(ConfigCapture_UI) self.label.setObjectName(u"label") self.gridLayout_8.addWidget(self.label, 0, 0, 1, 1) self.kcfg_defaultcapture = QComboBox(ConfigCapture_UI) self.kcfg_defaultcapture.addItem("") self.kcfg_defaultcapture.addItem("") self.kcfg_defaultcapture.setObjectName(u"kcfg_defaultcapture") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.kcfg_defaultcapture.sizePolicy().hasHeightForWidth()) self.kcfg_defaultcapture.setSizePolicy(sizePolicy) self.gridLayout_8.addWidget(self.kcfg_defaultcapture, 0, 1, 1, 1) self.tabWidget = QTabWidget(ConfigCapture_UI) self.tabWidget.setObjectName(u"tabWidget") self.tabWidget.setMinimumSize(QSize(401, 0)) self.ffmpeg_tab = QWidget() self.ffmpeg_tab.setObjectName(u"ffmpeg_tab") self.gridLayout = QGridLayout(self.ffmpeg_tab) self.gridLayout.setObjectName(u"gridLayout") self.line = QFrame(self.ffmpeg_tab) self.line.setObjectName(u"line") self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.gridLayout.addWidget(self.line, 10, 0, 4, 8) self.label_9 = QLabel(self.ffmpeg_tab) self.label_9.setObjectName(u"label_9") self.gridLayout.addWidget(self.label_9, 3, 0, 1, 2) self.kcfg_alsachannels = QSpinBox(self.ffmpeg_tab) self.kcfg_alsachannels.setObjectName(u"kcfg_alsachannels") self.gridLayout.addWidget(self.kcfg_alsachannels, 15, 6, 1, 2) self.label_24 = QLabel(self.ffmpeg_tab) self.label_24.setObjectName(u"label_24") sizePolicy1 = QSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.label_24.sizePolicy().hasHeightForWidth()) self.label_24.setSizePolicy(sizePolicy1) self.gridLayout.addWidget(self.label_24, 18, 0, 1, 2) self.label_4 = QLabel(self.ffmpeg_tab) self.label_4.setObjectName(u"label_4") self.gridLayout.addWidget(self.label_4, 5, 0, 1, 2) self.kcfg_v4l_format = QComboBox(self.ffmpeg_tab) self.kcfg_v4l_format.setObjectName(u"kcfg_v4l_format") self.gridLayout.addWidget(self.kcfg_v4l_format, 3, 3, 1, 5) self.label_11 = QLabel(self.ffmpeg_tab) self.label_11.setObjectName(u"label_11") self.gridLayout.addWidget(self.label_11, 15, 5, 1, 1) self.horizontalSpacer_5 = QSpacerItem(127, 21, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout.addItem(self.horizontalSpacer_5, 9, 3, 1, 2) self.config_v4l = QPushButton(self.ffmpeg_tab) self.config_v4l.setObjectName(u"config_v4l") self.gridLayout.addWidget(self.config_v4l, 9, 5, 1, 3) self.kcfg_v4l_alsadevice = QComboBox(self.ffmpeg_tab) self.kcfg_v4l_alsadevice.setObjectName(u"kcfg_v4l_alsadevice") sizePolicy2 = QSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.kcfg_v4l_alsadevice.sizePolicy().hasHeightForWidth()) self.kcfg_v4l_alsadevice.setSizePolicy(sizePolicy2) self.gridLayout.addWidget(self.kcfg_v4l_alsadevice, 15, 0, 1, 5) self.label_31 = QLabel(self.ffmpeg_tab) self.label_31.setObjectName(u"label_31") self.gridLayout.addWidget(self.label_31, 7, 0, 1, 3) self.p_progressive = QLabel(self.ffmpeg_tab) self.p_progressive.setObjectName(u"p_progressive") self.gridLayout.addWidget(self.p_progressive, 9, 0, 1, 2) self.label_30 = QLabel(self.ffmpeg_tab) self.label_30.setObjectName(u"label_30") self.gridLayout.addWidget(self.label_30, 1, 0, 1, 2) self.label_14 = QLabel(self.ffmpeg_tab) self.label_14.setObjectName(u"label_14") self.gridLayout.addWidget(self.label_14, 2, 0, 1, 2) self.v4l_profile_box = QHBoxLayout() self.v4l_profile_box.setObjectName(u"v4l_profile_box") self.gridLayout.addLayout(self.v4l_profile_box, 18, 3, 1, 5) self.kcfg_detectedv4ldevices = QComboBox(self.ffmpeg_tab) self.kcfg_detectedv4ldevices.setObjectName(u"kcfg_detectedv4ldevices") self.gridLayout.addWidget(self.kcfg_detectedv4ldevices, 1, 3, 1, 5) self.p_aspect = QLabel(self.ffmpeg_tab) self.p_aspect.setObjectName(u"p_aspect") self.gridLayout.addWidget(self.p_aspect, 6, 3, 1, 5) self.label_23 = QLabel(self.ffmpeg_tab) self.label_23.setObjectName(u"label_23") self.gridLayout.addWidget(self.label_23, 6, 0, 1, 2) self.kcfg_v4l_captureaudio = QCheckBox(self.ffmpeg_tab) self.kcfg_v4l_captureaudio.setObjectName(u"kcfg_v4l_captureaudio") self.gridLayout.addWidget(self.kcfg_v4l_captureaudio, 14, 0, 1, 8) self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout.addItem(self.verticalSpacer, 20, 1, 1, 3) self.kcfg_v4l_capturevideo = QCheckBox(self.ffmpeg_tab) self.kcfg_v4l_capturevideo.setObjectName(u"kcfg_v4l_capturevideo") self.gridLayout.addWidget(self.kcfg_v4l_capturevideo, 0, 0, 1, 8) self.label_6 = QLabel(self.ffmpeg_tab) self.label_6.setObjectName(u"label_6") self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1) self.line_2 = QFrame(self.ffmpeg_tab) self.line_2.setObjectName(u"line_2") self.line_2.setFrameShape(QFrame.HLine) self.line_2.setFrameShadow(QFrame.Sunken) self.gridLayout.addWidget(self.line_2, 17, 0, 1, 8) self.label_32 = QLabel(self.ffmpeg_tab) self.label_32.setObjectName(u"label_32") self.gridLayout.addWidget(self.label_32, 8, 0, 1, 2) self.p_size = QLabel(self.ffmpeg_tab) self.p_size.setObjectName(u"p_size") self.gridLayout.addWidget(self.p_size, 4, 3, 1, 5) self.p_display = QLabel(self.ffmpeg_tab) self.p_display.setObjectName(u"p_display") self.gridLayout.addWidget(self.p_display, 7, 3, 1, 5) self.kcfg_video4vdevice = QLineEdit(self.ffmpeg_tab) self.kcfg_video4vdevice.setObjectName(u"kcfg_video4vdevice") self.gridLayout.addWidget(self.kcfg_video4vdevice, 2, 3, 1, 5) self.p_colorspace = QLabel(self.ffmpeg_tab) self.p_colorspace.setObjectName(u"p_colorspace") self.gridLayout.addWidget(self.p_colorspace, 8, 3, 1, 5) self.p_fps = QLabel(self.ffmpeg_tab) self.p_fps.setObjectName(u"p_fps") self.gridLayout.addWidget(self.p_fps, 5, 3, 1, 5) self.tabWidget.addTab(self.ffmpeg_tab, "") self.screen_grab_tab = QWidget() self.screen_grab_tab.setObjectName(u"screen_grab_tab") self.gridLayout_5 = QGridLayout(self.screen_grab_tab) self.gridLayout_5.setObjectName(u"gridLayout_5") self.kcfg_grab_hide_mouse = QCheckBox(self.screen_grab_tab) self.kcfg_grab_hide_mouse.setObjectName(u"kcfg_grab_hide_mouse") self.gridLayout_5.addWidget(self.kcfg_grab_hide_mouse, 3, 0, 1, 4) self.horizontalSpacer_2 = QSpacerItem(237, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.gridLayout_5.addItem(self.horizontalSpacer_2, 2, 2, 1, 1) self.verticalSpacer_3 = QSpacerItem(383, 160, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_5.addItem(self.verticalSpacer_3, 8, 0, 1, 3) self.label_screengrab = QLabel(self.screen_grab_tab) self.label_screengrab.setObjectName(u"label_screengrab") sizePolicy1.setHeightForWidth( self.label_screengrab.sizePolicy().hasHeightForWidth()) self.label_screengrab.setSizePolicy(sizePolicy1) self.gridLayout_5.addWidget(self.label_screengrab, 5, 0, 1, 1) self.kcfg_grab_capture_type = QComboBox(self.screen_grab_tab) self.kcfg_grab_capture_type.addItem("") self.kcfg_grab_capture_type.addItem("") self.kcfg_grab_capture_type.setObjectName(u"kcfg_grab_capture_type") self.gridLayout_5.addWidget(self.kcfg_grab_capture_type, 0, 0, 1, 3) self.screen_grab_profile_box = QHBoxLayout() self.screen_grab_profile_box.setObjectName(u"screen_grab_profile_box") self.gridLayout_5.addLayout(self.screen_grab_profile_box, 5, 1, 1, 2) self.label_18 = QLabel(self.screen_grab_tab) self.label_18.setObjectName(u"label_18") self.gridLayout_5.addWidget(self.label_18, 2, 0, 1, 1) self.region_group = QFrame(self.screen_grab_tab) self.region_group.setObjectName(u"region_group") self.region_group.setFrameShape(QFrame.StyledPanel) self.region_group.setFrameShadow(QFrame.Raised) self.gridLayout_3 = QGridLayout(self.region_group) self.gridLayout_3.setObjectName(u"gridLayout_3") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.kcfg_grab_follow_mouse = QCheckBox(self.region_group) self.kcfg_grab_follow_mouse.setObjectName(u"kcfg_grab_follow_mouse") self.horizontalLayout.addWidget(self.kcfg_grab_follow_mouse) self.kcfg_grab_hide_frame = QCheckBox(self.region_group) self.kcfg_grab_hide_frame.setObjectName(u"kcfg_grab_hide_frame") self.horizontalLayout.addWidget(self.kcfg_grab_hide_frame) self.horizontalSpacer_4 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout.addItem(self.horizontalSpacer_4) self.gridLayout_3.addLayout(self.horizontalLayout, 0, 0, 1, 3) self.label_19 = QLabel(self.region_group) self.label_19.setObjectName(u"label_19") self.gridLayout_3.addWidget(self.label_19, 1, 0, 1, 1) self.kcfg_grab_offsetx = QSpinBox(self.region_group) self.kcfg_grab_offsetx.setObjectName(u"kcfg_grab_offsetx") sizePolicy.setHeightForWidth( self.kcfg_grab_offsetx.sizePolicy().hasHeightForWidth()) self.kcfg_grab_offsetx.setSizePolicy(sizePolicy) self.kcfg_grab_offsetx.setMaximum(5000) self.kcfg_grab_offsetx.setValue(0) self.gridLayout_3.addWidget(self.kcfg_grab_offsetx, 1, 1, 1, 1) self.kcfg_grab_offsety = QSpinBox(self.region_group) self.kcfg_grab_offsety.setObjectName(u"kcfg_grab_offsety") sizePolicy.setHeightForWidth( self.kcfg_grab_offsety.sizePolicy().hasHeightForWidth()) self.kcfg_grab_offsety.setSizePolicy(sizePolicy) self.kcfg_grab_offsety.setMaximum(5000) self.kcfg_grab_offsety.setValue(0) self.gridLayout_3.addWidget(self.kcfg_grab_offsety, 1, 2, 1, 1) self.label_20 = QLabel(self.region_group) self.label_20.setObjectName(u"label_20") self.gridLayout_3.addWidget(self.label_20, 2, 0, 1, 1) self.kcfg_grab_width = QSpinBox(self.region_group) self.kcfg_grab_width.setObjectName(u"kcfg_grab_width") self.kcfg_grab_width.setMinimum(1) self.kcfg_grab_width.setMaximum(5000) self.kcfg_grab_width.setValue(1280) self.gridLayout_3.addWidget(self.kcfg_grab_width, 2, 1, 1, 1) self.kcfg_grab_height = QSpinBox(self.region_group) self.kcfg_grab_height.setObjectName(u"kcfg_grab_height") self.kcfg_grab_height.setMinimum(1) self.kcfg_grab_height.setMaximum(5000) self.kcfg_grab_height.setValue(720) self.gridLayout_3.addWidget(self.kcfg_grab_height, 2, 2, 1, 1) self.gridLayout_5.addWidget(self.region_group, 1, 0, 1, 3) self.kcfg_grab_fps = QDoubleSpinBox(self.screen_grab_tab) self.kcfg_grab_fps.setObjectName(u"kcfg_grab_fps") self.kcfg_grab_fps.setMinimum(1.000000000000000) self.kcfg_grab_fps.setMaximum(1000.000000000000000) self.gridLayout_5.addWidget(self.kcfg_grab_fps, 2, 1, 1, 1) self.tabWidget.addTab(self.screen_grab_tab, "") self.decklink_tab = QWidget() self.decklink_tab.setObjectName(u"decklink_tab") self.gridLayout_6 = QGridLayout(self.decklink_tab) self.gridLayout_6.setObjectName(u"gridLayout_6") self.kcfg_decklink_capturedevice = QComboBox(self.decklink_tab) self.kcfg_decklink_capturedevice.setObjectName( u"kcfg_decklink_capturedevice") sizePolicy.setHeightForWidth( self.kcfg_decklink_capturedevice.sizePolicy().hasHeightForWidth()) self.kcfg_decklink_capturedevice.setSizePolicy(sizePolicy) self.gridLayout_6.addWidget(self.kcfg_decklink_capturedevice, 0, 1, 1, 1) self.kcfg_decklink_filename = QLineEdit(self.decklink_tab) self.kcfg_decklink_filename.setObjectName(u"kcfg_decklink_filename") self.gridLayout_6.addWidget(self.kcfg_decklink_filename, 5, 1, 1, 1) self.label_16 = QLabel(self.decklink_tab) self.label_16.setObjectName(u"label_16") sizePolicy1.setHeightForWidth( self.label_16.sizePolicy().hasHeightForWidth()) self.label_16.setSizePolicy(sizePolicy1) self.gridLayout_6.addWidget(self.label_16, 2, 0, 1, 1) self.label_29 = QLabel(self.decklink_tab) self.label_29.setObjectName(u"label_29") self.gridLayout_6.addWidget(self.label_29, 5, 0, 1, 1) self.verticalSpacer_4 = QSpacerItem(20, 327, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_6.addItem(self.verticalSpacer_4, 6, 1, 1, 1) self.label_27 = QLabel(self.decklink_tab) self.label_27.setObjectName(u"label_27") self.gridLayout_6.addWidget(self.label_27, 0, 0, 1, 1) self.decklink_profile_box = QHBoxLayout() self.decklink_profile_box.setSpacing(0) self.decklink_profile_box.setObjectName(u"decklink_profile_box") self.gridLayout_6.addLayout(self.decklink_profile_box, 2, 1, 1, 1) self.tabWidget.addTab(self.decklink_tab, "") self.audio_tab = QWidget() self.audio_tab.setObjectName(u"audio_tab") self.gridLayout_2 = QGridLayout(self.audio_tab) self.gridLayout_2.setObjectName(u"gridLayout_2") self.label_5 = QLabel(self.audio_tab) self.label_5.setObjectName(u"label_5") self.gridLayout_2.addWidget(self.label_5, 5, 0, 1, 1) self.label_2 = QLabel(self.audio_tab) self.label_2.setObjectName(u"label_2") self.gridLayout_2.addWidget(self.label_2, 3, 0, 1, 1) self.verticalSpacer_2 = QSpacerItem(20, 661, QSizePolicy.Minimum, QSizePolicy.Expanding) self.gridLayout_2.addItem(self.verticalSpacer_2, 6, 1, 1, 1) self.label_3 = QLabel(self.audio_tab) self.label_3.setObjectName(u"label_3") self.gridLayout_2.addWidget(self.label_3, 4, 0, 1, 1) self.audiocapturesamplerate = QComboBox(self.audio_tab) self.audiocapturesamplerate.setObjectName(u"audiocapturesamplerate") self.gridLayout_2.addWidget(self.audiocapturesamplerate, 5, 1, 1, 1) self.kcfg_audiocapturevolume = QSlider(self.audio_tab) self.kcfg_audiocapturevolume.setObjectName(u"kcfg_audiocapturevolume") self.kcfg_audiocapturevolume.setMaximum(100) self.kcfg_audiocapturevolume.setSliderPosition(100) self.kcfg_audiocapturevolume.setTracking(True) self.kcfg_audiocapturevolume.setOrientation(Qt.Horizontal) self.kcfg_audiocapturevolume.setInvertedAppearance(False) self.kcfg_audiocapturevolume.setInvertedControls(False) self.kcfg_audiocapturevolume.setTickPosition(QSlider.TicksAbove) self.gridLayout_2.addWidget(self.kcfg_audiocapturevolume, 3, 1, 1, 1) self.audiocapturechannels = QComboBox(self.audio_tab) self.audiocapturechannels.setObjectName(u"audiocapturechannels") self.gridLayout_2.addWidget(self.audiocapturechannels, 4, 1, 1, 1) self.kcfg_defaultaudiocapture = QComboBox(self.audio_tab) self.kcfg_defaultaudiocapture.setObjectName( u"kcfg_defaultaudiocapture") self.gridLayout_2.addWidget(self.kcfg_defaultaudiocapture, 1, 1, 1, 1) self.label_33 = QLabel(self.audio_tab) self.label_33.setObjectName(u"label_33") self.gridLayout_2.addWidget(self.label_33, 1, 0, 1, 1) self.labelNoAudioDevices = QLabel(self.audio_tab) self.labelNoAudioDevices.setObjectName(u"labelNoAudioDevices") font = QFont() font.setPointSize(10) self.labelNoAudioDevices.setFont(font) self.gridLayout_2.addWidget(self.labelNoAudioDevices, 2, 0, 1, 2) self.tabWidget.addTab(self.audio_tab, "") self.gridLayout_8.addWidget(self.tabWidget, 1, 0, 1, 2) QWidget.setTabOrder(self.kcfg_defaultcapture, self.tabWidget) QWidget.setTabOrder(self.tabWidget, self.kcfg_grab_capture_type) QWidget.setTabOrder(self.kcfg_grab_capture_type, self.kcfg_grab_follow_mouse) QWidget.setTabOrder(self.kcfg_grab_follow_mouse, self.kcfg_grab_hide_frame) QWidget.setTabOrder(self.kcfg_grab_hide_frame, self.kcfg_grab_offsetx) QWidget.setTabOrder(self.kcfg_grab_offsetx, self.kcfg_grab_offsety) QWidget.setTabOrder(self.kcfg_grab_offsety, self.kcfg_grab_width) QWidget.setTabOrder(self.kcfg_grab_width, self.kcfg_grab_height) self.retranslateUi(ConfigCapture_UI) self.tabWidget.setCurrentIndex(0) QMetaObject.connectSlotsByName(ConfigCapture_UI) # setupUi def retranslateUi(self, ConfigCapture_UI): self.label.setText( QCoreApplication.translate("ConfigCapture_UI", u"Default capture device", None)) self.kcfg_defaultcapture.setItemText( 0, QCoreApplication.translate("ConfigCapture_UI", u"FFmpeg", None)) self.kcfg_defaultcapture.setItemText( 1, QCoreApplication.translate("ConfigCapture_UI", u"Screen grab", None)) self.label_9.setText( QCoreApplication.translate("ConfigCapture_UI", u"Capture format", None)) self.label_24.setText( QCoreApplication.translate("ConfigCapture_UI", u"Encoding profile", None)) self.label_4.setText( QCoreApplication.translate("ConfigCapture_UI", u"Frame rate:", None)) self.label_11.setText( QCoreApplication.translate("ConfigCapture_UI", u"Channels", None)) self.config_v4l.setText( QCoreApplication.translate("ConfigCapture_UI", u"Edit", None)) self.label_31.setText( QCoreApplication.translate("ConfigCapture_UI", u"Display aspect ratio:", None)) self.p_progressive.setText( QCoreApplication.translate("ConfigCapture_UI", u"Interlaced", None)) self.label_30.setText( QCoreApplication.translate("ConfigCapture_UI", u"Detected devices", None)) self.label_14.setText( QCoreApplication.translate("ConfigCapture_UI", u"Video device", None)) self.p_aspect.setText( QCoreApplication.translate("ConfigCapture_UI", u"59/54", None)) self.label_23.setText( QCoreApplication.translate("ConfigCapture_UI", u"Pixel aspect ratio:", None)) self.kcfg_v4l_captureaudio.setText( QCoreApplication.translate("ConfigCapture_UI", u"Capture audio (ALSA)", None)) self.kcfg_v4l_capturevideo.setText( QCoreApplication.translate("ConfigCapture_UI", u"Capture video (Video4Linux2)", None)) self.label_6.setText( QCoreApplication.translate("ConfigCapture_UI", u"Size:", None)) self.label_32.setText( QCoreApplication.translate("ConfigCapture_UI", u"Colorspace", None)) self.p_size.setText( QCoreApplication.translate("ConfigCapture_UI", u"720x576", None)) self.p_display.setText( QCoreApplication.translate("ConfigCapture_UI", u"4/3", None)) self.kcfg_video4vdevice.setText("") self.p_colorspace.setText("") self.p_fps.setText( QCoreApplication.translate("ConfigCapture_UI", u"25/1", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.ffmpeg_tab), QCoreApplication.translate("ConfigCapture_UI", u"FFmpeg", None)) self.kcfg_grab_hide_mouse.setText( QCoreApplication.translate("ConfigCapture_UI", u"Hide cursor", None)) self.label_screengrab.setText( QCoreApplication.translate("ConfigCapture_UI", u"Encoding profile", None)) self.kcfg_grab_capture_type.setItemText( 0, QCoreApplication.translate("ConfigCapture_UI", u"Full Screen Capture", None)) self.kcfg_grab_capture_type.setItemText( 1, QCoreApplication.translate("ConfigCapture_UI", u"Region Capture", None)) self.label_18.setText( QCoreApplication.translate("ConfigCapture_UI", u"Frame rate", None)) self.kcfg_grab_follow_mouse.setText( QCoreApplication.translate("ConfigCapture_UI", u"Follow mouse", None)) self.kcfg_grab_hide_frame.setText( QCoreApplication.translate("ConfigCapture_UI", u"Hide frame", None)) self.label_19.setText( QCoreApplication.translate("ConfigCapture_UI", u"Offset", None)) self.label_20.setText( QCoreApplication.translate("ConfigCapture_UI", u"Size", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.screen_grab_tab), QCoreApplication.translate("ConfigCapture_UI", u"Screen Grab", None)) self.label_16.setText( QCoreApplication.translate("ConfigCapture_UI", u"Encoding profile", None)) self.label_29.setText( QCoreApplication.translate("ConfigCapture_UI", u"Capture file name:", None)) self.label_27.setText( QCoreApplication.translate("ConfigCapture_UI", u"Detected devices", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.decklink_tab), QCoreApplication.translate("ConfigCapture_UI", u"Blackmagic", None)) self.label_5.setText( QCoreApplication.translate("ConfigCapture_UI", u"Sample rate:", None)) self.label_2.setText( QCoreApplication.translate("ConfigCapture_UI", u"Capture volume:", None)) self.label_3.setText( QCoreApplication.translate("ConfigCapture_UI", u"Channels:", None)) self.label_33.setText( QCoreApplication.translate("ConfigCapture_UI", u"Device:", None)) self.labelNoAudioDevices.setText( QCoreApplication.translate( "ConfigCapture_UI", u"Make sure you have audio plugins installed on your system", None)) self.tabWidget.setTabText( self.tabWidget.indexOf(self.audio_tab), QCoreApplication.translate("ConfigCapture_UI", u"Audio", None)) pass
class ParameterEditorItem(QWidget): onRemoveParameter = Signal(Parameter) onMoveParameterUp = Signal(Parameter) onMoveParameterDown = Signal(Parameter) onChanged = Signal() def __init__(self, parameter: Parameter): super().__init__() self.parameter = parameter deleteButton = QToolButton() deleteButton.setText("X") deleteButton.clicked.connect( lambda: self.onRemoveParameter.emit(self.parameter)) upButton = QToolButton() upButton.setText("\u2191") upButton.clicked.connect( lambda: self.onMoveParameterUp.emit(self.parameter)) downButton = QToolButton() downButton.setText("\u2193") downButton.clicked.connect( lambda: self.onMoveParameterDown.emit(self.parameter)) buttonsLayout = QVBoxLayout() buttonsLayout.setAlignment(Qt.AlignTop) buttonsLayout.addWidget(deleteButton) buttonsLayout.addWidget(upButton) buttonsLayout.addWidget(downButton) self._nameLabel = QLabel("Name") self._nameField = QLineEdit() self._nameField.textChanged.connect(self.OnChanged) self._dataTypeLabel = QLabel("Data Type") self._dataTypeField = QComboBox() for dataType in DataType: self._dataTypeField.addItem(dataType.ToString(), userData=dataType) self._dataTypeField.currentIndexChanged.connect(self.OnChanged) self._defaultValueLabel = QLabel("Default Value") self._defaultInteger = QSpinBox() self._defaultInteger.valueChanged.connect(self.OnChanged) self._defaultFloat = QDoubleSpinBox() self._defaultFloat.valueChanged.connect(self.OnChanged) self._defaultBoolean = QComboBox() self._defaultBoolean.addItem("True", True) self._defaultBoolean.addItem("False", False) self._defaultBoolean.currentIndexChanged.connect(self.OnChanged) self._defaultString = QLineEdit() self._defaultString.textChanged.connect(self.OnChanged) self._minimumLabel = QLabel("Minimum") self._minimumFloat = QDoubleSpinBox() self._minimumFloat.valueChanged.connect(self.OnChanged) self._minimumInteger = QSpinBox() self._minimumInteger.valueChanged.connect(self.OnChanged) self._maximumLabel = QLabel("Maximum") self._maximumFloat = QDoubleSpinBox() self._maximumFloat.valueChanged.connect(self.OnChanged) self._maximumInteger = QSpinBox() self._maximumInteger.valueChanged.connect(self.OnChanged) gridLayout = QGridLayout() gridLayout.setAlignment(Qt.AlignTop) gridLayout.addWidget(self._nameLabel, 0, 0) gridLayout.addWidget(self._nameField, 0, 1) gridLayout.addWidget(self._dataTypeLabel, 1, 0) gridLayout.addWidget(self._dataTypeField, 1, 1) gridLayout.addWidget(self._defaultValueLabel, 2, 0) for defaultField in [ self._defaultInteger, self._defaultFloat, self._defaultBoolean, self._defaultString ]: gridLayout.addWidget(defaultField, 2, 1) gridLayout.addWidget(self._minimumLabel, 3, 0) gridLayout.addWidget(self._minimumInteger, 3, 1) gridLayout.addWidget(self._minimumFloat, 3, 1) gridLayout.addWidget(self._maximumLabel, 4, 0) gridLayout.addWidget(self._maximumInteger, 4, 1) gridLayout.addWidget(self._maximumFloat, 4, 1) layout = QHBoxLayout() layout.addLayout(buttonsLayout) layout.addLayout(gridLayout) self.setLayout(layout) self.SetFieldsFromParameter() def SetFieldsFromParameter(self): self._nameField.setText(self.parameter.name) self._dataTypeField.setCurrentText(self.parameter.dataType.ToString()) minFloat, maxFloat = self.parameter.minimumFloat, self.parameter.maximumFloat minInt, maxInt = self.parameter.minimumInteger, self.parameter.maximumInteger self._minimumFloat.setRange(-2**30, maxFloat) self._maximumFloat.setRange(minFloat, 2**30) self._minimumInteger.setRange(-2**30, maxInt) self._maximumInteger.setRange(minInt, 2**30) if self._minimumFloat.value() != minFloat: self._minimumFloat.setValue(minFloat) if self._maximumFloat.value() != maxFloat: self._maximumFloat.setValue(maxFloat) if self._minimumInteger.value() != minInt: self._minimumInteger.setValue(minInt) if self._maximumInteger.value() != maxInt: self._maximumInteger.setValue(maxInt) self._defaultInteger.setRange(minInt, maxInt) self._defaultFloat.setRange(minFloat, maxFloat) if self._defaultInteger.value() != self.parameter.defaultValueDict[ DataType.INTEGER]: self._defaultInteger.setValue( self.parameter.defaultValueDict[DataType.INTEGER]) if self._defaultFloat.value() != self.parameter.defaultValueDict[ DataType.FLOAT]: self._defaultFloat.setValue( self.parameter.defaultValueDict[DataType.FLOAT]) if self._defaultBoolean.currentData( ) != self.parameter.defaultValueDict[DataType.BOOLEAN]: self._defaultBoolean.setCurrentText( str(self.parameter.defaultValueDict[DataType.BOOLEAN])) if self._defaultString.text() != self.parameter.defaultValueDict[ DataType.STRING]: self._defaultString.setText( self.parameter.defaultValueDict[DataType.STRING]) self.UpdateVisibility() def UpdateVisibility(self): self._defaultInteger.setVisible( self._dataTypeField.currentData() is DataType.INTEGER) self._defaultFloat.setVisible( self._dataTypeField.currentData() is DataType.FLOAT) self._defaultBoolean.setVisible( self._dataTypeField.currentData() is DataType.BOOLEAN) self._defaultString.setVisible( self._dataTypeField.currentData() is DataType.STRING) self._minimumLabel.setVisible(self._dataTypeField.currentData() in [DataType.INTEGER, DataType.FLOAT]) self._maximumLabel.setVisible(self._dataTypeField.currentData() in [DataType.INTEGER, DataType.FLOAT]) self._minimumInteger.setVisible( self._dataTypeField.currentData() is DataType.INTEGER) self._maximumInteger.setVisible( self._dataTypeField.currentData() is DataType.INTEGER) self._minimumFloat.setVisible( self._dataTypeField.currentData() is DataType.FLOAT) self._maximumFloat.setVisible( self._dataTypeField.currentData() is DataType.FLOAT) self._minimumLabel.setVisible(self._dataTypeField.currentData() in [DataType.INTEGER, DataType.FLOAT]) self._maximumLabel.setVisible(self._dataTypeField.currentData() in [DataType.INTEGER, DataType.FLOAT]) self._defaultValueLabel.setVisible(self._dataTypeField.currentData( ) not in [DataType.VALVE, DataType.PROGRAM, DataType.PROGRAM_PRESET]) def OnChanged(self): self.UpdateVisibility() self._minimumFloat.setMaximum(self._maximumFloat.value()) self._maximumFloat.setMinimum(self._minimumFloat.value()) self._minimumInteger.setMaximum(self._maximumInteger.value()) self._maximumInteger.setMinimum(self._minimumInteger.value()) self._defaultInteger.setRange(self._minimumInteger.value(), self._maximumInteger.value()) self._defaultFloat.setRange(self._minimumFloat.value(), self._maximumFloat.value()) self.onChanged.emit() def UpdateParameter(self): self.parameter.name = self._nameField.text() self.parameter.dataType = self._dataTypeField.currentData() self.parameter.defaultValueDict[ DataType.INTEGER] = self._defaultInteger.value() self.parameter.defaultValueDict[ DataType.FLOAT] = self._defaultFloat.value() self.parameter.defaultValueDict[ DataType.BOOLEAN] = self._defaultBoolean.currentData() self.parameter.defaultValueDict[ DataType.STRING] = self._defaultString.text() self.parameter.minimumInteger = self._minimumInteger.value() self.parameter.maximumInteger = self._maximumInteger.value() self.parameter.minimumFloat = self._minimumFloat.value() self.parameter.maximumFloat = self._maximumFloat.value() self.parameter.ValidateDefaultValues() self.SetFieldsFromParameter()