示例#1
0
    def test_add_welcome_page(self):
        """
        Test appending a welcome page to a wizard
        """
        # GIVEN: A wizard
        wizard = QtWidgets.QWizard()

        # WHEN: A welcome page has been added to the wizard
        add_welcome_page(wizard, ':/wizards/wizard_firsttime.bmp')

        # THEN: The wizard should have one page with a pixmap.
        self.assertEqual(1, len(wizard.pageIds()), 'The wizard should have one page.')
        self.assertIsInstance(wizard.page(0).pixmap(QtWidgets.QWizard.WatermarkPixmap), QtGui.QPixmap)
示例#2
0
 def setupUi(self, image):
     """
     Set up the wizard UI.
     """
     self.setModal(True)
     self.setWizardStyle(QtGui.QWizard.ModernStyle)
     self.setOptions(QtGui.QWizard.IndependentPages |
         QtGui.QWizard.NoBackButtonOnStartPage |
         QtGui.QWizard.NoBackButtonOnLastPage)
     add_welcome_page(self, image)
     self.addCustomPages()
     self.addProgressPage()
     self.retranslateUi()
示例#3
0
    def test_add_welcome_page(self):
        """
        Test appending a welcome page to a wizard
        """
        # GIVEN: A wizard
        wizard = QtWidgets.QWizard()

        # WHEN: A welcome page has been added to the wizard
        add_welcome_page(wizard, ':/wizards/wizard_firsttime.bmp')

        # THEN: The wizard should have one page with a pixmap.
        self.assertEqual(1, len(wizard.pageIds()), 'The wizard should have one page.')
        self.assertIsInstance(wizard.page(0).pixmap(QtWidgets.QWizard.WatermarkPixmap), QtGui.QPixmap)
