Esempio n. 1
0
 def setupUi(self):
     self.setObjectName(u'AlertsTab')
     SettingsTab.setupUi(self)
     self.fontGroupBox = QtGui.QGroupBox(self.leftColumn)
     self.fontGroupBox.setObjectName(u'fontGroupBox')
     self.fontLayout = QtGui.QFormLayout(self.fontGroupBox)
     self.fontLayout.setObjectName(u'fontLayout')
     self.fontLabel = QtGui.QLabel(self.fontGroupBox)
     self.fontLabel.setObjectName(u'fontLabel')
     self.fontComboBox = QtGui.QFontComboBox(self.fontGroupBox)
     self.fontComboBox.setObjectName(u'fontComboBox')
     self.fontLayout.addRow(self.fontLabel, self.fontComboBox)
     self.fontColorLabel = QtGui.QLabel(self.fontGroupBox)
     self.fontColorLabel.setObjectName(u'fontColorLabel')
     self.colorLayout = QtGui.QHBoxLayout()
     self.colorLayout.setObjectName(u'colorLayout')
     self.fontColorButton = QtGui.QPushButton(self.fontGroupBox)
     self.fontColorButton.setObjectName(u'fontColorButton')
     self.colorLayout.addWidget(self.fontColorButton)
     self.colorLayout.addSpacing(20)
     self.backgroundColorLabel = QtGui.QLabel(self.fontGroupBox)
     self.backgroundColorLabel.setObjectName(u'backgroundColorLabel')
     self.colorLayout.addWidget(self.backgroundColorLabel)
     self.backgroundColorButton = QtGui.QPushButton(self.fontGroupBox)
     self.backgroundColorButton.setObjectName(u'backgroundColorButton')
     self.colorLayout.addWidget(self.backgroundColorButton)
     self.fontLayout.addRow(self.fontColorLabel, self.colorLayout)
     self.fontSizeLabel = QtGui.QLabel(self.fontGroupBox)
     self.fontSizeLabel.setObjectName(u'fontSizeLabel')
     self.fontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox)
     self.fontSizeSpinBox.setObjectName(u'fontSizeSpinBox')
     self.fontLayout.addRow(self.fontSizeLabel, self.fontSizeSpinBox)
     self.timeoutLabel = QtGui.QLabel(self.fontGroupBox)
     self.timeoutLabel.setObjectName(u'timeoutLabel')
     self.timeoutSpinBox = QtGui.QSpinBox(self.fontGroupBox)
     self.timeoutSpinBox.setMaximum(180)
     self.timeoutSpinBox.setObjectName(u'timeoutSpinBox')
     self.fontLayout.addRow(self.timeoutLabel, self.timeoutSpinBox)
     self.verticalLabel, self.verticalComboBox = create_valign_selection_widgets(self.fontGroupBox)
     self.verticalLabel.setObjectName(u'verticalLabel')
     self.verticalComboBox.setObjectName(u'verticalComboBox')
     self.fontLayout.addRow(self.verticalLabel, self.verticalComboBox)
     self.leftLayout.addWidget(self.fontGroupBox)
     self.leftLayout.addStretch()
     self.previewGroupBox = QtGui.QGroupBox(self.rightColumn)
     self.previewGroupBox.setObjectName(u'previewGroupBox')
     self.previewLayout = QtGui.QVBoxLayout(self.previewGroupBox)
     self.previewLayout.setObjectName(u'previewLayout')
     self.fontPreview = QtGui.QLineEdit(self.previewGroupBox)
     self.fontPreview.setObjectName(u'fontPreview')
     self.previewLayout.addWidget(self.fontPreview)
     self.rightLayout.addWidget(self.previewGroupBox)
     self.rightLayout.addStretch()
     # Signals and slots
     QtCore.QObject.connect(self.backgroundColorButton, QtCore.SIGNAL(u'clicked()'),
         self.onBackgroundColorButtonClicked)
     QtCore.QObject.connect(self.fontColorButton, QtCore.SIGNAL(u'clicked()'), self.onFontColorButtonClicked)
     QtCore.QObject.connect(self.fontComboBox, QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked)
     QtCore.QObject.connect(self.timeoutSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
     QtCore.QObject.connect(self.fontSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged)
Esempio n. 2
0
 def setupUi(self):
     self.setObjectName('AlertsTab')
     super(AlertsTab, self).setupUi()
     self.font_group_box = QtGui.QGroupBox(self.left_column)
     self.font_group_box.setObjectName('font_group_box')
     self.font_layout = QtGui.QFormLayout(self.font_group_box)
     self.font_layout.setObjectName('font_layout')
     self.font_label = QtGui.QLabel(self.font_group_box)
     self.font_label.setObjectName('font_label')
     self.font_combo_box = QtGui.QFontComboBox(self.font_group_box)
     self.font_combo_box.setObjectName('font_combo_box')
     self.font_layout.addRow(self.font_label, self.font_combo_box)
     self.font_color_label = QtGui.QLabel(self.font_group_box)
     self.font_color_label.setObjectName('font_color_label')
     self.color_layout = QtGui.QHBoxLayout()
     self.color_layout.setObjectName('color_layout')
     self.font_color_button = ColorButton(self.font_group_box)
     self.font_color_button.setObjectName('font_color_button')
     self.color_layout.addWidget(self.font_color_button)
     self.color_layout.addSpacing(20)
     self.background_color_label = QtGui.QLabel(self.font_group_box)
     self.background_color_label.setObjectName('background_color_label')
     self.color_layout.addWidget(self.background_color_label)
     self.background_color_button = ColorButton(self.font_group_box)
     self.background_color_button.setObjectName('background_color_button')
     self.color_layout.addWidget(self.background_color_button)
     self.font_layout.addRow(self.font_color_label, self.color_layout)
     self.font_size_label = QtGui.QLabel(self.font_group_box)
     self.font_size_label.setObjectName('font_size_label')
     self.font_size_spin_box = QtGui.QSpinBox(self.font_group_box)
     self.font_size_spin_box.setObjectName('font_size_spin_box')
     self.font_layout.addRow(self.font_size_label, self.font_size_spin_box)
     self.timeout_label = QtGui.QLabel(self.font_group_box)
     self.timeout_label.setObjectName('timeout_label')
     self.timeout_spin_box = QtGui.QSpinBox(self.font_group_box)
     self.timeout_spin_box.setMaximum(180)
     self.timeout_spin_box.setObjectName('timeout_spin_box')
     self.font_layout.addRow(self.timeout_label, self.timeout_spin_box)
     self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self.font_group_box)
     self.vertical_label.setObjectName('vertical_label')
     self.vertical_combo_box.setObjectName('vertical_combo_box')
     self.font_layout.addRow(self.vertical_label, self.vertical_combo_box)
     self.left_layout.addWidget(self.font_group_box)
     self.left_layout.addStretch()
     self.preview_group_box = QtGui.QGroupBox(self.right_column)
     self.preview_group_box.setObjectName('preview_group_box')
     self.preview_layout = QtGui.QVBoxLayout(self.preview_group_box)
     self.preview_layout.setObjectName('preview_layout')
     self.font_preview = QtGui.QLineEdit(self.preview_group_box)
     self.font_preview.setObjectName('font_preview')
     self.preview_layout.addWidget(self.font_preview)
     self.right_layout.addWidget(self.preview_group_box)
     self.right_layout.addStretch()
     # Signals and slots
     self.background_color_button.colorChanged.connect(self.on_background_color_changed)
     self.font_color_button.colorChanged.connect(self.on_font_color_changed)
     self.font_combo_box.activated.connect(self.on_font_combo_box_clicked)
     self.timeout_spin_box.valueChanged.connect(self.on_timeout_spin_box_changed)
     self.font_size_spin_box.valueChanged.connect(self.on_font_size_spin_box_changed)
Esempio n. 3
0
 def setupUi(self):
     self.setObjectName('AlertsTab')
     super(AlertsTab, self).setupUi()
     self.font_group_box = QtGui.QGroupBox(self.left_column)
     self.font_group_box.setObjectName('font_group_box')
     self.font_layout = QtGui.QFormLayout(self.font_group_box)
     self.font_layout.setObjectName('font_layout')
     self.font_label = QtGui.QLabel(self.font_group_box)
     self.font_label.setObjectName('font_label')
     self.font_combo_box = QtGui.QFontComboBox(self.font_group_box)
     self.font_combo_box.setObjectName('font_combo_box')
     self.font_layout.addRow(self.font_label, self.font_combo_box)
     self.font_color_label = QtGui.QLabel(self.font_group_box)
     self.font_color_label.setObjectName('font_color_label')
     self.color_layout = QtGui.QHBoxLayout()
     self.color_layout.setObjectName('color_layout')
     self.font_color_button = QtGui.QPushButton(self.font_group_box)
     self.font_color_button.setObjectName('font_color_button')
     self.color_layout.addWidget(self.font_color_button)
     self.color_layout.addSpacing(20)
     self.background_color_label = QtGui.QLabel(self.font_group_box)
     self.background_color_label.setObjectName('background_color_label')
     self.color_layout.addWidget(self.background_color_label)
     self.background_color_button = QtGui.QPushButton(self.font_group_box)
     self.background_color_button.setObjectName('background_color_button')
     self.color_layout.addWidget(self.background_color_button)
     self.font_layout.addRow(self.font_color_label, self.color_layout)
     self.font_size_label = QtGui.QLabel(self.font_group_box)
     self.font_size_label.setObjectName('font_size_label')
     self.font_size_spin_box = QtGui.QSpinBox(self.font_group_box)
     self.font_size_spin_box.setObjectName('font_size_spin_box')
     self.font_layout.addRow(self.font_size_label, self.font_size_spin_box)
     self.timeout_label = QtGui.QLabel(self.font_group_box)
     self.timeout_label.setObjectName('timeout_label')
     self.timeout_spin_box = QtGui.QSpinBox(self.font_group_box)
     self.timeout_spin_box.setMaximum(180)
     self.timeout_spin_box.setObjectName('timeout_spin_box')
     self.font_layout.addRow(self.timeout_label, self.timeout_spin_box)
     self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self.font_group_box)
     self.vertical_label.setObjectName('vertical_label')
     self.vertical_combo_box.setObjectName('vertical_combo_box')
     self.font_layout.addRow(self.vertical_label, self.vertical_combo_box)
     self.left_layout.addWidget(self.font_group_box)
     self.left_layout.addStretch()
     self.preview_group_box = QtGui.QGroupBox(self.right_column)
     self.preview_group_box.setObjectName('preview_group_box')
     self.preview_layout = QtGui.QVBoxLayout(self.preview_group_box)
     self.preview_layout.setObjectName('preview_layout')
     self.font_preview = QtGui.QLineEdit(self.preview_group_box)
     self.font_preview.setObjectName('font_preview')
     self.preview_layout.addWidget(self.font_preview)
     self.right_layout.addWidget(self.preview_group_box)
     self.right_layout.addStretch()
     # Signals and slots
     self.background_color_button.clicked.connect(self.on_background_color_button_clicked)
     self.font_color_button.clicked.connect(self.on_font_color_button_clicked)
     self.font_combo_box.activated.connect(self.on_font_combo_box_clicked)
     self.timeout_spin_box.valueChanged.connect(self.on_timeout_spin_box_changed)
     self.font_size_spin_box.valueChanged.connect(self.on_font_size_spin_box_changed)
