def _setupBottomPart(self): # The bottom part of the pref panel is always the same in all editions. self.fontSizeLabel = QLabel(tr("Font size:")) self.fontSizeSpinBox = QSpinBox() self.fontSizeSpinBox.setMinimum(5) self.widgetsVLayout.addLayout( horizontalWrap([self.fontSizeLabel, self.fontSizeSpinBox, None])) self.languageLabel = QLabel(tr("Language:"), self) self.languageComboBox = QComboBox(self) for lang in self.supportedLanguages: self.languageComboBox.addItem(get_langnames()[lang]) self.widgetsVLayout.addLayout( horizontalWrap([self.languageLabel, self.languageComboBox, None])) self.copyMoveLabel = QLabel(self) self.copyMoveLabel.setText(tr("Copy and Move:")) self.widgetsVLayout.addWidget(self.copyMoveLabel) self.copyMoveDestinationComboBox = QComboBox(self) self.copyMoveDestinationComboBox.addItem(tr("Right in destination")) self.copyMoveDestinationComboBox.addItem(tr("Recreate relative path")) self.copyMoveDestinationComboBox.addItem(tr("Recreate absolute path")) self.widgetsVLayout.addWidget(self.copyMoveDestinationComboBox) self.customCommandLabel = QLabel(self) self.customCommandLabel.setText( tr("Custom Command (arguments: %d for dupe, %r for ref):")) self.widgetsVLayout.addWidget(self.customCommandLabel) self.customCommandEdit = QLineEdit(self) self.widgetsVLayout.addWidget(self.customCommandEdit)
def __init__(self, parent, app, **kwargs): flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint super().__init__(parent, flags, **kwargs) self.app = app all_languages = get_langnames() self.supportedLanguages = sorted(SUPPORTED_LANGUAGES, key=lambda lang: all_languages[lang]) self._setupUi() self.filterHardnessSlider.valueChanged['int'].connect(self.filterHardnessLabel.setNum) self.buttonBox.clicked.connect(self.buttonClicked) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject)
def __init__(self, parent, app, **kwargs): flags = Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint super().__init__(parent, flags, **kwargs) self.app = app all_languages = get_langnames() self.supportedLanguages = sorted(SUPPORTED_LANGUAGES, key=lambda lang: all_languages[lang]) self._setupUi() self.filterHardnessSlider.valueChanged["int"].connect(self.filterHardnessLabel.setNum) self.buttonBox.clicked.connect(self.buttonClicked) self.buttonBox.accepted.connect(self.accept) self.buttonBox.rejected.connect(self.reject)
def _setupUi(self): self.setWindowTitle(tr("Preferences")) self.resize(332, 170) self.verticalLayout = QVBoxLayout(self) self.formLayout = QFormLayout() self.autoSaveIntervalSpinBox = QSpinBox(self) self.autoSaveIntervalSpinBox.setMaximumSize(QSize(70, 0xffffff)) self.label_5 = QLabel(tr("minute(s) (0 for none)"), self) self.formLayout.addRow( tr("Auto-save interval:"), horizontalWrap([self.autoSaveIntervalSpinBox, self.label_5])) self.dateFormatEdit = QLineEdit(self) self.dateFormatEdit.setMaximumSize(QSize(140, 0xffffff)) self.formLayout.addRow(tr("Date format:"), self.dateFormatEdit) self.fontSizeSpinBox = QSpinBox() self.fontSizeSpinBox.setMinimum(5) self.fontSizeSpinBox.setMaximumSize(QSize(70, 0xffffff)) self.formLayout.addRow(tr("Font size:"), self.fontSizeSpinBox) self.languageComboBox = QComboBox(self) LANGNAMES = get_langnames() for lang in SUPPORTED_LANGUAGES: self.languageComboBox.addItem(LANGNAMES[lang]) self.languageComboBox.setMaximumSize(QSize(140, 0xffffff)) self.formLayout.addRow(tr("Language:"), self.languageComboBox) self.verticalLayout.addLayout(self.formLayout) self.scopeDialogCheckBox = QCheckBox( tr("Show scope dialog when modifying a scheduled transaction"), self) self.verticalLayout.addWidget(self.scopeDialogCheckBox) self.autoDecimalPlaceCheckBox = QCheckBox( tr("Automatically place decimals when typing"), self) self.verticalLayout.addWidget(self.autoDecimalPlaceCheckBox) self.debugModeCheckBox = QCheckBox(tr("Debug mode (restart required)"), self) self.verticalLayout.addWidget(self.debugModeCheckBox) self.verticalLayout.addItem(verticalSpacer()) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel | QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.buttonBox)
def _setupUi(self): self.setWindowTitle(tr("Preferences")) self.resize(332, 170) self.verticalLayout = QVBoxLayout(self) self.formLayout = QFormLayout() self.autoSaveIntervalSpinBox = QSpinBox(self) self.autoSaveIntervalSpinBox.setMaximumSize(QSize(70, 0xffffff)) self.label_5 = QLabel(tr("minute(s) (0 for none)"), self) self.formLayout.addRow( tr("Auto-save interval:"), horizontalWrap([self.autoSaveIntervalSpinBox, self.label_5]) ) self.dateFormatEdit = QLineEdit(self) self.dateFormatEdit.setMaximumSize(QSize(140, 0xffffff)) self.formLayout.addRow(tr("Date format:"), self.dateFormatEdit) self.fontSizeSpinBox = QSpinBox() self.fontSizeSpinBox.setMinimum(5) self.fontSizeSpinBox.setMaximumSize(QSize(70, 0xffffff)) self.formLayout.addRow(tr("Font size:"), self.fontSizeSpinBox) self.languageComboBox = QComboBox(self) LANGNAMES = get_langnames() for lang in SUPPORTED_LANGUAGES: self.languageComboBox.addItem(LANGNAMES[lang]) self.languageComboBox.setMaximumSize(QSize(140, 0xffffff)) self.formLayout.addRow(tr("Language:"), self.languageComboBox) self.verticalLayout.addLayout(self.formLayout) self.scopeDialogCheckBox = QCheckBox(tr("Show scope dialog when modifying a scheduled transaction"), self) self.verticalLayout.addWidget(self.scopeDialogCheckBox) self.autoDecimalPlaceCheckBox = QCheckBox(tr("Automatically place decimals when typing"), self) self.verticalLayout.addWidget(self.autoDecimalPlaceCheckBox) self.debugModeCheckBox = QCheckBox(tr("Debug mode (restart required)"), self) self.verticalLayout.addWidget(self.debugModeCheckBox) self.verticalLayout.addItem(verticalSpacer()) self.buttonBox = QDialogButtonBox(self) self.buttonBox.setOrientation(Qt.Horizontal) self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel|QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.buttonBox)
def _setupBottomPart(self): # The bottom part of the pref panel is always the same in all editions. self.fontSizeLabel = QLabel(tr("Font size:")) self.fontSizeSpinBox = QSpinBox() self.fontSizeSpinBox.setMinimum(5) self.widgetsVLayout.addLayout(horizontalWrap([self.fontSizeLabel, self.fontSizeSpinBox, None])) self.languageLabel = QLabel(tr("Language:"), self) self.languageComboBox = QComboBox(self) for lang in self.supportedLanguages: self.languageComboBox.addItem(get_langnames()[lang]) self.widgetsVLayout.addLayout(horizontalWrap([self.languageLabel, self.languageComboBox, None])) self.copyMoveLabel = QLabel(self) self.copyMoveLabel.setText(tr("Copy and Move:")) self.widgetsVLayout.addWidget(self.copyMoveLabel) self.copyMoveDestinationComboBox = QComboBox(self) self.copyMoveDestinationComboBox.addItem(tr("Right in destination")) self.copyMoveDestinationComboBox.addItem(tr("Recreate relative path")) self.copyMoveDestinationComboBox.addItem(tr("Recreate absolute path")) self.widgetsVLayout.addWidget(self.copyMoveDestinationComboBox) self.customCommandLabel = QLabel(self) self.customCommandLabel.setText(tr("Custom Command (arguments: %d for dupe, %r for ref):")) self.widgetsVLayout.addWidget(self.customCommandLabel) self.customCommandEdit = QLineEdit(self) self.widgetsVLayout.addWidget(self.customCommandEdit)
def _setupDisplayPage(self): self.ui_groupbox = QGroupBox("&General Interface") layout = QVBoxLayout() self.languageLabel = QLabel(tr("Language:"), self) self.languageComboBox = QComboBox(self) for lang in self.supportedLanguages: self.languageComboBox.addItem(get_langnames()[lang]) layout.addLayout( horizontalWrap([self.languageLabel, self.languageComboBox, None])) self._setupAddCheckbox( "tabs_default_pos", tr("Use default position for tab bar (requires restart)")) self.tabs_default_pos.setToolTip( tr("Place the tab bar below the main menu instead of next to it\n\ On MacOS, the tab bar will fill up the window's width instead.")) layout.addWidget(self.tabs_default_pos) self.ui_groupbox.setLayout(layout) self.displayVLayout.addWidget(self.ui_groupbox) gridlayout = QFormLayout() result_groupbox = QGroupBox("&Result Table") self.fontSizeSpinBox = QSpinBox() self.fontSizeSpinBox.setMinimum(5) gridlayout.addRow(tr("Font size:"), self.fontSizeSpinBox) self._setupAddCheckbox("reference_bold_font", tr("Use bold font for references")) gridlayout.addRow(self.reference_bold_font) self.result_table_ref_foreground_color = ColorPickerButton(self) gridlayout.addRow(tr("Reference foreground color:"), self.result_table_ref_foreground_color) self.result_table_ref_background_color = ColorPickerButton(self) gridlayout.addRow(tr("Reference background color:"), self.result_table_ref_background_color) self.result_table_delta_foreground_color = ColorPickerButton(self) gridlayout.addRow(tr("Delta foreground color:"), self.result_table_delta_foreground_color) gridlayout.setLabelAlignment(Qt.AlignLeft) # Keep same vertical spacing as parent layout for consistency gridlayout.setVerticalSpacing(self.displayVLayout.spacing()) result_groupbox.setLayout(gridlayout) self.displayVLayout.addWidget(result_groupbox) details_groupbox = QGroupBox("&Details Window") self.details_groupbox_layout = QVBoxLayout() self._setupAddCheckbox("details_dialog_titlebar_enabled", tr("Show the title bar and can be docked")) self.details_dialog_titlebar_enabled.setToolTip( tr("While the title bar is hidden, \ use the modifier key to drag the floating window around") if ISLINUX else tr("The title bar can only be disabled while the window is docked" )) self.details_groupbox_layout.addWidget( self.details_dialog_titlebar_enabled) self._setupAddCheckbox("details_dialog_vertical_titlebar", tr("Vertical title bar")) self.details_dialog_vertical_titlebar.setToolTip( tr("Change the title bar from horizontal on top, to vertical on the left side" )) self.details_groupbox_layout.addWidget( self.details_dialog_vertical_titlebar) self.details_dialog_vertical_titlebar.setEnabled( self.details_dialog_titlebar_enabled.isChecked()) self.details_dialog_titlebar_enabled.stateChanged.connect( self.details_dialog_vertical_titlebar.setEnabled) gridlayout = QGridLayout() self.details_table_delta_foreground_color_label = QLabel( tr("Delta foreground color:")) gridlayout.addWidget(self.details_table_delta_foreground_color_label, 4, 0) self.details_table_delta_foreground_color = ColorPickerButton(self) gridlayout.addWidget(self.details_table_delta_foreground_color, 4, 2, 1, 1, Qt.AlignLeft) gridlayout.setColumnStretch(1, 1) gridlayout.setColumnStretch(3, 4) self.details_groupbox_layout.addLayout(gridlayout) details_groupbox.setLayout(self.details_groupbox_layout) self.displayVLayout.addWidget(details_groupbox)