示例#4
0
文件: wizard.py 项目: jkunle/paul
 def setupUi(self, image):
     """
     Set up the wizard UI.
     """
     self.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
     self.setModal(True)
     self.setOptions(QtGui.QWizard.IndependentPages |
                     QtGui.QWizard.NoBackButtonOnStartPage | QtGui.QWizard.NoBackButtonOnLastPage)
     if is_macosx():
         self.setPixmap(QtGui.QWizard.BackgroundPixmap, QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
     else:
         self.setWizardStyle(QtGui.QWizard.ModernStyle)
     add_welcome_page(self, image)
     self.add_custom_pages()
     if self.with_progress_page:
         self.add_progress_page()
     self.retranslateUi()
示例#5
0
 def setup_ui(self, image):
     """
     Set up the wizard UI.
     :param image: path to start up image
     """
     self.setWindowIcon(UiIcons().main_icon)
     self.setModal(True)
     self.setOptions(QtWidgets.QWizard.IndependentPages
                     | QtWidgets.QWizard.NoBackButtonOnStartPage
                     | QtWidgets.QWizard.NoBackButtonOnLastPage)
     if is_macosx():
         self.setPixmap(QtWidgets.QWizard.BackgroundPixmap,
                        QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
     else:
         self.setWizardStyle(QtWidgets.QWizard.ModernStyle)
     add_welcome_page(self, image)
     self.add_custom_pages()
     if self.with_progress_page:
         self.add_progress_page()
     self.retranslate_ui()
示例#6
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)'))
示例#7
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)'))
示例#8
0
    def setup_ui(self, first_time_wizard):
        """
        Set up the UI.

        :param first_time_wizard: The wizard form
        """
        first_time_wizard.setObjectName('first_time_wizard')
        first_time_wizard.setWindowIcon(build_icon(':/icon/openlp-logo.svg'))
        first_time_wizard.resize(550, 386)
        first_time_wizard.setModal(True)
        first_time_wizard.setOptions(QtWidgets.QWizard.IndependentPages | QtWidgets.QWizard.NoBackButtonOnStartPage |
                                     QtWidgets.QWizard.NoBackButtonOnLastPage | QtWidgets.QWizard.HaveCustomButton1 |
                                     QtWidgets.QWizard.HaveCustomButton2)
        if is_macosx():
            first_time_wizard.setPixmap(QtWidgets.QWizard.BackgroundPixmap,
                                        QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
            first_time_wizard.resize(634, 386)
        else:
            first_time_wizard.setWizardStyle(QtWidgets.QWizard.ModernStyle)
        self.finish_button = self.button(QtWidgets.QWizard.FinishButton)
        self.no_internet_finish_button = self.button(QtWidgets.QWizard.CustomButton1)
        self.cancel_button = self.button(QtWidgets.QWizard.CancelButton)
        self.no_internet_cancel_button = self.button(QtWidgets.QWizard.CustomButton2)
        self.next_button = self.button(QtWidgets.QWizard.NextButton)
        self.back_button = self.button(QtWidgets.QWizard.BackButton)
        add_welcome_page(first_time_wizard, ':/wizards/wizard_firsttime.bmp')
        # The download page
        self.download_page = QtWidgets.QWizardPage()
        self.download_page.setObjectName('download_page')
        self.download_layout = QtWidgets.QVBoxLayout(self.download_page)
        self.download_layout.setContentsMargins(48, 48, 48, 48)
        self.download_layout.setObjectName('download_layout')
        self.download_label = QtWidgets.QLabel(self.download_page)
        self.download_label.setObjectName('download_label')
        self.download_layout.addWidget(self.download_label)
        first_time_wizard.setPage(FirstTimePage.Download, self.download_page)
        # The "you don't have an internet connection" page.
        self.no_internet_page = QtWidgets.QWizardPage()
        self.no_internet_page.setObjectName('no_internet_page')
        self.no_internet_layout = QtWidgets.QVBoxLayout(self.no_internet_page)
        self.no_internet_layout.setContentsMargins(50, 30, 50, 40)
        self.no_internet_layout.setObjectName('no_internet_layout')
        self.no_internet_label = QtWidgets.QLabel(self.no_internet_page)
        self.no_internet_label.setWordWrap(True)
        self.no_internet_label.setObjectName('no_internet_label')
        self.no_internet_layout.addWidget(self.no_internet_label)
        first_time_wizard.setPage(FirstTimePage.NoInternet, self.no_internet_page)
        # The plugins page
        self.plugin_page = QtWidgets.QWizardPage()
        self.plugin_page.setObjectName('plugin_page')
        self.plugin_layout = QtWidgets.QVBoxLayout(self.plugin_page)
        self.plugin_layout.setContentsMargins(40, 15, 40, 0)
        self.plugin_layout.setObjectName('plugin_layout')
        self.songs_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.songs_check_box.setChecked(True)
        self.songs_check_box.setObjectName('songs_check_box')
        self.plugin_layout.addWidget(self.songs_check_box)
        self.custom_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.custom_check_box.setChecked(True)
        self.custom_check_box.setObjectName('custom_check_box')
        self.plugin_layout.addWidget(self.custom_check_box)
        self.bible_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.bible_check_box.setChecked(True)
        self.bible_check_box.setObjectName('bible_check_box')
        self.plugin_layout.addWidget(self.bible_check_box)
        self.image_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.image_check_box.setChecked(True)
        self.image_check_box.setObjectName('image_check_box')
        self.plugin_layout.addWidget(self.image_check_box)
        self.presentation_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.presentation_check_box.setChecked(True)
        self.presentation_check_box.setObjectName('presentation_check_box')
        self.plugin_layout.addWidget(self.presentation_check_box)
        self.media_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.media_check_box.setChecked(True)
        self.media_check_box.setObjectName('media_check_box')
        self.plugin_layout.addWidget(self.media_check_box)
        self.remote_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.remote_check_box.setObjectName('remote_check_box')
        self.plugin_layout.addWidget(self.remote_check_box)
        self.song_usage_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.song_usage_check_box.setChecked(True)
        self.song_usage_check_box.setObjectName('song_usage_check_box')
        self.plugin_layout.addWidget(self.song_usage_check_box)
        self.alert_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.alert_check_box.setChecked(True)
        self.alert_check_box.setObjectName('alert_check_box')
        self.plugin_layout.addWidget(self.alert_check_box)
        self.projectors_check_box = QtWidgets.QCheckBox(self.plugin_page)
        # If visibility setting for projector panel is True, check the box.
        if Settings().value('projector/show after wizard'):
            self.projectors_check_box.setChecked(True)
        self.projectors_check_box.setObjectName('projectors_check_box')
        self.projectors_check_box.clicked.connect(self.on_projectors_check_box_clicked)
        self.plugin_layout.addWidget(self.projectors_check_box)
        first_time_wizard.setPage(FirstTimePage.Plugins, self.plugin_page)
        # The song samples page
        self.songs_page = QtWidgets.QWizardPage()
        self.songs_page.setObjectName('songs_page')
        self.songs_layout = QtWidgets.QVBoxLayout(self.songs_page)
        self.songs_layout.setContentsMargins(50, 20, 50, 20)
        self.songs_layout.setObjectName('songs_layout')
        self.songs_list_widget = QtWidgets.QListWidget(self.songs_page)
        self.songs_list_widget.setAlternatingRowColors(True)
        self.songs_list_widget.setObjectName('songs_list_widget')
        self.songs_layout.addWidget(self.songs_list_widget)
        first_time_wizard.setPage(FirstTimePage.Songs, self.songs_page)
        # The Bible samples page
        self.bibles_page = QtWidgets.QWizardPage()
        self.bibles_page.setObjectName('bibles_page')
        self.bibles_layout = QtWidgets.QVBoxLayout(self.bibles_page)
        self.bibles_layout.setContentsMargins(50, 20, 50, 20)
        self.bibles_layout.setObjectName('bibles_layout')
        self.bibles_tree_widget = QtWidgets.QTreeWidget(self.bibles_page)
        self.bibles_tree_widget.setAlternatingRowColors(True)
        self.bibles_tree_widget.header().setVisible(False)
        self.bibles_tree_widget.setObjectName('bibles_tree_widget')
        self.bibles_layout.addWidget(self.bibles_tree_widget)
        first_time_wizard.setPage(FirstTimePage.Bibles, self.bibles_page)
        # The theme samples page
        self.themes_page = QtWidgets.QWizardPage()
        self.themes_page.setObjectName('themes_page')
        self.themes_layout = QtWidgets.QVBoxLayout(self.themes_page)
        self.themes_layout.setContentsMargins(20, 50, 20, 60)
        self.themes_layout.setObjectName('themes_layout')
        self.themes_list_widget = QtWidgets.QListWidget(self.themes_page)
        self.themes_list_widget.setViewMode(QtWidgets.QListView.IconMode)
        self.themes_list_widget.setMovement(QtWidgets.QListView.Static)
        self.themes_list_widget.setFlow(QtWidgets.QListView.LeftToRight)
        self.themes_list_widget.setSpacing(4)
        self.themes_list_widget.setUniformItemSizes(True)
        self.themes_list_widget.setIconSize(QtCore.QSize(133, 100))
        self.themes_list_widget.setWrapping(False)
        self.themes_list_widget.setObjectName('themes_list_widget')
        self.themes_layout.addWidget(self.themes_list_widget)
        first_time_wizard.setPage(FirstTimePage.Themes, self.themes_page)
        # the default settings page
        self.defaults_page = QtWidgets.QWizardPage()
        self.defaults_page.setObjectName('defaults_page')
        self.defaults_layout = QtWidgets.QFormLayout(self.defaults_page)
        self.defaults_layout.setContentsMargins(50, 20, 50, 20)
        self.defaults_layout.setObjectName('defaults_layout')
        self.display_label = QtWidgets.QLabel(self.defaults_page)
        self.display_label.setObjectName('display_label')
        self.display_combo_box = QtWidgets.QComboBox(self.defaults_page)
        self.display_combo_box.setEditable(False)
        self.display_combo_box.setInsertPolicy(QtWidgets.QComboBox.NoInsert)
        self.display_combo_box.setObjectName('display_combo_box')
        self.defaults_layout.addRow(self.display_label, self.display_combo_box)
        self.theme_label = QtWidgets.QLabel(self.defaults_page)
        self.theme_label.setObjectName('theme_label')
        self.theme_combo_box = QtWidgets.QComboBox(self.defaults_page)
        self.theme_combo_box.setEditable(False)
        self.theme_combo_box.setInsertPolicy(QtWidgets.QComboBox.NoInsert)
        self.theme_combo_box.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)
        self.theme_combo_box.setObjectName('theme_combo_box')
        self.defaults_layout.addRow(self.theme_label, self.theme_combo_box)
        first_time_wizard.setPage(FirstTimePage.Defaults, self.defaults_page)
        # Progress page
        self.progress_page = QtWidgets.QWizardPage()
        self.progress_page.setObjectName('progress_page')
        self.progress_layout = QtWidgets.QVBoxLayout(self.progress_page)
        self.progress_layout.setContentsMargins(48, 48, 48, 48)
        self.progress_layout.setObjectName('progress_layout')
        self.progress_label = QtWidgets.QLabel(self.progress_page)
        self.progress_label.setObjectName('progress_label')
        self.progress_layout.addWidget(self.progress_label)
        self.progress_bar = QtWidgets.QProgressBar(self.progress_page)
        self.progress_bar.setObjectName('progress_bar')
        self.progress_layout.addWidget(self.progress_bar)
        first_time_wizard.setPage(FirstTimePage.Progress, self.progress_page)
        self.retranslate_ui(first_time_wizard)