Esempio n. 4
0
 def setup_ui(self):
     """
     Set up the UI
     """
     # Alignment
     self.horizontal_label = FormLabel(self)
     self.horizontal_label.setObjectName('horizontal_label')
     self.layout.addWidget(self.horizontal_label, 0, 0)
     self.horizontal_combo_box = QtWidgets.QComboBox(self)
     self.horizontal_combo_box.addItems(['', '', '', ''])
     self.horizontal_combo_box.setObjectName('horizontal_combo_box')
     self.layout.addWidget(self.horizontal_combo_box, 0, 1, 1, 3)
     self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self)
     self.vertical_label.setObjectName('vertical_label')
     self.layout.addWidget(self.vertical_label, 1, 0)
     self.vertical_combo_box.setObjectName('vertical_combo_box')
     self.layout.addWidget(self.vertical_combo_box, 1, 1, 1, 3)
     # Line
     self.line = QtWidgets.QFrame(self)
     self.line.setFrameShape(QtWidgets.QFrame.HLine)
     self.line.setObjectName('line')
     self.layout.addWidget(self.line, 2, 0, 1, 4)
     # Transitions
     self.transitions_enabled_check_box = QtWidgets.QCheckBox(self)
     self.transitions_enabled_check_box.setObjectName('transitions_enabled_check_box')
     self.layout.addWidget(self.transitions_enabled_check_box, 3, 1)
     self.transition_effect_label = FormLabel(self)
     self.transition_effect_label.setObjectName('transition_effect_label')
     self.layout.addWidget(self.transition_effect_label, 4, 0)
     self.transition_effect_combo_box = QtWidgets.QComboBox(self)
     self.transition_effect_combo_box.setObjectName('transition_effect_combo_box')
     self.transition_effect_combo_box.addItems(['', '', '', '', ''])
     self.layout.addWidget(self.transition_effect_combo_box, 4, 1)
     self.transition_speed_label = FormLabel(self)
     self.transition_speed_label.setObjectName('transition_speed_label')
     self.layout.addWidget(self.transition_speed_label, 5, 0)
     self.transition_speed_combo_box = QtWidgets.QComboBox(self)
     self.transition_speed_combo_box.setObjectName('transition_speed_combo_box')
     self.transition_speed_combo_box.addItems(['', '', ''])
     self.layout.addWidget(self.transition_speed_combo_box, 5, 1)
     self.transition_direction_label = FormLabel(self)
     self.transition_direction_label.setObjectName('transition_direction_label')
     self.layout.addWidget(self.transition_direction_label, 4, 2)
     self.transition_direction_combo_box = QtWidgets.QComboBox(self)
     self.transition_direction_combo_box.setObjectName('transition_direction_combo_box')
     self.transition_direction_combo_box.addItems(['', ''])
     self.layout.addWidget(self.transition_direction_combo_box, 4, 3)
     self.transition_reverse_check_box = QtWidgets.QCheckBox(self)
     self.transition_reverse_check_box.setObjectName('transition_reverse_check_box')
     self.layout.addWidget(self.transition_reverse_check_box, 5, 3)
     # Connect slots
     self.transitions_enabled_check_box.stateChanged.connect(self._on_transition_enabled_changed)
Esempio n. 5
0
    def test_create_valign_selection_widgets(self):
        """
        Test creating a combo box for valign selection
        """
        # GIVEN: A dialog
        dialog = QtWidgets.QDialog()

        # WHEN: We create the widgets
        label, combo = create_valign_selection_widgets(dialog)

        # THEN: We should get a label and a combobox.
        self.assertEqual(translate('OpenLP.Ui', '&Vertical Align:'), label.text())
        self.assertIsInstance(combo, QtWidgets.QComboBox)
        self.assertEqual(combo, label.buddy())
        for text in [UiStrings().Top, UiStrings().Middle, UiStrings().Bottom]:
            self.assertTrue(combo.findText(text) >= 0)
Esempio n. 6
0
    def test_create_valign_selection_widgets(self):
        """
        Test creating a combo box for valign selection
        """
        # GIVEN: A dialog
        dialog = QtWidgets.QDialog()

        # WHEN: We create the widgets
        label, combo = create_valign_selection_widgets(dialog)

        # THEN: We should get a label and a combobox.
        self.assertEqual(translate('OpenLP.Ui', '&Vertical Align:'), label.text())
        self.assertIsInstance(combo, QtWidgets.QComboBox)
        self.assertEqual(combo, label.buddy())
        for text in [UiStrings().Top, UiStrings().Middle, UiStrings().Bottom]:
            self.assertTrue(combo.findText(text) >= 0)