示例#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)
示例#10
0
 def setupUi(self, FirstTimeWizard):
     """
     Set up the UI.
     """
     FirstTimeWizard.setObjectName(u'FirstTimeWizard')
     FirstTimeWizard.resize(550, 386)
     FirstTimeWizard.setModal(True)
     FirstTimeWizard.setWizardStyle(QtGui.QWizard.ModernStyle)
     FirstTimeWizard.setOptions(QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage |
         QtGui.QWizard.NoBackButtonOnLastPage | QtGui.QWizard.HaveCustomButton1)
     self.finishButton = self.button(QtGui.QWizard.FinishButton)
     self.noInternetFinishButton = self.button(QtGui.QWizard.CustomButton1)
     self.cancelButton = self.button(QtGui.QWizard.CancelButton)
     self.nextButton = self.button(QtGui.QWizard.NextButton)
     self.backButton = self.button(QtGui.QWizard.BackButton)
     add_welcome_page(FirstTimeWizard, u':/wizards/wizard_firsttime.bmp')
     # The plugins page
     self.pluginPage = QtGui.QWizardPage()
     self.pluginPage.setObjectName(u'pluginPage')
     self.pluginLayout = QtGui.QVBoxLayout(self.pluginPage)
     self.pluginLayout.setContentsMargins(40, 15, 40, 0)
     self.pluginLayout.setObjectName(u'pluginLayout')
     self.songsCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.songsCheckBox.setChecked(True)
     self.songsCheckBox.setObjectName(u'songsCheckBox')
     self.pluginLayout.addWidget(self.songsCheckBox)
     self.customCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.customCheckBox.setChecked(True)
     self.customCheckBox.setObjectName(u'customCheckBox')
     self.pluginLayout.addWidget(self.customCheckBox)
     self.bibleCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.bibleCheckBox.setChecked(True)
     self.bibleCheckBox.setObjectName(u'bibleCheckBox')
     self.pluginLayout.addWidget(self.bibleCheckBox)
     self.imageCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.imageCheckBox.setChecked(True)
     self.imageCheckBox.setObjectName(u'imageCheckBox')
     self.pluginLayout.addWidget(self.imageCheckBox)
     # TODO Presentation plugin is not yet working on Mac OS X.
     # For now just ignore it.
     if sys.platform != 'darwin':
         self.presentationCheckBox = QtGui.QCheckBox(self.pluginPage)
         self.presentationCheckBox.setChecked(True)
         self.presentationCheckBox.setObjectName(u'presentationCheckBox')
         self.pluginLayout.addWidget(self.presentationCheckBox)
     self.mediaCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.mediaCheckBox.setChecked(True)
     self.mediaCheckBox.setObjectName(u'mediaCheckBox')
     self.pluginLayout.addWidget(self.mediaCheckBox)
     self.remoteCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.remoteCheckBox.setObjectName(u'remoteCheckBox')
     self.pluginLayout.addWidget(self.remoteCheckBox)
     self.songUsageCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.songUsageCheckBox.setChecked(True)
     self.songUsageCheckBox.setObjectName(u'songUsageCheckBox')
     self.pluginLayout.addWidget(self.songUsageCheckBox)
     self.alertCheckBox = QtGui.QCheckBox(self.pluginPage)
     self.alertCheckBox.setChecked(True)
     self.alertCheckBox.setObjectName(u'alertCheckBox')
     self.pluginLayout.addWidget(self.alertCheckBox)
     FirstTimeWizard.setPage(FirstTimePage.Plugins, self.pluginPage)
     # The "you don't have an internet connection" page.
     self.noInternetPage = QtGui.QWizardPage()
     self.noInternetPage.setObjectName(u'noInternetPage')
     self.noInternetLayout = QtGui.QVBoxLayout(self.noInternetPage)
     self.noInternetLayout.setContentsMargins(50, 30, 50, 40)
     self.noInternetLayout.setObjectName(u'noInternetLayout')
     self.noInternetLabel = QtGui.QLabel(self.noInternetPage)
     self.noInternetLabel.setWordWrap(True)
     self.noInternetLabel.setObjectName(u'noInternetLabel')
     self.noInternetLayout.addWidget(self.noInternetLabel)
     FirstTimeWizard.setPage(FirstTimePage.NoInternet, self.noInternetPage)
     # The song samples page
     self.songsPage = QtGui.QWizardPage()
     self.songsPage.setObjectName(u'songsPage')
     self.songsLayout = QtGui.QVBoxLayout(self.songsPage)
     self.songsLayout.setContentsMargins(50, 20, 50, 20)
     self.songsLayout.setObjectName(u'songsLayout')
     self.songsListWidget = QtGui.QListWidget(self.songsPage)
     self.songsListWidget.setAlternatingRowColors(True)
     self.songsListWidget.setObjectName(u'songsListWidget')
     self.songsLayout.addWidget(self.songsListWidget)
     FirstTimeWizard.setPage(FirstTimePage.Songs, self.songsPage)
     # The Bible samples page
     self.biblesPage = QtGui.QWizardPage()
     self.biblesPage.setObjectName(u'biblesPage')
     self.biblesLayout = QtGui.QVBoxLayout(self.biblesPage)
     self.biblesLayout.setContentsMargins(50, 20, 50, 20)
     self.biblesLayout.setObjectName(u'biblesLayout')
     self.biblesTreeWidget = QtGui.QTreeWidget(self.biblesPage)
     self.biblesTreeWidget.setAlternatingRowColors(True)
     self.biblesTreeWidget.header().setVisible(False)
     self.biblesTreeWidget.setObjectName(u'biblesTreeWidget')
     self.biblesLayout.addWidget(self.biblesTreeWidget)
     FirstTimeWizard.setPage(FirstTimePage.Bibles, self.biblesPage)
     # The theme samples page
     self.themesPage = QtGui.QWizardPage()
     self.themesPage.setObjectName(u'themesPage')
     self.themesLayout = QtGui.QVBoxLayout(self.themesPage)
     self.themesLayout.setContentsMargins(20, 50, 20, 60)
     self.themesLayout.setObjectName(u'themesLayout')
     self.themesListWidget = QtGui.QListWidget(self.themesPage)
     self.themesListWidget.setViewMode(QtGui.QListView.IconMode)
     self.themesListWidget.setMovement(QtGui.QListView.Static)
     self.themesListWidget.setFlow(QtGui.QListView.LeftToRight)
     self.themesListWidget.setSpacing(4)
     self.themesListWidget.setUniformItemSizes(True)
     self.themesListWidget.setIconSize(QtCore.QSize(133, 100))
     self.themesListWidget.setWrapping(False)
     self.themesListWidget.setObjectName(u'themesListWidget')
     self.themesLayout.addWidget(self.themesListWidget)
     FirstTimeWizard.setPage(FirstTimePage.Themes, self.themesPage)
     # the default settings page
     self.defaultsPage = QtGui.QWizardPage()
     self.defaultsPage.setObjectName(u'defaultsPage')
     self.defaultsLayout = QtGui.QFormLayout(self.defaultsPage)
     self.defaultsLayout.setContentsMargins(50, 20, 50, 20)
     self.defaultsLayout.setObjectName(u'defaultsLayout')
     self.displayLabel = QtGui.QLabel(self.defaultsPage)
     self.displayLabel.setObjectName(u'displayLabel')
     self.displayComboBox = QtGui.QComboBox(self.defaultsPage)
     self.displayComboBox.setEditable(False)
     self.displayComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
     self.displayComboBox.setObjectName(u'displayComboBox')
     self.defaultsLayout.addRow(self.displayLabel, self.displayComboBox)
     self.themeLabel = QtGui.QLabel(self.defaultsPage)
     self.themeLabel.setObjectName(u'themeLabel')
     self.themeComboBox = QtGui.QComboBox(self.defaultsPage)
     self.themeComboBox.setEditable(False)
     self.themeComboBox.setInsertPolicy(QtGui.QComboBox.NoInsert)
     self.themeComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
     self.themeComboBox.setObjectName(u'themeComboBox')
     self.defaultsLayout.addRow(self.themeLabel, self.themeComboBox)
     FirstTimeWizard.setPage(FirstTimePage.Defaults, self.defaultsPage)
     # Progress page
     self.progressPage = QtGui.QWizardPage()
     self.progressPage.setObjectName(u'progressPage')
     self.progressLayout = QtGui.QVBoxLayout(self.progressPage)
     self.progressLayout.setMargin(48)
     self.progressLayout.setObjectName(u'progressLayout')
     self.progressLabel = QtGui.QLabel(self.progressPage)
     self.progressLabel.setObjectName(u'progressLabel')
     self.progressLayout.addWidget(self.progressLabel)
     self.progressBar = QtGui.QProgressBar(self.progressPage)
     self.progressBar.setObjectName(u'progressBar')
     self.progressLayout.addWidget(self.progressBar)
     FirstTimeWizard.setPage(FirstTimePage.Progress, self.progressPage)
     self.retranslateUi(FirstTimeWizard)
示例#11
0
    def setup_ui(self, first_time_wizard):
        """
        Set up the UI.

        :param first_time_wizard: The wizard form
        """
        first_time_wizard.setObjectName('first_time_wizard')
        first_time_wizard.setWindowIcon(build_icon(u':/icon/openlp-logo.svg'))
        first_time_wizard.resize(550, 386)
        first_time_wizard.setModal(True)
        first_time_wizard.setOptions(
            QtWidgets.QWizard.IndependentPages
            | QtWidgets.QWizard.NoBackButtonOnStartPage
            | QtWidgets.QWizard.NoBackButtonOnLastPage
            | QtWidgets.QWizard.HaveCustomButton1
            | QtWidgets.QWizard.HaveCustomButton2)
        if is_macosx():
            first_time_wizard.setPixmap(
                QtWidgets.QWizard.BackgroundPixmap,
                QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
            first_time_wizard.resize(634, 386)
        else:
            first_time_wizard.setWizardStyle(QtWidgets.QWizard.ModernStyle)
        self.finish_button = self.button(QtWidgets.QWizard.FinishButton)
        self.no_internet_finish_button = self.button(
            QtWidgets.QWizard.CustomButton1)
        self.cancel_button = self.button(QtWidgets.QWizard.CancelButton)
        self.no_internet_cancel_button = self.button(
            QtWidgets.QWizard.CustomButton2)
        self.next_button = self.button(QtWidgets.QWizard.NextButton)
        self.back_button = self.button(QtWidgets.QWizard.BackButton)
        add_welcome_page(first_time_wizard, ':/wizards/wizard_firsttime.bmp')
        # The download page
        self.download_page = QtWidgets.QWizardPage()
        self.download_page.setObjectName('download_page')
        self.download_layout = QtWidgets.QVBoxLayout(self.download_page)
        self.download_layout.setContentsMargins(48, 48, 48, 48)
        self.download_layout.setObjectName('download_layout')
        self.download_label = QtWidgets.QLabel(self.download_page)
        self.download_label.setObjectName('download_label')
        self.download_layout.addWidget(self.download_label)
        first_time_wizard.setPage(FirstTimePage.Download, self.download_page)
        # The "you don't have an internet connection" page.
        self.no_internet_page = QtWidgets.QWizardPage()
        self.no_internet_page.setObjectName('no_internet_page')
        self.no_internet_layout = QtWidgets.QVBoxLayout(self.no_internet_page)
        self.no_internet_layout.setContentsMargins(50, 30, 50, 40)
        self.no_internet_layout.setObjectName('no_internet_layout')
        self.no_internet_label = QtWidgets.QLabel(self.no_internet_page)
        self.no_internet_label.setWordWrap(True)
        self.no_internet_label.setObjectName('no_internet_label')
        self.no_internet_layout.addWidget(self.no_internet_label)
        first_time_wizard.setPage(FirstTimePage.NoInternet,
                                  self.no_internet_page)
        # The plugins page
        self.plugin_page = QtWidgets.QWizardPage()
        self.plugin_page.setObjectName('plugin_page')
        self.plugin_layout = QtWidgets.QVBoxLayout(self.plugin_page)
        self.plugin_layout.setContentsMargins(40, 15, 40, 0)
        self.plugin_layout.setObjectName('plugin_layout')
        self.songs_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.songs_check_box.setChecked(True)
        self.songs_check_box.setObjectName('songs_check_box')
        self.plugin_layout.addWidget(self.songs_check_box)
        self.custom_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.custom_check_box.setChecked(True)
        self.custom_check_box.setObjectName('custom_check_box')
        self.plugin_layout.addWidget(self.custom_check_box)
        self.bible_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.bible_check_box.setChecked(True)
        self.bible_check_box.setObjectName('bible_check_box')
        self.plugin_layout.addWidget(self.bible_check_box)
        self.image_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.image_check_box.setChecked(True)
        self.image_check_box.setObjectName('image_check_box')
        self.plugin_layout.addWidget(self.image_check_box)
        self.presentation_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.presentation_check_box.setChecked(True)
        self.presentation_check_box.setObjectName('presentation_check_box')
        self.plugin_layout.addWidget(self.presentation_check_box)
        self.media_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.media_check_box.setChecked(True)
        self.media_check_box.setObjectName('media_check_box')
        self.plugin_layout.addWidget(self.media_check_box)
        self.remote_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.remote_check_box.setObjectName('remote_check_box')
        self.plugin_layout.addWidget(self.remote_check_box)
        self.song_usage_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.song_usage_check_box.setChecked(True)
        self.song_usage_check_box.setObjectName('song_usage_check_box')
        self.plugin_layout.addWidget(self.song_usage_check_box)
        self.alert_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.alert_check_box.setChecked(True)
        self.alert_check_box.setObjectName('alert_check_box')
        self.plugin_layout.addWidget(self.alert_check_box)
        first_time_wizard.setPage(FirstTimePage.Plugins, self.plugin_page)
        # The song samples page
        self.songs_page = QtWidgets.QWizardPage()
        self.songs_page.setObjectName('songs_page')
        self.songs_layout = QtWidgets.QVBoxLayout(self.songs_page)
        self.songs_layout.setContentsMargins(50, 20, 50, 20)
        self.songs_layout.setObjectName('songs_layout')
        self.songs_list_widget = QtWidgets.QListWidget(self.songs_page)
        self.songs_list_widget.setAlternatingRowColors(True)
        self.songs_list_widget.setObjectName('songs_list_widget')
        self.songs_layout.addWidget(self.songs_list_widget)
        first_time_wizard.setPage(FirstTimePage.Songs, self.songs_page)
        # The Bible samples page
        self.bibles_page = QtWidgets.QWizardPage()
        self.bibles_page.setObjectName('bibles_page')
        self.bibles_layout = QtWidgets.QVBoxLayout(self.bibles_page)
        self.bibles_layout.setContentsMargins(50, 20, 50, 20)
        self.bibles_layout.setObjectName('bibles_layout')
        self.bibles_tree_widget = QtWidgets.QTreeWidget(self.bibles_page)
        self.bibles_tree_widget.setAlternatingRowColors(True)
        self.bibles_tree_widget.header().setVisible(False)
        self.bibles_tree_widget.setObjectName('bibles_tree_widget')
        self.bibles_layout.addWidget(self.bibles_tree_widget)
        first_time_wizard.setPage(FirstTimePage.Bibles, self.bibles_page)
        # The theme samples page
        self.themes_page = QtWidgets.QWizardPage()
        self.themes_page.setObjectName('themes_page')
        self.themes_layout = QtWidgets.QVBoxLayout(self.themes_page)
        self.themes_layout.setContentsMargins(20, 50, 20, 60)
        self.themes_layout.setObjectName('themes_layout')
        self.themes_list_widget = QtWidgets.QListWidget(self.themes_page)
        self.themes_list_widget.setViewMode(QtWidgets.QListView.IconMode)
        self.themes_list_widget.setMovement(QtWidgets.QListView.Static)
        self.themes_list_widget.setFlow(QtWidgets.QListView.LeftToRight)
        self.themes_list_widget.setSpacing(4)
        self.themes_list_widget.setUniformItemSizes(True)
        self.themes_list_widget.setIconSize(QtCore.QSize(133, 100))
        self.themes_list_widget.setWrapping(False)
        self.themes_list_widget.setObjectName('themes_list_widget')
        self.themes_layout.addWidget(self.themes_list_widget)
        first_time_wizard.setPage(FirstTimePage.Themes, self.themes_page)
        # the default settings page
        self.defaults_page = QtWidgets.QWizardPage()
        self.defaults_page.setObjectName('defaults_page')
        self.defaults_layout = QtWidgets.QFormLayout(self.defaults_page)
        self.defaults_layout.setContentsMargins(50, 20, 50, 20)
        self.defaults_layout.setObjectName('defaults_layout')
        self.display_label = QtWidgets.QLabel(self.defaults_page)
        self.display_label.setObjectName('display_label')
        self.display_combo_box = QtWidgets.QComboBox(self.defaults_page)
        self.display_combo_box.setEditable(False)
        self.display_combo_box.setInsertPolicy(QtWidgets.QComboBox.NoInsert)
        self.display_combo_box.setObjectName('display_combo_box')
        self.defaults_layout.addRow(self.display_label, self.display_combo_box)
        self.theme_label = QtWidgets.QLabel(self.defaults_page)
        self.theme_label.setObjectName('theme_label')
        self.theme_combo_box = QtWidgets.QComboBox(self.defaults_page)
        self.theme_combo_box.setEditable(False)
        self.theme_combo_box.setInsertPolicy(QtWidgets.QComboBox.NoInsert)
        self.theme_combo_box.setSizeAdjustPolicy(
            QtWidgets.QComboBox.AdjustToContents)
        self.theme_combo_box.setObjectName('theme_combo_box')
        self.defaults_layout.addRow(self.theme_label, self.theme_combo_box)
        first_time_wizard.setPage(FirstTimePage.Defaults, self.defaults_page)
        # Progress page
        self.progress_page = QtWidgets.QWizardPage()
        self.progress_page.setObjectName('progress_page')
        self.progress_layout = QtWidgets.QVBoxLayout(self.progress_page)
        self.progress_layout.setContentsMargins(48, 48, 48, 48)
        self.progress_layout.setObjectName('progress_layout')
        self.progress_label = QtWidgets.QLabel(self.progress_page)
        self.progress_label.setObjectName('progress_label')
        self.progress_layout.addWidget(self.progress_label)
        self.progress_bar = QtWidgets.QProgressBar(self.progress_page)
        self.progress_bar.setObjectName('progress_bar')
        self.progress_layout.addWidget(self.progress_bar)
        first_time_wizard.setPage(FirstTimePage.Progress, self.progress_page)
        self.retranslate_ui(first_time_wizard)
示例#12
0
 def setup_ui(self, theme_wizard):
     """
     Set up the UI
     """
     theme_wizard.setObjectName('OpenLP.ThemeWizard')
     theme_wizard.setWindowIcon(UiIcons().main_icon)
     theme_wizard.setModal(True)
     theme_wizard.setOptions(QtWidgets.QWizard.IndependentPages
                             | QtWidgets.QWizard.NoBackButtonOnStartPage
                             | QtWidgets.QWizard.HaveCustomButton1)
     theme_wizard.setFixedWidth(640)
     if is_macosx():  # pragma: no cover
         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 = BackgroundPage()
     self.background_page.setObjectName('background_page')
     theme_wizard.addPage(self.background_page)
     # Main Area Page
     self.main_area_page = FontSelectPage()
     self.main_area_page.setObjectName('main_area_page')
     theme_wizard.addPage(self.main_area_page)
     # Footer Area Page
     self.footer_area_page = FontSelectPage()
     self.footer_area_page.setObjectName('footer_area_page')
     self.footer_area_page.disable_features(FontSelectPage.Outline,
                                            FontSelectPage.Shadow,
                                            FontSelectPage.LineSpacing)
     theme_wizard.addPage(self.footer_area_page)
     # Alignment Page
     self.alignment_page = AlignmentTransitionsPage()
     self.alignment_page.setObjectName('alignment_page')
     theme_wizard.addPage(self.alignment_page)
     # Area Position Page
     self.area_position_page = AreaPositionPage()
     self.area_position_page.setObjectName('area_position_page')
     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 = AspectRatioLayout(
         self.preview_area, 0.75)  # Dummy ratio, will be update
     self.preview_area_layout.margin = 8
     self.preview_area_layout.setSpacing(0)
     self.preview_area_layout.setObjectName('preview_web_layout')
     self.preview_box = ThemePreviewRenderer(self)
     self.preview_box.setObjectName('preview_box')
     self.preview_area_layout.addWidget(self.preview_box)
     self.preview_layout.addWidget(self.preview_area)
     theme_wizard.addPage(self.preview_page)
     self.retranslate_ui(theme_wizard)
示例#13
0
    def setup_ui(self, first_time_wizard):
        """
        Set up the UI.

        :param first_time_wizard: The wizard form
        """
        first_time_wizard.setObjectName('first_time_wizard')
        first_time_wizard.setWindowIcon(UiIcons().main_icon)
        first_time_wizard.resize(640, 400)
        first_time_wizard.setModal(True)
        first_time_wizard.setOptions(QtWidgets.QWizard.IndependentPages | QtWidgets.QWizard.NoBackButtonOnStartPage |
                                     QtWidgets.QWizard.NoBackButtonOnLastPage | QtWidgets.QWizard.HaveCustomButton1)
        if is_macosx():                                                                             # pragma: nocover
            first_time_wizard.setPixmap(QtWidgets.QWizard.BackgroundPixmap,
                                        QtGui.QPixmap(':/wizards/openlp-osx-wizard.png'))
            first_time_wizard.resize(634, 386)
        else:
            first_time_wizard.setWizardStyle(QtWidgets.QWizard.ModernStyle)
        add_welcome_page(first_time_wizard, ':/wizards/wizard_firsttime.bmp')
        # The screen config page
        self.screen_page = QtWidgets.QWizardPage()
        self.screen_page.setObjectName('defaults_page')
        self.screen_page_layout = QtWidgets.QFormLayout(self.screen_page)
        self.screen_selection_widget = ScreenSelectionWidget(self, ScreenList())
        self.screen_selection_widget.use_simple_view()
        self.screen_selection_widget.load()
        self.screen_page_layout.addRow(self.screen_selection_widget)
        first_time_wizard.setPage(FirstTimePage.ScreenConfig, self.screen_page)
        # Download Samples page
        self.resource_page = QtWidgets.QWizardPage()
        self.resource_page.setObjectName('resource_page')
        self.resource_page.setFinalPage(True)
        self.resource_layout = QtWidgets.QVBoxLayout(self.resource_page)
        self.resource_layout.setContentsMargins(50, 20, 50, 20)
        self.resource_layout.setObjectName('resource_layout')
        self.resource_label = QtWidgets.QLabel(self.resource_page)
        self.resource_label.setObjectName('resource_label')
        self.resource_label.setWordWrap(True)
        self.resource_layout.addWidget(self.resource_label)
        first_time_wizard.setPage(FirstTimePage.SampleOption, self.resource_page)
        # The download page
        self.download_page = QtWidgets.QWizardPage()
        self.download_page.setObjectName('download_page')
        self.download_layout = QtWidgets.QVBoxLayout(self.download_page)
        self.download_layout.setContentsMargins(48, 48, 48, 48)
        self.download_layout.setObjectName('download_layout')
        self.download_label = QtWidgets.QLabel(self.download_page)
        self.download_label.setObjectName('download_label')
        self.download_layout.addWidget(self.download_label)
        first_time_wizard.setPage(FirstTimePage.Download, self.download_page)
        # The "you don't have an internet connection" page.
        self.no_internet_page = QtWidgets.QWizardPage()
        self.no_internet_page.setObjectName('no_internet_page')
        self.no_internet_page.setFinalPage(True)
        self.no_internet_layout = QtWidgets.QVBoxLayout(self.no_internet_page)
        self.no_internet_layout.setContentsMargins(50, 30, 50, 40)
        self.no_internet_layout.setObjectName('no_internet_layout')
        self.no_internet_label = QtWidgets.QLabel(self.no_internet_page)
        self.no_internet_label.setWordWrap(True)
        self.no_internet_label.setObjectName('no_internet_label')
        self.no_internet_layout.addWidget(self.no_internet_label)
        first_time_wizard.setPage(FirstTimePage.NoInternet, self.no_internet_page)
        # The plugins page
        self.plugin_page = QtWidgets.QWizardPage()
        self.plugin_page.setObjectName('plugin_page')
        self.plugin_layout = QtWidgets.QVBoxLayout(self.plugin_page)
        self.plugin_layout.setContentsMargins(40, 15, 40, 0)
        self.plugin_layout.setObjectName('plugin_layout')
        self.songs_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.songs_check_box.setChecked(True)
        self.songs_check_box.setObjectName('songs_check_box')
        self.plugin_layout.addWidget(self.songs_check_box)
        self.custom_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.custom_check_box.setChecked(True)
        self.custom_check_box.setObjectName('custom_check_box')
        self.plugin_layout.addWidget(self.custom_check_box)
        self.bible_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.bible_check_box.setChecked(True)
        self.bible_check_box.setObjectName('bible_check_box')
        self.plugin_layout.addWidget(self.bible_check_box)
        self.image_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.image_check_box.setChecked(True)
        self.image_check_box.setObjectName('image_check_box')
        self.plugin_layout.addWidget(self.image_check_box)
        self.presentation_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.presentation_check_box.setChecked(True)
        self.presentation_check_box.setObjectName('presentation_check_box')
        self.plugin_layout.addWidget(self.presentation_check_box)
        self.media_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.media_check_box.setChecked(True)
        self.media_check_box.setObjectName('media_check_box')
        self.plugin_layout.addWidget(self.media_check_box)
        self.song_usage_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.song_usage_check_box.setChecked(True)
        self.song_usage_check_box.setObjectName('song_usage_check_box')
        self.plugin_layout.addWidget(self.song_usage_check_box)
        self.alert_check_box = QtWidgets.QCheckBox(self.plugin_page)
        self.alert_check_box.setChecked(True)
        self.alert_check_box.setObjectName('alert_check_box')
        self.plugin_layout.addWidget(self.alert_check_box)
        first_time_wizard.setPage(FirstTimePage.Plugins, self.plugin_page)
        # The song samples page
        self.songs_page = QtWidgets.QWizardPage()
        self.songs_page.setObjectName('songs_page')
        self.songs_layout = QtWidgets.QVBoxLayout(self.songs_page)
        self.songs_layout.setContentsMargins(50, 20, 50, 20)
        self.songs_layout.setObjectName('songs_layout')
        self.songs_list_widget = QtWidgets.QListWidget(self.songs_page)
        self.songs_list_widget.setAlternatingRowColors(True)
        self.songs_list_widget.setObjectName('songs_list_widget')
        self.songs_layout.addWidget(self.songs_list_widget)
        first_time_wizard.setPage(FirstTimePage.Songs, self.songs_page)
        # The Bible samples page
        self.bibles_page = QtWidgets.QWizardPage()
        self.bibles_page.setObjectName('bibles_page')
        self.bibles_layout = QtWidgets.QVBoxLayout(self.bibles_page)
        self.bibles_layout.setContentsMargins(50, 20, 50, 20)
        self.bibles_layout.setObjectName('bibles_layout')
        self.bibles_tree_widget = QtWidgets.QTreeWidget(self.bibles_page)
        self.bibles_tree_widget.setAlternatingRowColors(True)
        self.bibles_tree_widget.header().setVisible(False)
        self.bibles_tree_widget.setObjectName('bibles_tree_widget')
        self.bibles_layout.addWidget(self.bibles_tree_widget)
        first_time_wizard.setPage(FirstTimePage.Bibles, self.bibles_page)
        # The theme samples page
        self.themes_page = QtWidgets.QWizardPage()
        self.themes_page.setObjectName('themes_page')
        self.themes_layout = QtWidgets.QVBoxLayout(self.themes_page)
        self.themes_layout.setObjectName('themes_layout')
        self.themes_list_widget = ThemeListWidget(self.themes_page)
        self.themes_layout.addWidget(self.themes_list_widget)
        self.theme_options_layout = QtWidgets.QHBoxLayout()
        self.default_theme_layout = QtWidgets.QHBoxLayout()
        self.theme_label = QtWidgets.QLabel(self.themes_page)
        self.default_theme_layout.addWidget(self.theme_label)
        self.theme_combo_box = QtWidgets.QComboBox(self.themes_page)
        self.theme_combo_box.setEditable(False)
        self.default_theme_layout.addWidget(self.theme_combo_box, stretch=1)
        self.theme_options_layout.addLayout(self.default_theme_layout, stretch=1)
        self.select_buttons_layout = QtWidgets.QHBoxLayout()
        self.themes_select_all_button = QtWidgets.QToolButton(self.themes_page)
        self.themes_select_all_button.setIcon(UiIcons().select_all)
        self.select_buttons_layout.addWidget(self.themes_select_all_button, stretch=1, alignment=QtCore.Qt.AlignRight)
        self.themes_deselect_all_button = QtWidgets.QToolButton(self.themes_page)
        self.themes_deselect_all_button.setIcon(UiIcons().select_none)
        self.select_buttons_layout.addWidget(self.themes_deselect_all_button)
        self.theme_options_layout.addLayout(self.select_buttons_layout, stretch=1)
        self.themes_layout.addLayout(self.theme_options_layout)
        first_time_wizard.setPage(FirstTimePage.Themes, self.themes_page)
        # Progress page
        self.progress_page = QtWidgets.QWizardPage()
        self.progress_page.setObjectName('progress_page')
        self.progress_layout = QtWidgets.QVBoxLayout(self.progress_page)
        self.progress_layout.setContentsMargins(48, 48, 48, 48)
        self.progress_layout.setObjectName('progress_layout')
        self.progress_label = QtWidgets.QLabel(self.progress_page)
        self.progress_label.setObjectName('progress_label')
        self.progress_layout.addWidget(self.progress_label)
        self.progress_bar = QtWidgets.QProgressBar(self.progress_page)
        self.progress_bar.setObjectName('progress_bar')
        self.progress_layout.addWidget(self.progress_bar)
        first_time_wizard.setPage(FirstTimePage.Progress, self.progress_page)
        self.retranslate_ui()