Esempio n. 7
0
 def setupUi(self, themeWizard):
     """
     Set up the UI
     """
     themeWizard.setObjectName(u'OpenLP.ThemeWizard')
     themeWizard.setModal(True)
     themeWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
     themeWizard.setOptions(QtGui.QWizard.IndependentPages |
         QtGui.QWizard.NoBackButtonOnStartPage |
         QtGui.QWizard.HaveCustomButton1)
     self.spacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
     # Welcome Page
     add_welcome_page(themeWizard, u':/wizards/wizard_createtheme.bmp')
     # Background Page
     self.backgroundPage = QtGui.QWizardPage()
     self.backgroundPage.setObjectName(u'BackgroundPage')
     self.backgroundLayout = QtGui.QVBoxLayout(self.backgroundPage)
     self.backgroundLayout.setObjectName(u'BackgroundLayout')
     self.backgroundTypeLayout = QtGui.QFormLayout()
     self.backgroundTypeLayout.setObjectName(u'BackgroundTypeLayout')
     self.backgroundLabel = QtGui.QLabel(self.backgroundPage)
     self.backgroundLabel.setObjectName(u'BackgroundLabel')
     self.backgroundComboBox = QtGui.QComboBox(self.backgroundPage)
     self.backgroundComboBox.addItems([u'', u'', u'', u''])
     self.backgroundComboBox.setObjectName(u'BackgroundComboBox')
     self.backgroundTypeLayout.addRow(self.backgroundLabel, self.backgroundComboBox)
     self.backgroundTypeLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
     self.backgroundLayout.addLayout(self.backgroundTypeLayout)
     self.backgroundStack = QtGui.QStackedLayout()
     self.backgroundStack.setObjectName(u'BackgroundStack')
     self.colorWidget = QtGui.QWidget(self.backgroundPage)
     self.colorWidget.setObjectName(u'ColorWidget')
     self.colorLayout = QtGui.QFormLayout(self.colorWidget)
     self.colorLayout.setMargin(0)
     self.colorLayout.setObjectName(u'ColorLayout')
     self.colorLabel = QtGui.QLabel(self.colorWidget)
     self.colorLabel.setObjectName(u'ColorLabel')
     self.colorButton = QtGui.QPushButton(self.colorWidget)
     self.colorButton.setObjectName(u'ColorButton')
     self.colorLayout.addRow(self.colorLabel, self.colorButton)
     self.colorLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
     self.backgroundStack.addWidget(self.colorWidget)
     self.gradientWidget = QtGui.QWidget(self.backgroundPage)
     self.gradientWidget.setObjectName(u'GradientWidget')
     self.gradientLayout = QtGui.QFormLayout(self.gradientWidget)
     self.gradientLayout.setMargin(0)
     self.gradientLayout.setObjectName(u'GradientLayout')
     self.gradientStartLabel = QtGui.QLabel(self.gradientWidget)
     self.gradientStartLabel.setObjectName(u'GradientStartLabel')
     self.gradientStartButton = QtGui.QPushButton(self.gradientWidget)
     self.gradientStartButton.setObjectName(u'GradientStartButton')
     self.gradientLayout.addRow(self.gradientStartLabel, self.gradientStartButton)
     self.gradientEndLabel = QtGui.QLabel(self.gradientWidget)
     self.gradientEndLabel.setObjectName(u'GradientEndLabel')
     self.gradientEndButton = QtGui.QPushButton(self.gradientWidget)
     self.gradientEndButton.setObjectName(u'GradientEndButton')
     self.gradientLayout.addRow(self.gradientEndLabel, self.gradientEndButton)
     self.gradientTypeLabel = QtGui.QLabel(self.gradientWidget)
     self.gradientTypeLabel.setObjectName(u'GradientTypeLabel')
     self.gradientComboBox = QtGui.QComboBox(self.gradientWidget)
     self.gradientComboBox.setObjectName(u'GradientComboBox')
     self.gradientComboBox.addItems([u'', u'', u'', u'', u''])
     self.gradientLayout.addRow(self.gradientTypeLabel, self.gradientComboBox)
     self.gradientLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
     self.backgroundStack.addWidget(self.gradientWidget)
     self.imageWidget = QtGui.QWidget(self.backgroundPage)
     self.imageWidget.setObjectName(u'ImageWidget')
     self.imageLayout = QtGui.QFormLayout(self.imageWidget)
     self.imageLayout.setMargin(0)
     self.imageLayout.setObjectName(u'ImageLayout')
     self.imageColorLabel = QtGui.QLabel(self.colorWidget)
     self.imageColorLabel.setObjectName(u'ImageColorLabel')
     self.imageColorButton = QtGui.QPushButton(self.colorWidget)
     self.imageColorButton.setObjectName(u'ImageColorButton')
     self.imageLayout.addRow(self.imageColorLabel, self.imageColorButton)
     self.imageLabel = QtGui.QLabel(self.imageWidget)
     self.imageLabel.setObjectName(u'ImageLabel')
     self.imageFileLayout = QtGui.QHBoxLayout()
     self.imageFileLayout.setObjectName(u'ImageFileLayout')
     self.imageFileEdit = QtGui.QLineEdit(self.imageWidget)
     self.imageFileEdit.setObjectName(u'ImageFileEdit')
     self.imageFileLayout.addWidget(self.imageFileEdit)
     self.imageBrowseButton = QtGui.QToolButton(self.imageWidget)
     self.imageBrowseButton.setObjectName(u'ImageBrowseButton')
     self.imageBrowseButton.setIcon(build_icon(u':/general/general_open.png'))
     self.imageFileLayout.addWidget(self.imageBrowseButton)
     self.imageLayout.addRow(self.imageLabel, self.imageFileLayout)
     self.imageLayout.setItem(2, QtGui.QFormLayout.LabelRole, self.spacer)
     self.backgroundStack.addWidget(self.imageWidget)
     self.transparentWidget = QtGui.QWidget(self.backgroundPage)
     self.transparentWidget.setObjectName(u'TransparentWidget')
     self.transparentLayout = QtGui.QFormLayout(self.transparentWidget)
     self.transparentLayout.setMargin(0)
     self.transparentLayout.setObjectName(u'TransparentLayout')
     self.backgroundStack.addWidget(self.transparentWidget)
     self.backgroundLayout.addLayout(self.backgroundStack)
     themeWizard.addPage(self.backgroundPage)
     # Main Area Page
     self.mainAreaPage = QtGui.QWizardPage()
     self.mainAreaPage.setObjectName(u'MainAreaPage')
     self.mainAreaLayout = QtGui.QFormLayout(self.mainAreaPage)
     self.mainAreaLayout.setObjectName(u'MainAreaLayout')
     self.mainFontLabel = QtGui.QLabel(self.mainAreaPage)
     self.mainFontLabel.setObjectName(u'MainFontLabel')
     self.mainFontComboBox = QtGui.QFontComboBox(self.mainAreaPage)
     self.mainFontComboBox.setObjectName(u'MainFontComboBox')
     self.mainAreaLayout.addRow(self.mainFontLabel, self.mainFontComboBox)
     self.mainColorLabel = QtGui.QLabel(self.mainAreaPage)
     self.mainColorLabel.setObjectName(u'MainColorLabel')
     self.mainPropertiesLayout = QtGui.QHBoxLayout()
     self.mainPropertiesLayout.setObjectName(u'MainPropertiesLayout')
     self.mainColorButton = QtGui.QPushButton(self.mainAreaPage)
     self.mainColorButton.setObjectName(u'MainColorButton')
     self.mainPropertiesLayout.addWidget(self.mainColorButton)
     self.mainPropertiesLayout.addSpacing(20)
     self.mainBoldCheckBox = QtGui.QCheckBox(self.mainAreaPage)
     self.mainBoldCheckBox.setObjectName(u'MainBoldCheckBox')
     self.mainPropertiesLayout.addWidget(self.mainBoldCheckBox)
     self.mainPropertiesLayout.addSpacing(20)
     self.mainItalicsCheckBox = QtGui.QCheckBox(self.mainAreaPage)
     self.mainItalicsCheckBox.setObjectName(u'MainItalicsCheckBox')
     self.mainPropertiesLayout.addWidget(self.mainItalicsCheckBox)
     self.mainAreaLayout.addRow(self.mainColorLabel, self.mainPropertiesLayout)
     self.mainSizeLabel = QtGui.QLabel(self.mainAreaPage)
     self.mainSizeLabel.setObjectName(u'MainSizeLabel')
     self.mainSizeLayout = QtGui.QHBoxLayout()
     self.mainSizeLayout.setObjectName(u'MainSizeLayout')
     self.mainSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage)
     self.mainSizeSpinBox.setMaximum(999)
     self.mainSizeSpinBox.setValue(16)
     self.mainSizeSpinBox.setObjectName(u'MainSizeSpinBox')
     self.mainSizeLayout.addWidget(self.mainSizeSpinBox)
     self.mainLineCountLabel = QtGui.QLabel(self.mainAreaPage)
     self.mainLineCountLabel.setObjectName(u'MainLineCountLabel')
     self.mainSizeLayout.addWidget(self.mainLineCountLabel)
     self.mainAreaLayout.addRow(self.mainSizeLabel, self.mainSizeLayout)
     self.lineSpacingLabel = QtGui.QLabel(self.mainAreaPage)
     self.lineSpacingLabel.setObjectName(u'LineSpacingLabel')
     self.lineSpacingSpinBox = QtGui.QSpinBox(self.mainAreaPage)
     self.lineSpacingSpinBox.setMinimum(-50)
     self.lineSpacingSpinBox.setMaximum(50)
     self.lineSpacingSpinBox.setObjectName(u'LineSpacingSpinBox')
     self.mainAreaLayout.addRow(self.lineSpacingLabel, self.lineSpacingSpinBox)
     self.outlineCheckBox = QtGui.QCheckBox(self.mainAreaPage)
     self.outlineCheckBox.setObjectName(u'OutlineCheckBox')
     self.outlineLayout = QtGui.QHBoxLayout()
     self.outlineLayout.setObjectName(u'OutlineLayout')
     self.outlineColorButton = QtGui.QPushButton(self.mainAreaPage)
     self.outlineColorButton.setEnabled(False)
     self.outlineColorButton.setObjectName(u'OutlineColorButton')
     self.outlineLayout.addWidget(self.outlineColorButton)
     self.outlineLayout.addSpacing(20)
     self.outlineSizeLabel = QtGui.QLabel(self.mainAreaPage)
     self.outlineSizeLabel.setObjectName(u'OutlineSizeLabel')
     self.outlineLayout.addWidget(self.outlineSizeLabel)
     self.outlineSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage)
     self.outlineSizeSpinBox.setEnabled(False)
     self.outlineSizeSpinBox.setObjectName(u'OutlineSizeSpinBox')
     self.outlineLayout.addWidget(self.outlineSizeSpinBox)
     self.mainAreaLayout.addRow(self.outlineCheckBox, self.outlineLayout)
     self.shadowCheckBox = QtGui.QCheckBox(self.mainAreaPage)
     self.shadowCheckBox.setObjectName(u'ShadowCheckBox')
     self.shadowLayout = QtGui.QHBoxLayout()
     self.shadowLayout.setObjectName(u'ShadowLayout')
     self.shadowColorButton = QtGui.QPushButton(self.mainAreaPage)
     self.shadowColorButton.setEnabled(False)
     self.shadowColorButton.setObjectName(u'shadowColorButton')
     self.shadowLayout.addWidget(self.shadowColorButton)
     self.shadowLayout.addSpacing(20)
     self.shadowSizeLabel = QtGui.QLabel(self.mainAreaPage)
     self.shadowSizeLabel.setObjectName(u'ShadowSizeLabel')
     self.shadowLayout.addWidget(self.shadowSizeLabel)
     self.shadowSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage)
     self.shadowSizeSpinBox.setEnabled(False)
     self.shadowSizeSpinBox.setObjectName(u'ShadowSizeSpinBox')
     self.shadowLayout.addWidget(self.shadowSizeSpinBox)
     self.mainAreaLayout.addRow(self.shadowCheckBox, self.shadowLayout)
     themeWizard.addPage(self.mainAreaPage)
     # Footer Area Page
     self.footerAreaPage = QtGui.QWizardPage()
     self.footerAreaPage.setObjectName(u'FooterAreaPage')
     self.footerAreaLayout = QtGui.QFormLayout(self.footerAreaPage)
     self.footerAreaLayout.setObjectName(u'FooterAreaLayout')
     self.footerFontLabel = QtGui.QLabel(self.footerAreaPage)
     self.footerFontLabel.setObjectName(u'FooterFontLabel')
     self.footerFontComboBox = QtGui.QFontComboBox(self.footerAreaPage)
     self.footerFontComboBox.setObjectName(u'footerFontComboBox')
     self.footerAreaLayout.addRow(self.footerFontLabel, self.footerFontComboBox)
     self.footerColorLabel = QtGui.QLabel(self.footerAreaPage)
     self.footerColorLabel.setObjectName(u'FooterColorLabel')
     self.footerColorButton = QtGui.QPushButton(self.footerAreaPage)
     self.footerColorButton.setObjectName(u'footerColorButton')
     self.footerAreaLayout.addRow(self.footerColorLabel, self.footerColorButton)
     self.footerSizeLabel = QtGui.QLabel(self.footerAreaPage)
     self.footerSizeLabel.setObjectName(u'FooterSizeLabel')
     self.footerSizeSpinBox = QtGui.QSpinBox(self.footerAreaPage)
     self.footerSizeSpinBox.setMaximum(999)
     self.footerSizeSpinBox.setValue(10)
     self.footerSizeSpinBox.setObjectName(u'FooterSizeSpinBox')
     self.footerAreaLayout.addRow(self.footerSizeLabel, self.footerSizeSpinBox)
     self.footerAreaLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
     themeWizard.addPage(self.footerAreaPage)
     # Alignment Page
     self.alignmentPage = QtGui.QWizardPage()
     self.alignmentPage.setObjectName(u'AlignmentPage')
     self.alignmentLayout = QtGui.QFormLayout(self.alignmentPage)
     self.alignmentLayout.setObjectName(u'AlignmentLayout')
     self.horizontalLabel = QtGui.QLabel(self.alignmentPage)
     self.horizontalLabel.setObjectName(u'HorizontalLabel')
     self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage)
     self.horizontalComboBox.addItems([u'', u'', u'', u''])
     self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
     self.alignmentLayout.addRow(self.horizontalLabel, self.horizontalComboBox)
     self.verticalLabel, self.verticalComboBox = create_valign_selection_widgets(self.alignmentPage)
     self.verticalLabel.setObjectName(u'verticalLabel')
     self.verticalComboBox.setObjectName(u'verticalComboBox')
     self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox)
     self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
     self.transitionsLabel.setObjectName(u'TransitionsLabel')
     self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
     self.transitionsCheckBox.setObjectName(u'TransitionsCheckBox')
     self.alignmentLayout.addRow(self.transitionsLabel, self.transitionsCheckBox)
     self.alignmentLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
     themeWizard.addPage(self.alignmentPage)
     # Area Position Page
     self.areaPositionPage = QtGui.QWizardPage()
     self.areaPositionPage.setObjectName(u'AreaPositionPage')
     self.areaPositionLayout = QtGui.QHBoxLayout(self.areaPositionPage)
     self.areaPositionLayout.setObjectName(u'AreaPositionLayout')
     self.mainPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage)
     self.mainPositionGroupBox.setObjectName(u'MainPositionGroupBox')
     self.mainPositionLayout = QtGui.QFormLayout(self.mainPositionGroupBox)
     self.mainPositionLayout.setObjectName(u'MainPositionLayout')
     self.mainPositionCheckBox = QtGui.QCheckBox(self.mainPositionGroupBox)
     self.mainPositionCheckBox.setObjectName(u'MainPositionCheckBox')
     self.mainPositionLayout.addRow(self.mainPositionCheckBox)
     self.mainXLabel = QtGui.QLabel(self.mainPositionGroupBox)
     self.mainXLabel.setObjectName(u'MainXLabel')
     self.mainXSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
     self.mainXSpinBox.setMaximum(9999)
     self.mainXSpinBox.setObjectName(u'MainXSpinBox')
     self.mainPositionLayout.addRow(self.mainXLabel, self.mainXSpinBox)
     self.mainYLabel = QtGui.QLabel(self.mainPositionGroupBox)
     self.mainYLabel.setObjectName(u'MainYLabel')
     self.mainYSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
     self.mainYSpinBox.setMaximum(9999)
     self.mainYSpinBox.setObjectName(u'MainYSpinBox')
     self.mainPositionLayout.addRow(self.mainYLabel, self.mainYSpinBox)
     self.mainWidthLabel = QtGui.QLabel(self.mainPositionGroupBox)
     self.mainWidthLabel.setObjectName(u'MainWidthLabel')
     self.mainWidthSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
     self.mainWidthSpinBox.setMaximum(9999)
     self.mainWidthSpinBox.setObjectName(u'MainWidthSpinBox')
     self.mainPositionLayout.addRow(self.mainWidthLabel, self.mainWidthSpinBox)
     self.mainHeightLabel = QtGui.QLabel(self.mainPositionGroupBox)
     self.mainHeightLabel.setObjectName(u'MainHeightLabel')
     self.mainHeightSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox)
     self.mainHeightSpinBox.setMaximum(9999)
     self.mainHeightSpinBox.setObjectName(u'MainHeightSpinBox')
     self.mainPositionLayout.addRow(self.mainHeightLabel, self.mainHeightSpinBox)
     self.areaPositionLayout.addWidget(self.mainPositionGroupBox)
     self.footerPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage)
     self.footerPositionGroupBox.setObjectName(u'FooterPositionGroupBox')
     self.footerPositionLayout = QtGui.QFormLayout(self.footerPositionGroupBox)
     self.footerPositionLayout.setObjectName(u'FooterPositionLayout')
     self.footerPositionCheckBox = QtGui.QCheckBox(self.footerPositionGroupBox)
     self.footerPositionCheckBox.setObjectName(u'FooterPositionCheckBox')
     self.footerPositionLayout.addRow(self.footerPositionCheckBox)
     self.footerXLabel = QtGui.QLabel(self.footerPositionGroupBox)
     self.footerXLabel.setObjectName(u'FooterXLabel')
     self.footerXSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
     self.footerXSpinBox.setMaximum(9999)
     self.footerXSpinBox.setObjectName(u'FooterXSpinBox')
     self.footerPositionLayout.addRow(self.footerXLabel, self.footerXSpinBox)
     self.footerYLabel = QtGui.QLabel(self.footerPositionGroupBox)
     self.footerYLabel.setObjectName(u'FooterYLabel')
     self.footerYSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
     self.footerYSpinBox.setMaximum(9999)
     self.footerYSpinBox.setObjectName(u'FooterYSpinBox')
     self.footerPositionLayout.addRow(self.footerYLabel, self.footerYSpinBox)
     self.footerWidthLabel = QtGui.QLabel(self.footerPositionGroupBox)
     self.footerWidthLabel.setObjectName(u'FooterWidthLabel')
     self.footerWidthSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
     self.footerWidthSpinBox.setMaximum(9999)
     self.footerWidthSpinBox.setObjectName(u'FooterWidthSpinBox')
     self.footerPositionLayout.addRow(self.footerWidthLabel, self.footerWidthSpinBox)
     self.footerHeightLabel = QtGui.QLabel(self.footerPositionGroupBox)
     self.footerHeightLabel.setObjectName(u'FooterHeightLabel')
     self.footerHeightSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox)
     self.footerHeightSpinBox.setMaximum(9999)
     self.footerHeightSpinBox.setObjectName(u'FooterHeightSpinBox')
     self.footerPositionLayout.addRow(self.footerHeightLabel, self.footerHeightSpinBox)
     self.areaPositionLayout.addWidget(self.footerPositionGroupBox)
     themeWizard.addPage(self.areaPositionPage)
     # Preview Page
     self.previewPage = QtGui.QWizardPage()
     self.previewPage.setObjectName(u'PreviewPage')
     self.previewLayout = QtGui.QVBoxLayout(self.previewPage)
     self.previewLayout.setObjectName(u'PreviewLayout')
     self.themeNameLayout = QtGui.QFormLayout()
     self.themeNameLayout.setObjectName(u'ThemeNameLayout')
     self.themeNameLabel = QtGui.QLabel(self.previewPage)
     self.themeNameLabel.setObjectName(u'ThemeNameLabel')
     self.themeNameEdit = QtGui.QLineEdit(self.previewPage)
     self.themeNameEdit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
     self.themeNameEdit.setObjectName(u'ThemeNameEdit')
     self.themeNameLayout.addRow(self.themeNameLabel, self.themeNameEdit)
     self.previewLayout.addLayout(self.themeNameLayout)
     self.previewArea = QtGui.QWidget(self.previewPage)
     self.previewArea.setObjectName(u'PreviewArea')
     self.previewAreaLayout = QtGui.QGridLayout(self.previewArea)
     self.previewAreaLayout.setMargin(0)
     self.previewAreaLayout.setColumnStretch(0, 1)
     self.previewAreaLayout.setRowStretch(0, 1)
     self.previewAreaLayout.setObjectName(u'PreviewAreaLayout')
     self.previewBoxLabel = QtGui.QLabel(self.previewArea)
     self.previewBoxLabel.setFrameShape(QtGui.QFrame.Box)
     self.previewBoxLabel.setScaledContents(True)
     self.previewBoxLabel.setObjectName(u'PreviewBoxLabel')
     self.previewAreaLayout.addWidget(self.previewBoxLabel)
     self.previewLayout.addWidget(self.previewArea)
     themeWizard.addPage(self.previewPage)
     self.retranslateUi(themeWizard)
     QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'),
         self.backgroundStack, QtCore.SLOT(u'setCurrentIndex(int)'))
     QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.outlineColorButton,
         QtCore.SLOT(u'setEnabled(bool)'))
     QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.outlineSizeSpinBox,
         QtCore.SLOT(u'setEnabled(bool)'))
     QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.shadowColorButton,
         QtCore.SLOT(u'setEnabled(bool)'))
     QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.shadowSizeSpinBox,
         QtCore.SLOT(u'setEnabled(bool)'))
     QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainXSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
     QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainYSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
     QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainWidthSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
     QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.mainHeightSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
     QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.footerXSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
     QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.footerYSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
     QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.footerWidthSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
     QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'toggled(bool)'), self.footerHeightSpinBox,
         QtCore.SLOT(u'setDisabled(bool)'))
Esempio n. 8
0
 def setupUi(self, theme_wizard):
     """
     Set up the UI
     """
     theme_wizard.setObjectName('OpenLP.ThemeWizard')
     theme_wizard.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
     theme_wizard.setModal(True)
     theme_wizard.setOptions(QtGui.QWizard.IndependentPages |
                             QtGui.QWizard.NoBackButtonOnStartPage | QtGui.QWizard.HaveCustomButton1)
     if is_macosx():
         theme_wizard.setPixmap(QtGui.QWizard.BackgroundPixmap, QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
         theme_wizard.resize(646, 400)
     else:
         theme_wizard.setWizardStyle(QtGui.QWizard.ModernStyle)
     self.spacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
     # Welcome Page
     add_welcome_page(theme_wizard, ':/wizards/wizard_createtheme.bmp')
     # Background Page
     self.background_page = QtGui.QWizardPage()
     self.background_page.setObjectName('background_page')
     self.background_layout = QtGui.QVBoxLayout(self.background_page)
     self.background_layout.setObjectName('background_layout')
     self.background_type_layout = QtGui.QFormLayout()
     self.background_type_layout.setObjectName('background_type_layout')
     self.background_label = QtGui.QLabel(self.background_page)
     self.background_label.setObjectName('background_label')
     self.background_combo_box = QtGui.QComboBox(self.background_page)
     self.background_combo_box.addItems(['', '', '', ''])
     self.background_combo_box.setObjectName('background_combo_box')
     self.background_type_layout.addRow(self.background_label, self.background_combo_box)
     self.background_type_layout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
     self.background_layout.addLayout(self.background_type_layout)
     self.background_stack = QtGui.QStackedLayout()
     self.background_stack.setObjectName('background_stack')
     self.color_widget = QtGui.QWidget(self.background_page)
     self.color_widget.setObjectName('color_widget')
     self.color_layout = QtGui.QFormLayout(self.color_widget)
     self.color_layout.setMargin(0)
     self.color_layout.setObjectName('color_layout')
     self.color_label = QtGui.QLabel(self.color_widget)
     self.color_label.setObjectName('color_label')
     self.color_button = ColorButton(self.color_widget)
     self.color_button.setObjectName('color_button')
     self.color_layout.addRow(self.color_label, self.color_button)
     self.color_layout.setItem(1, QtGui.QFormLayout.LabelRole, self.spacer)
     self.background_stack.addWidget(self.color_widget)
     self.gradient_widget = QtGui.QWidget(self.background_page)
     self.gradient_widget.setObjectName('Gradient_widget')
     self.gradient_layout = QtGui.QFormLayout(self.gradient_widget)
     self.gradient_layout.setMargin(0)
     self.gradient_layout.setObjectName('gradient_layout')
     self.gradient_start_label = QtGui.QLabel(self.gradient_widget)
     self.gradient_start_label.setObjectName('gradient_start_label')
     self.gradient_start_button = ColorButton(self.gradient_widget)
     self.gradient_start_button.setObjectName('gradient_start_button')
     self.gradient_layout.addRow(self.gradient_start_label, self.gradient_start_button)
     self.gradient_end_label = QtGui.QLabel(self.gradient_widget)
     self.gradient_end_label.setObjectName('gradient_end_label')
     self.gradient_end_button = ColorButton(self.gradient_widget)
     self.gradient_end_button.setObjectName('gradient_end_button')
     self.gradient_layout.addRow(self.gradient_end_label, self.gradient_end_button)
     self.gradient_type_label = QtGui.QLabel(self.gradient_widget)
     self.gradient_type_label.setObjectName('Gradient_type_label')
     self.gradient_combo_box = QtGui.QComboBox(self.gradient_widget)
     self.gradient_combo_box.setObjectName('gradient_combo_box')
     self.gradient_combo_box.addItems(['', '', '', '', ''])
     self.gradient_layout.addRow(self.gradient_type_label, self.gradient_combo_box)
     self.gradient_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
     self.background_stack.addWidget(self.gradient_widget)
     self.image_widget = QtGui.QWidget(self.background_page)
     self.image_widget.setObjectName('image_widget')
     self.image_layout = QtGui.QFormLayout(self.image_widget)
     self.image_layout.setMargin(0)
     self.image_layout.setObjectName('image_layout')
     self.image_color_label = QtGui.QLabel(self.color_widget)
     self.image_color_label.setObjectName('image_color_label')
     self.image_color_button = ColorButton(self.color_widget)
     self.image_color_button.setObjectName('image_color_button')
     self.image_layout.addRow(self.image_color_label, self.image_color_button)
     self.image_label = QtGui.QLabel(self.image_widget)
     self.image_label.setObjectName('image_label')
     self.image_file_layout = QtGui.QHBoxLayout()
     self.image_file_layout.setObjectName('image_file_layout')
     self.image_file_edit = QtGui.QLineEdit(self.image_widget)
     self.image_file_edit.setObjectName('image_file_edit')
     self.image_file_layout.addWidget(self.image_file_edit)
     self.image_browse_button = QtGui.QToolButton(self.image_widget)
     self.image_browse_button.setObjectName('image_browse_button')
     self.image_browse_button.setIcon(build_icon(':/general/general_open.png'))
     self.image_file_layout.addWidget(self.image_browse_button)
     self.image_layout.addRow(self.image_label, self.image_file_layout)
     self.image_layout.setItem(2, QtGui.QFormLayout.LabelRole, self.spacer)
     self.background_stack.addWidget(self.image_widget)
     self.transparent_widget = QtGui.QWidget(self.background_page)
     self.transparent_widget.setObjectName('TransparentWidget')
     self.transparent_layout = QtGui.QFormLayout(self.transparent_widget)
     self.transparent_layout.setMargin(0)
     self.transparent_layout.setObjectName('Transparent_layout')
     self.background_stack.addWidget(self.transparent_widget)
     self.background_layout.addLayout(self.background_stack)
     theme_wizard.addPage(self.background_page)
     # Main Area Page
     self.main_area_page = QtGui.QWizardPage()
     self.main_area_page.setObjectName('main_area_page')
     self.main_area_layout = QtGui.QFormLayout(self.main_area_page)
     self.main_area_layout.setObjectName('main_area_layout')
     self.main_font_label = QtGui.QLabel(self.main_area_page)
     self.main_font_label.setObjectName('main_font_label')
     self.main_font_combo_box = QtGui.QFontComboBox(self.main_area_page)
     self.main_font_combo_box.setObjectName('main_font_combo_box')
     self.main_area_layout.addRow(self.main_font_label, self.main_font_combo_box)
     self.main_color_label = QtGui.QLabel(self.main_area_page)
     self.main_color_label.setObjectName('main_color_label')
     self.main_properties_layout = QtGui.QHBoxLayout()
     self.main_properties_layout.setObjectName('main_properties_layout')
     self.main_color_button = ColorButton(self.main_area_page)
     self.main_color_button.setObjectName('main_color_button')
     self.main_properties_layout.addWidget(self.main_color_button)
     self.main_properties_layout.addSpacing(20)
     self.main_bold_check_box = QtGui.QCheckBox(self.main_area_page)
     self.main_bold_check_box.setObjectName('main_bold_check_box')
     self.main_properties_layout.addWidget(self.main_bold_check_box)
     self.main_properties_layout.addSpacing(20)
     self.main_italics_check_box = QtGui.QCheckBox(self.main_area_page)
     self.main_italics_check_box.setObjectName('MainItalicsCheckBox')
     self.main_properties_layout.addWidget(self.main_italics_check_box)
     self.main_area_layout.addRow(self.main_color_label, self.main_properties_layout)
     self.main_size_label = QtGui.QLabel(self.main_area_page)
     self.main_size_label.setObjectName('main_size_label')
     self.main_size_layout = QtGui.QHBoxLayout()
     self.main_size_layout.setObjectName('main_size_layout')
     self.main_size_spin_box = QtGui.QSpinBox(self.main_area_page)
     self.main_size_spin_box.setMaximum(999)
     self.main_size_spin_box.setValue(16)
     self.main_size_spin_box.setObjectName('main_size_spin_box')
     self.main_size_layout.addWidget(self.main_size_spin_box)
     self.main_line_count_label = QtGui.QLabel(self.main_area_page)
     self.main_line_count_label.setObjectName('main_line_count_label')
     self.main_size_layout.addWidget(self.main_line_count_label)
     self.main_area_layout.addRow(self.main_size_label, self.main_size_layout)
     self.line_spacing_label = QtGui.QLabel(self.main_area_page)
     self.line_spacing_label.setObjectName('line_spacing_label')
     self.line_spacing_spin_box = QtGui.QSpinBox(self.main_area_page)
     self.line_spacing_spin_box.setMinimum(-250)
     self.line_spacing_spin_box.setMaximum(250)
     self.line_spacing_spin_box.setObjectName('line_spacing_spin_box')
     self.main_area_layout.addRow(self.line_spacing_label, self.line_spacing_spin_box)
     self.outline_check_box = QtGui.QCheckBox(self.main_area_page)
     self.outline_check_box.setObjectName('outline_check_box')
     self.outline_layout = QtGui.QHBoxLayout()
     self.outline_layout.setObjectName('outline_layout')
     self.outline_color_button = ColorButton(self.main_area_page)
     self.outline_color_button.setEnabled(False)
     self.outline_color_button.setObjectName('Outline_color_button')
     self.outline_layout.addWidget(self.outline_color_button)
     self.outline_layout.addSpacing(20)
     self.outline_size_label = QtGui.QLabel(self.main_area_page)
     self.outline_size_label.setObjectName('outline_size_label')
     self.outline_layout.addWidget(self.outline_size_label)
     self.outline_size_spin_box = QtGui.QSpinBox(self.main_area_page)
     self.outline_size_spin_box.setEnabled(False)
     self.outline_size_spin_box.setObjectName('outline_size_spin_box')
     self.outline_layout.addWidget(self.outline_size_spin_box)
     self.main_area_layout.addRow(self.outline_check_box, self.outline_layout)
     self.shadow_check_box = QtGui.QCheckBox(self.main_area_page)
     self.shadow_check_box.setObjectName('shadow_check_box')
     self.shadow_layout = QtGui.QHBoxLayout()
     self.shadow_layout.setObjectName('shadow_layout')
     self.shadow_color_button = ColorButton(self.main_area_page)
     self.shadow_color_button.setEnabled(False)
     self.shadow_color_button.setObjectName('shadow_color_button')
     self.shadow_layout.addWidget(self.shadow_color_button)
     self.shadow_layout.addSpacing(20)
     self.shadow_size_label = QtGui.QLabel(self.main_area_page)
     self.shadow_size_label.setObjectName('shadow_size_label')
     self.shadow_layout.addWidget(self.shadow_size_label)
     self.shadow_size_spin_box = QtGui.QSpinBox(self.main_area_page)
     self.shadow_size_spin_box.setEnabled(False)
     self.shadow_size_spin_box.setObjectName('shadow_size_spin_box')
     self.shadow_layout.addWidget(self.shadow_size_spin_box)
     self.main_area_layout.addRow(self.shadow_check_box, self.shadow_layout)
     theme_wizard.addPage(self.main_area_page)
     # Footer Area Page
     self.footer_area_page = QtGui.QWizardPage()
     self.footer_area_page.setObjectName('footer_area_page')
     self.footer_area_layout = QtGui.QFormLayout(self.footer_area_page)
     self.footer_area_layout.setObjectName('footer_area_layout')
     self.footer_font_label = QtGui.QLabel(self.footer_area_page)
     self.footer_font_label.setObjectName('FooterFontLabel')
     self.footer_font_combo_box = QtGui.QFontComboBox(self.footer_area_page)
     self.footer_font_combo_box.setObjectName('footer_font_combo_box')
     self.footer_area_layout.addRow(self.footer_font_label, self.footer_font_combo_box)
     self.footer_color_label = QtGui.QLabel(self.footer_area_page)
     self.footer_color_label.setObjectName('footer_color_label')
     self.footer_color_button = ColorButton(self.footer_area_page)
     self.footer_color_button.setObjectName('footer_color_button')
     self.footer_area_layout.addRow(self.footer_color_label, self.footer_color_button)
     self.footer_size_label = QtGui.QLabel(self.footer_area_page)
     self.footer_size_label.setObjectName('footer_size_label')
     self.footer_size_spin_box = QtGui.QSpinBox(self.footer_area_page)
     self.footer_size_spin_box.setMaximum(999)
     self.footer_size_spin_box.setValue(10)
     self.footer_size_spin_box.setObjectName('FooterSizeSpinBox')
     self.footer_area_layout.addRow(self.footer_size_label, self.footer_size_spin_box)
     self.footer_area_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
     theme_wizard.addPage(self.footer_area_page)
     # Alignment Page
     self.alignment_page = QtGui.QWizardPage()
     self.alignment_page.setObjectName('alignment_page')
     self.alignment_layout = QtGui.QFormLayout(self.alignment_page)
     self.alignment_layout.setObjectName('alignment_layout')
     self.horizontal_label = QtGui.QLabel(self.alignment_page)
     self.horizontal_label.setObjectName('horizontal_label')
     self.horizontal_combo_box = QtGui.QComboBox(self.alignment_page)
     self.horizontal_combo_box.addItems(['', '', '', ''])
     self.horizontal_combo_box.setObjectName('horizontal_combo_box')
     self.alignment_layout.addRow(self.horizontal_label, self.horizontal_combo_box)
     self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self.alignment_page)
     self.vertical_label.setObjectName('vertical_label')
     self.vertical_combo_box.setObjectName('vertical_combo_box')
     self.alignment_layout.addRow(self.vertical_label, self.vertical_combo_box)
     self.transitions_label = QtGui.QLabel(self.alignment_page)
     self.transitions_label.setObjectName('transitions_label')
     self.transitions_check_box = QtGui.QCheckBox(self.alignment_page)
     self.transitions_check_box.setObjectName('transitions_check_box')
     self.alignment_layout.addRow(self.transitions_label, self.transitions_check_box)
     self.alignment_layout.setItem(3, QtGui.QFormLayout.LabelRole, self.spacer)
     theme_wizard.addPage(self.alignment_page)
     # Area Position Page
     self.area_position_page = QtGui.QWizardPage()
     self.area_position_page.setObjectName('area_position_page')
     self.area_position_layout = QtGui.QHBoxLayout(self.area_position_page)
     self.area_position_layout.setObjectName('area_position_layout')
     self.main_position_group_box = QtGui.QGroupBox(self.area_position_page)
     self.main_position_group_box.setObjectName('main_position_group_box')
     self.main_position_layout = QtGui.QFormLayout(self.main_position_group_box)
     self.main_position_layout.setObjectName('main_position_layout')
     self.main_position_check_box = QtGui.QCheckBox(self.main_position_group_box)
     self.main_position_check_box.setObjectName('main_position_check_box')
     self.main_position_layout.addRow(self.main_position_check_box)
     
     self.main_position_method_label = QtGui.QLabel(self.main_position_group_box)
     self.main_position_method_label.setObjectName('main_position_method_label')
     self.main_position_method = QtGui.QComboBox(self.main_position_group_box)
     self.main_position_method.addItems(['','',''])
     self.main_position_method.setObjectName('main_position_method')
     self.main_position_layout.addRow(self.main_position_method_label, self.main_position_method)
     
     self.main_x_label = QtGui.QLabel(self.main_position_group_box)
     self.main_x_label.setObjectName('main_x_label')
     self.main_x_spin_box = QtGui.QSpinBox(self.main_position_group_box)
     self.main_x_spin_box.setMaximum(9999)
     self.main_x_spin_box.setObjectName('main_x_spin_box')
     self.main_position_layout.addRow(self.main_x_label, self.main_x_spin_box)
     self.main_y_label = QtGui.QLabel(self.main_position_group_box)
     self.main_y_label.setObjectName('main_y_label')
     self.main_y_spin_box = QtGui.QSpinBox(self.main_position_group_box)
     self.main_y_spin_box.setMaximum(9999)
     self.main_y_spin_box.setObjectName('main_y_spin_box')
     self.main_position_layout.addRow(self.main_y_label, self.main_y_spin_box)
     self.main_width_label = QtGui.QLabel(self.main_position_group_box)
     self.main_width_label.setObjectName('main_width_label')
     self.main_width_spin_box = QtGui.QSpinBox(self.main_position_group_box)
     self.main_width_spin_box.setMaximum(9999)
     self.main_width_spin_box.setObjectName('main_width_spin_box')
     self.main_position_layout.addRow(self.main_width_label, self.main_width_spin_box)
     self.main_height_label = QtGui.QLabel(self.main_position_group_box)
     self.main_height_label.setObjectName('main_height_label')
     self.main_height_spin_box = QtGui.QSpinBox(self.main_position_group_box)
     self.main_height_spin_box.setMaximum(9999)
     self.main_height_spin_box.setObjectName('main_height_spin_box')
     self.main_position_layout.addRow(self.main_height_label, self.main_height_spin_box)
     self.area_position_layout.addWidget(self.main_position_group_box)
     self.footer_position_group_box = QtGui.QGroupBox(self.area_position_page)
     self.footer_position_group_box.setObjectName('footer_position_group_box')
     self.footer_position_layout = QtGui.QFormLayout(self.footer_position_group_box)
     self.footer_position_layout.setObjectName('footer_position_layout')
     self.footer_position_check_box = QtGui.QCheckBox(self.footer_position_group_box)
     self.footer_position_check_box.setObjectName('footer_position_check_box')
     self.footer_position_layout.addRow(self.footer_position_check_box)
     self.footer_x_label = QtGui.QLabel(self.footer_position_group_box)
     self.footer_x_label.setObjectName('footer_x_label')
     self.footer_x_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
     self.footer_x_spin_box.setMaximum(9999)
     self.footer_x_spin_box.setObjectName('footer_x_spin_box')
     self.footer_position_layout.addRow(self.footer_x_label, self.footer_x_spin_box)
     self.footer_y_label = QtGui.QLabel(self.footer_position_group_box)
     self.footer_y_label.setObjectName('footer_y_label')
     self.footer_y_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
     self.footer_y_spin_box.setMaximum(9999)
     self.footer_y_spin_box.setObjectName('footer_y_spin_box')
     self.footer_position_layout.addRow(self.footer_y_label, self.footer_y_spin_box)
     self.footer_width_label = QtGui.QLabel(self.footer_position_group_box)
     self.footer_width_label.setObjectName('footer_width_label')
     self.footer_width_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
     self.footer_width_spin_box.setMaximum(9999)
     self.footer_width_spin_box.setObjectName('footer_width_spin_box')
     self.footer_position_layout.addRow(self.footer_width_label, self.footer_width_spin_box)
     self.footer_height_label = QtGui.QLabel(self.footer_position_group_box)
     self.footer_height_label.setObjectName('footer_height_label')
     self.footer_height_spin_box = QtGui.QSpinBox(self.footer_position_group_box)
     self.footer_height_spin_box.setMaximum(9999)
     self.footer_height_spin_box.setObjectName('footer_height_spin_box')
     self.footer_position_layout.addRow(self.footer_height_label, self.footer_height_spin_box)
     self.area_position_layout.addWidget(self.footer_position_group_box)
     theme_wizard.addPage(self.area_position_page)
     # Preview Page
     self.preview_page = QtGui.QWizardPage()
     self.preview_page.setObjectName('preview_page')
     self.preview_layout = QtGui.QVBoxLayout(self.preview_page)
     self.preview_layout.setObjectName('preview_layout')
     self.theme_name_layout = QtGui.QFormLayout()
     self.theme_name_layout.setObjectName('theme_name_layout')
     self.theme_name_label = QtGui.QLabel(self.preview_page)
     self.theme_name_label.setObjectName('theme_name_label')
     self.theme_name_edit = QtGui.QLineEdit(self.preview_page)
     self.theme_name_edit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
     self.theme_name_edit.setObjectName('ThemeNameEdit')
     self.theme_name_layout.addRow(self.theme_name_label, self.theme_name_edit)
     self.preview_layout.addLayout(self.theme_name_layout)
     self.preview_area = QtGui.QWidget(self.preview_page)
     self.preview_area.setObjectName('PreviewArea')
     self.preview_area_layout = QtGui.QGridLayout(self.preview_area)
     self.preview_area_layout.setMargin(0)
     self.preview_area_layout.setColumnStretch(0, 1)
     self.preview_area_layout.setRowStretch(0, 1)
     self.preview_area_layout.setObjectName('preview_area_layout')
     self.preview_box_label = QtGui.QLabel(self.preview_area)
     self.preview_box_label.setFrameShape(QtGui.QFrame.Box)
     self.preview_box_label.setScaledContents(True)
     self.preview_box_label.setObjectName('preview_box_label')
     self.preview_area_layout.addWidget(self.preview_box_label)
     self.preview_layout.addWidget(self.preview_area)
     theme_wizard.addPage(self.preview_page)
     self.retranslateUi(theme_wizard)
     QtCore.QObject.connect(self.background_combo_box, QtCore.SIGNAL('currentIndexChanged(int)'),
                            self.background_stack, QtCore.SLOT('setCurrentIndex(int)'))
     QtCore.QObject.connect(self.outline_check_box, QtCore.SIGNAL('toggled(bool)'), self.outline_color_button,
                            QtCore.SLOT('setEnabled(bool)'))
     QtCore.QObject.connect(self.outline_check_box, QtCore.SIGNAL('toggled(bool)'), self.outline_size_spin_box,
                            QtCore.SLOT('setEnabled(bool)'))
     QtCore.QObject.connect(self.shadow_check_box, QtCore.SIGNAL('toggled(bool)'), self.shadow_color_button,
                            QtCore.SLOT('setEnabled(bool)'))
     QtCore.QObject.connect(self.shadow_check_box, QtCore.SIGNAL('toggled(bool)'), self.shadow_size_spin_box,
                            QtCore.SLOT('setEnabled(bool)'))
     QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_position_method,
                            QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_x_spin_box,
                            QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_y_spin_box,
                            QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_width_spin_box,
                            QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.main_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.main_height_spin_box,
                            QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.footer_x_spin_box,
                            QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'), self.footer_y_spin_box,
                            QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'),
                            self.footer_width_spin_box, QtCore.SLOT('setDisabled(bool)'))
     QtCore.QObject.connect(self.footer_position_check_box, QtCore.SIGNAL('toggled(bool)'),
                            self.footer_height_spin_box, QtCore.SLOT('setDisabled(bool)'))
Esempio n. 9
0
 def setupUi(self, theme_wizard):
     """
     Set up the UI
     """
     theme_wizard.setObjectName('OpenLP.ThemeWizard')
     theme_wizard.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
     theme_wizard.setModal(True)
     theme_wizard.setOptions(QtWidgets.QWizard.IndependentPages |
                             QtWidgets.QWizard.NoBackButtonOnStartPage | QtWidgets.QWizard.HaveCustomButton1)
     theme_wizard.setFixedWidth(640)
     if is_macosx():
         theme_wizard.setPixmap(QtWidgets.QWizard.BackgroundPixmap, QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
     else:
         theme_wizard.setWizardStyle(QtWidgets.QWizard.ModernStyle)
     self.spacer = QtWidgets.QSpacerItem(10, 0, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
     # Welcome Page
     add_welcome_page(theme_wizard, ':/wizards/wizard_createtheme.bmp')
     # Background Page
     self.background_page = QtWidgets.QWizardPage()
     self.background_page.setObjectName('background_page')
     self.background_layout = QtWidgets.QVBoxLayout(self.background_page)
     self.background_layout.setObjectName('background_layout')
     self.background_type_layout = QtWidgets.QFormLayout()
     self.background_type_layout.setObjectName('background_type_layout')
     self.background_label = QtWidgets.QLabel(self.background_page)
     self.background_label.setObjectName('background_label')
     self.background_combo_box = QtWidgets.QComboBox(self.background_page)
     self.background_combo_box.addItems(['', '', '', ''])
     self.background_combo_box.setObjectName('background_combo_box')
     self.background_type_layout.addRow(self.background_label, self.background_combo_box)
     self.background_type_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacer)
     self.background_layout.addLayout(self.background_type_layout)
     self.background_stack = QtWidgets.QStackedLayout()
     self.background_stack.setObjectName('background_stack')
     self.color_widget = QtWidgets.QWidget(self.background_page)
     self.color_widget.setObjectName('color_widget')
     self.color_layout = QtWidgets.QFormLayout(self.color_widget)
     self.color_layout.setContentsMargins(0, 0, 0, 0)
     self.color_layout.setObjectName('color_layout')
     self.color_label = QtWidgets.QLabel(self.color_widget)
     self.color_label.setObjectName('color_label')
     self.color_button = ColorButton(self.color_widget)
     self.color_button.setObjectName('color_button')
     self.color_layout.addRow(self.color_label, self.color_button)
     self.color_layout.setItem(1, QtWidgets.QFormLayout.LabelRole, self.spacer)
     self.background_stack.addWidget(self.color_widget)
     self.gradient_widget = QtWidgets.QWidget(self.background_page)
     self.gradient_widget.setObjectName('Gradient_widget')
     self.gradient_layout = QtWidgets.QFormLayout(self.gradient_widget)
     self.gradient_layout.setContentsMargins(0, 0, 0, 0)
     self.gradient_layout.setObjectName('gradient_layout')
     self.gradient_start_label = QtWidgets.QLabel(self.gradient_widget)
     self.gradient_start_label.setObjectName('gradient_start_label')
     self.gradient_start_button = ColorButton(self.gradient_widget)
     self.gradient_start_button.setObjectName('gradient_start_button')
     self.gradient_layout.addRow(self.gradient_start_label, self.gradient_start_button)
     self.gradient_end_label = QtWidgets.QLabel(self.gradient_widget)
     self.gradient_end_label.setObjectName('gradient_end_label')
     self.gradient_end_button = ColorButton(self.gradient_widget)
     self.gradient_end_button.setObjectName('gradient_end_button')
     self.gradient_layout.addRow(self.gradient_end_label, self.gradient_end_button)
     self.gradient_type_label = QtWidgets.QLabel(self.gradient_widget)
     self.gradient_type_label.setObjectName('Gradient_type_label')
     self.gradient_combo_box = QtWidgets.QComboBox(self.gradient_widget)
     self.gradient_combo_box.setObjectName('gradient_combo_box')
     self.gradient_combo_box.addItems(['', '', '', '', ''])
     self.gradient_layout.addRow(self.gradient_type_label, self.gradient_combo_box)
     self.gradient_layout.setItem(3, QtWidgets.QFormLayout.LabelRole, self.spacer)
     self.background_stack.addWidget(self.gradient_widget)
     self.image_widget = QtWidgets.QWidget(self.background_page)
     self.image_widget.setObjectName('image_widget')
     self.image_layout = QtWidgets.QFormLayout(self.image_widget)
     self.image_layout.setContentsMargins(0, 0, 0, 0)
     self.image_layout.setObjectName('image_layout')
     self.image_color_label = QtWidgets.QLabel(self.color_widget)
     self.image_color_label.setObjectName('image_color_label')
     self.image_color_button = ColorButton(self.color_widget)
     self.image_color_button.setObjectName('image_color_button')
     self.image_layout.addRow(self.image_color_label, self.image_color_button)
     self.image_label = QtWidgets.QLabel(self.image_widget)
     self.image_label.setObjectName('image_label')
     self.image_file_layout = QtWidgets.QHBoxLayout()
     self.image_file_layout.setObjectName('image_file_layout')
     self.image_file_edit = QtWidgets.QLineEdit(self.image_widget)
     self.image_file_edit.setObjectName('image_file_edit')
     self.image_file_layout.addWidget(self.image_file_edit)
     self.image_browse_button = QtWidgets.QToolButton(self.image_widget)
     self.image_browse_button.setObjectName('image_browse_button')
     self.image_browse_button.setIcon(build_icon(':/general/general_open.png'))
     self.image_file_layout.addWidget(self.image_browse_button)
     self.image_layout.addRow(self.image_label, self.image_file_layout)
     self.image_layout.setItem(2, QtWidgets.QFormLayout.LabelRole, self.spacer)
     self.background_stack.addWidget(self.image_widget)
     self.transparent_widget = QtWidgets.QWidget(self.background_page)
     self.transparent_widget.setObjectName('TransparentWidget')
     self.transparent_layout = QtWidgets.QFormLayout(self.transparent_widget)
     self.transparent_layout.setContentsMargins(0, 0, 0, 0)
     self.transparent_layout.setObjectName('Transparent_layout')
     self.background_stack.addWidget(self.transparent_widget)
     self.background_layout.addLayout(self.background_stack)
     theme_wizard.addPage(self.background_page)
     # Main Area Page
     self.main_area_page = QtWidgets.QWizardPage()
     self.main_area_page.setObjectName('main_area_page')
     self.main_area_layout = QtWidgets.QFormLayout(self.main_area_page)
     self.main_area_layout.setObjectName('main_area_layout')
     self.main_font_label = QtWidgets.QLabel(self.main_area_page)
     self.main_font_label.setObjectName('main_font_label')
     self.main_font_combo_box = QtWidgets.QFontComboBox(self.main_area_page)
     self.main_font_combo_box.setObjectName('main_font_combo_box')
     self.main_area_layout.addRow(self.main_font_label, self.main_font_combo_box)
     self.main_color_label = QtWidgets.QLabel(self.main_area_page)
     self.main_color_label.setObjectName('main_color_label')
     self.main_properties_layout = QtWidgets.QHBoxLayout()
     self.main_properties_layout.setObjectName('main_properties_layout')
     self.main_color_button = ColorButton(self.main_area_page)
     self.main_color_button.setObjectName('main_color_button')
     self.main_properties_layout.addWidget(self.main_color_button)
     self.main_properties_layout.addSpacing(20)
     self.main_bold_check_box = QtWidgets.QCheckBox(self.main_area_page)
     self.main_bold_check_box.setObjectName('main_bold_check_box')
     self.main_properties_layout.addWidget(self.main_bold_check_box)
     self.main_properties_layout.addSpacing(20)
     self.main_italics_check_box = QtWidgets.QCheckBox(self.main_area_page)
     self.main_italics_check_box.setObjectName('MainItalicsCheckBox')
     self.main_properties_layout.addWidget(self.main_italics_check_box)
     self.main_area_layout.addRow(self.main_color_label, self.main_properties_layout)
     self.main_size_label = QtWidgets.QLabel(self.main_area_page)
     self.main_size_label.setObjectName('main_size_label')
     self.main_size_layout = QtWidgets.QHBoxLayout()
     self.main_size_layout.setObjectName('main_size_layout')
     self.main_size_spin_box = QtWidgets.QSpinBox(self.main_area_page)
     self.main_size_spin_box.setMaximum(999)
     self.main_size_spin_box.setValue(16)
     self.main_size_spin_box.setObjectName('main_size_spin_box')
     self.main_size_layout.addWidget(self.main_size_spin_box)
     self.main_line_count_label = QtWidgets.QLabel(self.main_area_page)
     self.main_line_count_label.setObjectName('main_line_count_label')
     self.main_size_layout.addWidget(self.main_line_count_label)
     self.main_area_layout.addRow(self.main_size_label, self.main_size_layout)
     self.line_spacing_label = QtWidgets.QLabel(self.main_area_page)
     self.line_spacing_label.setObjectName('line_spacing_label')
     self.line_spacing_spin_box = QtWidgets.QSpinBox(self.main_area_page)
     self.line_spacing_spin_box.setMinimum(-250)
     self.line_spacing_spin_box.setMaximum(250)
     self.line_spacing_spin_box.setObjectName('line_spacing_spin_box')
     self.main_area_layout.addRow(self.line_spacing_label, self.line_spacing_spin_box)
     self.outline_check_box = QtWidgets.QCheckBox(self.main_area_page)
     self.outline_check_box.setObjectName('outline_check_box')
     self.outline_layout = QtWidgets.QHBoxLayout()
     self.outline_layout.setObjectName('outline_layout')
     self.outline_color_button = ColorButton(self.main_area_page)
     self.outline_color_button.setEnabled(False)
     self.outline_color_button.setObjectName('Outline_color_button')
     self.outline_layout.addWidget(self.outline_color_button)
     self.outline_layout.addSpacing(20)
     self.outline_size_label = QtWidgets.QLabel(self.main_area_page)
     self.outline_size_label.setObjectName('outline_size_label')
     self.outline_layout.addWidget(self.outline_size_label)
     self.outline_size_spin_box = QtWidgets.QSpinBox(self.main_area_page)
     self.outline_size_spin_box.setEnabled(False)
     self.outline_size_spin_box.setObjectName('outline_size_spin_box')
     self.outline_layout.addWidget(self.outline_size_spin_box)
     self.main_area_layout.addRow(self.outline_check_box, self.outline_layout)
     self.shadow_check_box = QtWidgets.QCheckBox(self.main_area_page)
     self.shadow_check_box.setObjectName('shadow_check_box')
     self.shadow_layout = QtWidgets.QHBoxLayout()
     self.shadow_layout.setObjectName('shadow_layout')
     self.shadow_color_button = ColorButton(self.main_area_page)
     self.shadow_color_button.setEnabled(False)
     self.shadow_color_button.setObjectName('shadow_color_button')
     self.shadow_layout.addWidget(self.shadow_color_button)
     self.shadow_layout.addSpacing(20)
     self.shadow_size_label = QtWidgets.QLabel(self.main_area_page)
     self.shadow_size_label.setObjectName('shadow_size_label')
     self.shadow_layout.addWidget(self.shadow_size_label)
     self.shadow_size_spin_box = QtWidgets.QSpinBox(self.main_area_page)
     self.shadow_size_spin_box.setEnabled(False)
     self.shadow_size_spin_box.setObjectName('shadow_size_spin_box')
     self.shadow_layout.addWidget(self.shadow_size_spin_box)
     self.main_area_layout.addRow(self.shadow_check_box, self.shadow_layout)
     theme_wizard.addPage(self.main_area_page)
     # Footer Area Page
     self.footer_area_page = QtWidgets.QWizardPage()
     self.footer_area_page.setObjectName('footer_area_page')
     self.footer_area_layout = QtWidgets.QFormLayout(self.footer_area_page)
     self.footer_area_layout.setObjectName('footer_area_layout')
     self.footer_font_label = QtWidgets.QLabel(self.footer_area_page)
     self.footer_font_label.setObjectName('FooterFontLabel')
     self.footer_font_combo_box = QtWidgets.QFontComboBox(self.footer_area_page)
     self.footer_font_combo_box.setObjectName('footer_font_combo_box')
     self.footer_area_layout.addRow(self.footer_font_label, self.footer_font_combo_box)
     self.footer_color_label = QtWidgets.QLabel(self.footer_area_page)
     self.footer_color_label.setObjectName('footer_color_label')
     self.footer_color_button = ColorButton(self.footer_area_page)
     self.footer_color_button.setObjectName('footer_color_button')
     self.footer_area_layout.addRow(self.footer_color_label, self.footer_color_button)
     self.footer_size_label = QtWidgets.QLabel(self.footer_area_page)
     self.footer_size_label.setObjectName('footer_size_label')
     self.footer_size_spin_box = QtWidgets.QSpinBox(self.footer_area_page)
     self.footer_size_spin_box.setMaximum(999)
     self.footer_size_spin_box.setValue(10)
     self.footer_size_spin_box.setObjectName('FooterSizeSpinBox')
     self.footer_area_layout.addRow(self.footer_size_label, self.footer_size_spin_box)
     self.footer_area_layout.setItem(3, QtWidgets.QFormLayout.LabelRole, self.spacer)
     theme_wizard.addPage(self.footer_area_page)
     # Alignment Page
     self.alignment_page = QtWidgets.QWizardPage()
     self.alignment_page.setObjectName('alignment_page')
     self.alignment_layout = QtWidgets.QFormLayout(self.alignment_page)
     self.alignment_layout.setObjectName('alignment_layout')
     self.horizontal_label = QtWidgets.QLabel(self.alignment_page)
     self.horizontal_label.setObjectName('horizontal_label')
     self.horizontal_combo_box = QtWidgets.QComboBox(self.alignment_page)
     self.horizontal_combo_box.addItems(['', '', '', ''])
     self.horizontal_combo_box.setObjectName('horizontal_combo_box')
     self.alignment_layout.addRow(self.horizontal_label, self.horizontal_combo_box)
     self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(self.alignment_page)
     self.vertical_label.setObjectName('vertical_label')
     self.vertical_combo_box.setObjectName('vertical_combo_box')
     self.alignment_layout.addRow(self.vertical_label, self.vertical_combo_box)
     self.transitions_label = QtWidgets.QLabel(self.alignment_page)
     self.transitions_label.setObjectName('transitions_label')
     self.transitions_check_box = QtWidgets.QCheckBox(self.alignment_page)
     self.transitions_check_box.setObjectName('transitions_check_box')
     self.alignment_layout.addRow(self.transitions_label, self.transitions_check_box)
     self.alignment_layout.setItem(3, QtWidgets.QFormLayout.LabelRole, self.spacer)
     theme_wizard.addPage(self.alignment_page)
     # Area Position Page
     self.area_position_page = QtWidgets.QWizardPage()
     self.area_position_page.setObjectName('area_position_page')
     self.area_position_layout = QtWidgets.QHBoxLayout(self.area_position_page)
     self.area_position_layout.setObjectName('area_position_layout')
     self.main_position_group_box = QtWidgets.QGroupBox(self.area_position_page)
     self.main_position_group_box.setObjectName('main_position_group_box')
     self.main_position_layout = QtWidgets.QFormLayout(self.main_position_group_box)
     self.main_position_layout.setObjectName('main_position_layout')
     self.main_position_check_box = QtWidgets.QCheckBox(self.main_position_group_box)
     self.main_position_check_box.setObjectName('main_position_check_box')
     self.main_position_layout.addRow(self.main_position_check_box)
     self.main_x_label = QtWidgets.QLabel(self.main_position_group_box)
     self.main_x_label.setObjectName('main_x_label')
     self.main_x_spin_box = QtWidgets.QSpinBox(self.main_position_group_box)
     self.main_x_spin_box.setMaximum(9999)
     self.main_x_spin_box.setObjectName('main_x_spin_box')
     self.main_position_layout.addRow(self.main_x_label, self.main_x_spin_box)
     self.main_y_label = QtWidgets.QLabel(self.main_position_group_box)
     self.main_y_label.setObjectName('main_y_label')
     self.main_y_spin_box = QtWidgets.QSpinBox(self.main_position_group_box)
     self.main_y_spin_box.setMaximum(9999)
     self.main_y_spin_box.setObjectName('main_y_spin_box')
     self.main_position_layout.addRow(self.main_y_label, self.main_y_spin_box)
     self.main_width_label = QtWidgets.QLabel(self.main_position_group_box)
     self.main_width_label.setObjectName('main_width_label')
     self.main_width_spin_box = QtWidgets.QSpinBox(self.main_position_group_box)
     self.main_width_spin_box.setMaximum(9999)
     self.main_width_spin_box.setObjectName('main_width_spin_box')
     self.main_position_layout.addRow(self.main_width_label, self.main_width_spin_box)
     self.main_height_label = QtWidgets.QLabel(self.main_position_group_box)
     self.main_height_label.setObjectName('main_height_label')
     self.main_height_spin_box = QtWidgets.QSpinBox(self.main_position_group_box)
     self.main_height_spin_box.setMaximum(9999)
     self.main_height_spin_box.setObjectName('main_height_spin_box')
     self.main_position_layout.addRow(self.main_height_label, self.main_height_spin_box)
     self.area_position_layout.addWidget(self.main_position_group_box)
     self.footer_position_group_box = QtWidgets.QGroupBox(self.area_position_page)
     self.footer_position_group_box.setObjectName('footer_position_group_box')
     self.footer_position_layout = QtWidgets.QFormLayout(self.footer_position_group_box)
     self.footer_position_layout.setObjectName('footer_position_layout')
     self.footer_position_check_box = QtWidgets.QCheckBox(self.footer_position_group_box)
     self.footer_position_check_box.setObjectName('footer_position_check_box')
     self.footer_position_layout.addRow(self.footer_position_check_box)
     self.footer_x_label = QtWidgets.QLabel(self.footer_position_group_box)
     self.footer_x_label.setObjectName('footer_x_label')
     self.footer_x_spin_box = QtWidgets.QSpinBox(self.footer_position_group_box)
     self.footer_x_spin_box.setMaximum(9999)
     self.footer_x_spin_box.setObjectName('footer_x_spin_box')
     self.footer_position_layout.addRow(self.footer_x_label, self.footer_x_spin_box)
     self.footer_y_label = QtWidgets.QLabel(self.footer_position_group_box)
     self.footer_y_label.setObjectName('footer_y_label')
     self.footer_y_spin_box = QtWidgets.QSpinBox(self.footer_position_group_box)
     self.footer_y_spin_box.setMaximum(9999)
     self.footer_y_spin_box.setObjectName('footer_y_spin_box')
     self.footer_position_layout.addRow(self.footer_y_label, self.footer_y_spin_box)
     self.footer_width_label = QtWidgets.QLabel(self.footer_position_group_box)
     self.footer_width_label.setObjectName('footer_width_label')
     self.footer_width_spin_box = QtWidgets.QSpinBox(self.footer_position_group_box)
     self.footer_width_spin_box.setMaximum(9999)
     self.footer_width_spin_box.setObjectName('footer_width_spin_box')
     self.footer_position_layout.addRow(self.footer_width_label, self.footer_width_spin_box)
     self.footer_height_label = QtWidgets.QLabel(self.footer_position_group_box)
     self.footer_height_label.setObjectName('footer_height_label')
     self.footer_height_spin_box = QtWidgets.QSpinBox(self.footer_position_group_box)
     self.footer_height_spin_box.setMaximum(9999)
     self.footer_height_spin_box.setObjectName('footer_height_spin_box')
     self.footer_position_layout.addRow(self.footer_height_label, self.footer_height_spin_box)
     self.area_position_layout.addWidget(self.footer_position_group_box)
     theme_wizard.addPage(self.area_position_page)
     # Preview Page
     self.preview_page = QtWidgets.QWizardPage()
     self.preview_page.setObjectName('preview_page')
     self.preview_layout = QtWidgets.QVBoxLayout(self.preview_page)
     self.preview_layout.setObjectName('preview_layout')
     self.theme_name_layout = QtWidgets.QFormLayout()
     self.theme_name_layout.setObjectName('theme_name_layout')
     self.theme_name_label = QtWidgets.QLabel(self.preview_page)
     self.theme_name_label.setObjectName('theme_name_label')
     self.theme_name_edit = QtWidgets.QLineEdit(self.preview_page)
     self.theme_name_edit.setValidator(QtGui.QRegExpValidator(QtCore.QRegExp(r'[^/\\?*|<>\[\]":<>+%]+'), self))
     self.theme_name_edit.setObjectName('ThemeNameEdit')
     self.theme_name_layout.addRow(self.theme_name_label, self.theme_name_edit)
     self.preview_layout.addLayout(self.theme_name_layout)
     self.preview_area = QtWidgets.QWidget(self.preview_page)
     self.preview_area.setObjectName('PreviewArea')
     self.preview_area_layout = QtWidgets.QGridLayout(self.preview_area)
     self.preview_area_layout.setContentsMargins(0, 0, 0, 0)
     self.preview_area_layout.setColumnStretch(0, 1)
     self.preview_area_layout.setRowStretch(0, 1)
     self.preview_area_layout.setObjectName('preview_area_layout')
     self.preview_box_label = QtWidgets.QLabel(self.preview_area)
     self.preview_box_label.setFrameShape(QtWidgets.QFrame.Box)
     self.preview_box_label.setScaledContents(True)
     self.preview_box_label.setObjectName('preview_box_label')
     self.preview_area_layout.addWidget(self.preview_box_label)
     self.preview_layout.addWidget(self.preview_area)
     theme_wizard.addPage(self.preview_page)
     self.retranslateUi(theme_wizard)
     self.background_combo_box.currentIndexChanged.connect(self.background_stack.setCurrentIndex)
     self.outline_check_box.toggled.connect(self.outline_color_button.setEnabled)
     self.outline_check_box.toggled.connect(self.outline_size_spin_box.setEnabled)
     self.shadow_check_box.toggled.connect(self.shadow_color_button.setEnabled)
     self.shadow_check_box.toggled.connect(self.shadow_size_spin_box.setEnabled)
     self.main_position_check_box.toggled.connect(self.main_x_spin_box.setDisabled)
     self.main_position_check_box.toggled.connect(self.main_y_spin_box.setDisabled)
     self.main_position_check_box.toggled.connect(self.main_width_spin_box.setDisabled)
     self.main_position_check_box.toggled.connect(self.main_height_spin_box.setDisabled)
     self.footer_position_check_box.toggled.connect(self.footer_x_spin_box.setDisabled)
     self.footer_position_check_box.toggled.connect(self.footer_y_spin_box.setDisabled)
     self.footer_position_check_box.toggled.connect(self.footer_width_spin_box.setDisabled)
     self.footer_position_check_box.toggled.connect(self.footer_height_spin_box.setDisabled)
Esempio n. 10
0
 def setup_ui(self):
     self.setObjectName('AlertsTab')
     super(AlertsTab, self).setup_ui()
     self.font_group_box = QtWidgets.QGroupBox(self.left_column)
     self.font_group_box.setObjectName('font_group_box')
     self.font_layout = QtWidgets.QFormLayout(self.font_group_box)
     self.font_layout.setObjectName('font_layout')
     self.font_label = QtWidgets.QLabel(self.font_group_box)
     self.font_label.setObjectName('font_label')
     self.font_combo_box = QtWidgets.QFontComboBox(self.font_group_box)
     self.font_combo_box.setObjectName('font_combo_box')
     self.font_layout.addRow(self.font_label, self.font_combo_box)
     self.font_color_label = QtWidgets.QLabel(self.font_group_box)
     self.font_color_label.setObjectName('font_color_label')
     self.font_color_button = ColorButton(self.font_group_box)
     self.font_color_button.setObjectName('font_color_button')
     self.font_layout.addRow(self.font_color_label, self.font_color_button)
     self.font_size_label = QtWidgets.QLabel(self.font_group_box)
     self.font_size_label.setObjectName('font_size_label')
     self.font_size_spin_box = QtWidgets.QSpinBox(self.font_group_box)
     self.font_size_spin_box.setObjectName('font_size_spin_box')
     self.font_layout.addRow(self.font_size_label, self.font_size_spin_box)
     self.left_layout.addWidget(self.font_group_box)
     # Background Settings
     self.background_group_box = QtWidgets.QGroupBox(self.left_column)
     self.background_group_box.setObjectName('background_group_box')
     self.background_layout = QtWidgets.QFormLayout(
         self.background_group_box)
     self.background_layout.setObjectName('background_settings_layout')
     self.background_color_label = QtWidgets.QLabel(
         self.background_group_box)
     self.background_color_label.setObjectName('background_color_label')
     self.background_color_button = ColorButton(self.background_group_box)
     self.background_color_button.setObjectName('background_color_button')
     self.background_layout.addRow(self.background_color_label,
                                   self.background_color_button)
     self.left_layout.addWidget(self.background_group_box)
     # Scroll Settings
     self.scroll_group_box = QtWidgets.QGroupBox(self.left_column)
     self.scroll_group_box.setObjectName('scroll_group_box')
     self.scroll_group_layout = QtWidgets.QFormLayout(self.scroll_group_box)
     self.scroll_group_layout.setObjectName('scroll_group_layout')
     self.scroll_check_box = QtWidgets.QCheckBox(self.scroll_group_box)
     self.scroll_check_box.setObjectName('scroll_check_box')
     self.scroll_group_layout.addRow(self.scroll_check_box)
     self.repeat_label = QtWidgets.QLabel(self.scroll_group_box)
     self.repeat_label.setObjectName('repeat_label')
     self.repeat_spin_box = QtWidgets.QSpinBox(self.scroll_group_box)
     self.repeat_spin_box.setObjectName('repeat_spin_box')
     self.scroll_group_layout.addRow(self.repeat_label,
                                     self.repeat_spin_box)
     self.left_layout.addWidget(self.scroll_group_box)
     # Other Settings
     self.settings_group_box = QtWidgets.QGroupBox(self.left_column)
     self.settings_group_box.setObjectName('settings_group_box')
     self.settings_layout = QtWidgets.QFormLayout(self.settings_group_box)
     self.settings_layout.setObjectName('settings_layout')
     self.timeout_label = QtWidgets.QLabel(self.settings_group_box)
     self.timeout_label.setObjectName('timeout_label')
     self.timeout_spin_box = QtWidgets.QSpinBox(self.settings_group_box)
     self.timeout_spin_box.setMaximum(180)
     self.timeout_spin_box.setObjectName('timeout_spin_box')
     self.settings_layout.addRow(self.timeout_label, self.timeout_spin_box)
     self.vertical_label, self.vertical_combo_box = create_valign_selection_widgets(
         self.font_group_box)
     self.vertical_label.setObjectName('vertical_label')
     self.vertical_combo_box.setObjectName('vertical_combo_box')
     self.settings_layout.addRow(self.vertical_label,
                                 self.vertical_combo_box)
     self.left_layout.addWidget(self.settings_group_box)
     self.left_layout.addStretch()
     self.preview_group_box = QtWidgets.QGroupBox(self.right_column)
     self.preview_group_box.setObjectName('preview_group_box')
     self.preview_layout = QtWidgets.QVBoxLayout(self.preview_group_box)
     self.preview_layout.setObjectName('preview_layout')
     self.font_preview = QtWidgets.QLineEdit(self.preview_group_box)
     self.font_preview.setObjectName('font_preview')
     self.preview_layout.addWidget(self.font_preview)
     self.right_layout.addWidget(self.preview_group_box)
     self.right_layout.addStretch()
     # Signals and slots
     self.background_color_button.colorChanged.connect(
         self.on_background_color_changed)
     self.font_color_button.colorChanged.connect(self.on_font_color_changed)
     self.font_combo_box.activated.connect(self.on_font_combo_box_clicked)
     self.timeout_spin_box.valueChanged.connect(
         self.on_timeout_spin_box_changed)
     self.font_size_spin_box.valueChanged.connect(
         self.on_font_size_spin_box_changed)
     self.repeat_spin_box.valueChanged.connect(
         self.on_repeat_spin_box_changed)
     self.scroll_check_box.toggled.connect(self.scroll_check_box_toggled)