From 66d8a188fedbeddfc888a79338e344bb7770403d Mon Sep 17 00:00:00 2001 From: M2j Date: Thu, 23 Dec 2010 18:44:42 +0100 Subject: [PATCH 01/13] Remove most manual formating in the themewizard (regards to bug #686103) --- openlp/core/ui/themeform.py | 11 + openlp/core/ui/themewizard.py | 332 +++++------------ resources/forms/themewizard.ui | 661 +++++++-------------------------- 3 files changed, 242 insertions(+), 762 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 7ed58e943..94a4e858a 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -456,6 +456,17 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.theme.background_type = BackgroundType.to_string(index) self.setBackgroundTabValues() + self.colorLabel.setVisible(index == 0) + self.colorButton.setVisible(index == 0) + self.gradientStartLabel.setVisible(index == 1) + self.gradientStartButton.setVisible(index == 1) + self.gradientEndLabel.setVisible(index == 1) + self.gradientEndButton.setVisible(index == 1) + self.gradientTypeLabel.setVisible(index == 1) + self.gradientComboBox.setVisible(index == 1) + self.imageLabel.setVisible(index == 2) + self.imageLineEdit.setVisible(index == 2) + self.imageBrowseButton.setVisible(index == 2) def onGradientComboBox(self, index): """ diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index d86792af4..84ef6c714 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -31,24 +31,21 @@ from openlp.core.lib import translate, build_icon class Ui_ThemeWizard(object): def setupUi(self, ThemeWizard): ThemeWizard.setObjectName(u'OpenLP.ThemeWizard') - ThemeWizard.resize(550, 386) ThemeWizard.setModal(True) ThemeWizard.setWizardStyle(QtGui.QWizard.ModernStyle) ThemeWizard.setOptions( QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage) self.welcomePage = QtGui.QWizardPage() - self.welcomePage.setTitle(u'') - self.welcomePage.setSubTitle(u'') - self.welcomePage.setObjectName(u'welcomePage') self.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap, QtGui.QPixmap(u':/wizards/wizard_createtheme.bmp')) + self.welcomePage.setObjectName(u'welcomePage') self.welcomeLayout = QtGui.QHBoxLayout(self.welcomePage) - self.welcomeLayout.setSpacing(8) self.welcomeLayout.setMargin(0) self.welcomeLayout.setObjectName(u'welcomeLayout') self.welcomePageLayout = QtGui.QVBoxLayout() - self.welcomePageLayout.setSpacing(8) + self.welcomePageLayout.setSpacing(6) + self.welcomePageLayout.setMargin(12) self.welcomePageLayout.setObjectName(u'welcomePageLayout') self.titleLabel = QtGui.QLabel(self.welcomePage) self.titleLabel.setObjectName(u'titleLabel') @@ -58,7 +55,6 @@ class Ui_ThemeWizard(object): self.welcomePageLayout.addItem(self.welcomeTopSpacer) self.informationLabel = QtGui.QLabel(self.welcomePage) self.informationLabel.setWordWrap(True) - self.informationLabel.setMargin(10) self.informationLabel.setObjectName(u'informationLabel') self.welcomePageLayout.addWidget(self.informationLabel) self.welcomeBottomSpacer = QtGui.QSpacerItem(20, 40, @@ -68,137 +64,91 @@ class Ui_ThemeWizard(object): ThemeWizard.addPage(self.welcomePage) self.backgroundPage = QtGui.QWizardPage() self.backgroundPage.setObjectName(u'backgroundPage') - self.backgroundLayout = QtGui.QVBoxLayout(self.backgroundPage) - self.backgroundLayout.setSpacing(8) - self.backgroundLayout.setMargin(20) + self.backgroundLayout = QtGui.QFormLayout(self.backgroundPage) + self.backgroundLayout.setMargin(12) + self.backgroundLayout.setVerticalSpacing(6) self.backgroundLayout.setObjectName(u'backgroundLayout') - self.backgroundTypeLayout = QtGui.QHBoxLayout() - self.backgroundTypeLayout.setSpacing(8) - self.backgroundTypeLayout.setObjectName(u'backgroundTypeLayout') self.backgroundTypeLabel = QtGui.QLabel(self.backgroundPage) self.backgroundTypeLabel.setObjectName(u'backgroundTypeLabel') - self.backgroundTypeLayout.addWidget(self.backgroundTypeLabel) + self.backgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.backgroundTypeLabel) self.backgroundTypeComboBox = QtGui.QComboBox(self.backgroundPage) + self.backgroundTypeComboBox.addItem(u'') + self.backgroundTypeComboBox.addItem(u'') + self.backgroundTypeComboBox.addItem(u'') self.backgroundTypeComboBox.setObjectName(u'backgroundTypeComboBox') - self.backgroundTypeComboBox.addItem(u'') - self.backgroundTypeComboBox.addItem(u'') - self.backgroundTypeComboBox.addItem(u'') - self.backgroundTypeLayout.addWidget(self.backgroundTypeComboBox) - self.backgroundTypeSpacer = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.backgroundTypeLayout.addItem(self.backgroundTypeSpacer) - self.backgroundLayout.addLayout(self.backgroundTypeLayout) - self.backgroundStackedWidget = QtGui.QStackedWidget( - self.backgroundPage) - self.backgroundStackedWidget.setObjectName(u'backgroundStackedWidget') - self.colorPage = QtGui.QWidget() - self.colorPage.setObjectName(u'colorPage') - self.colorLayout = QtGui.QFormLayout(self.colorPage) - self.colorLayout.setMargin(0) - self.colorLayout.setSpacing(8) - self.colorLayout.setObjectName(u'colorLayout') - self.colorLabel = QtGui.QLabel(self.colorPage) - self.colorLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.colorLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) + self.backgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.backgroundTypeComboBox) + self.colorLabel = QtGui.QLabel(self.backgroundPage) self.colorLabel.setObjectName(u'colorLabel') - self.colorLayout.setWidget(0, - QtGui.QFormLayout.LabelRole, self.colorLabel) - self.colorButton = QtGui.QPushButton(self.colorPage) - self.colorButton.setText(u'') + self.backgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.colorLabel) + self.colorButton = QtGui.QPushButton(self.backgroundPage) self.colorButton.setObjectName(u'colorButton') - self.colorLayout.setWidget(0, - QtGui.QFormLayout.FieldRole, self.colorButton) - self.backgroundStackedWidget.addWidget(self.colorPage) - self.gradientPage = QtGui.QWidget() - self.gradientPage.setObjectName(u'gradientPage') - self.gradientLayout = QtGui.QFormLayout(self.gradientPage) - self.gradientLayout.setMargin(0) - self.gradientLayout.setSpacing(8) - self.gradientLayout.setObjectName(u'gradientLayout') - self.gradientStartLabel = QtGui.QLabel(self.gradientPage) - self.gradientStartLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.gradientStartLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) + self.backgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.colorButton) + self.gradientStartLabel = QtGui.QLabel(self.backgroundPage) + self.gradientStartLabel.setVisible(False) self.gradientStartLabel.setObjectName(u'gradientStartLabel') - self.gradientLayout.setWidget(0, - QtGui.QFormLayout.LabelRole, self.gradientStartLabel) - self.gradientStartButton = QtGui.QPushButton(self.gradientPage) - self.gradientStartButton.setText(u'') + self.backgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.gradientStartLabel) + self.gradientStartButton = QtGui.QPushButton(self.backgroundPage) + self.gradientStartButton.setVisible(False) self.gradientStartButton.setObjectName(u'gradientStartButton') - self.gradientLayout.setWidget(0, - QtGui.QFormLayout.FieldRole, self.gradientStartButton) - self.gradientEndLabel = QtGui.QLabel(self.gradientPage) - self.gradientEndLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.gradientEndLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) + self.backgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.gradientStartButton) + self.gradientEndLabel = QtGui.QLabel(self.backgroundPage) + self.gradientEndLabel.setVisible(False) self.gradientEndLabel.setObjectName(u'gradientEndLabel') - self.gradientLayout.setWidget(1, - QtGui.QFormLayout.LabelRole, self.gradientEndLabel) - self.gradientEndButton = QtGui.QPushButton(self.gradientPage) - self.gradientEndButton.setText(u'') + self.backgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, + self.gradientEndLabel) + self.gradientEndButton = QtGui.QPushButton(self.backgroundPage) + self.gradientEndButton.setVisible(False) self.gradientEndButton.setObjectName(u'gradientEndButton') - self.gradientLayout.setWidget(1, - QtGui.QFormLayout.FieldRole, self.gradientEndButton) - self.gradientTypeLabel = QtGui.QLabel(self.gradientPage) - self.gradientTypeLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.gradientTypeLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) + self.backgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, + self.gradientEndButton) + self.gradientTypeLabel = QtGui.QLabel(self.backgroundPage) + self.gradientTypeLabel.setVisible(False) self.gradientTypeLabel.setObjectName(u'gradientTypeLabel') - self.gradientLayout.setWidget(2, - QtGui.QFormLayout.LabelRole, self.gradientTypeLabel) - self.gradientComboBox = QtGui.QComboBox(self.gradientPage) + self.backgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, + self.gradientTypeLabel) + self.gradientComboBox = QtGui.QComboBox(self.backgroundPage) + self.gradientComboBox.setVisible(False) self.gradientComboBox.setObjectName(u'gradientComboBox') self.gradientComboBox.addItem(u'') self.gradientComboBox.addItem(u'') self.gradientComboBox.addItem(u'') self.gradientComboBox.addItem(u'') self.gradientComboBox.addItem(u'') - self.gradientLayout.setWidget(2, - QtGui.QFormLayout.FieldRole, self.gradientComboBox) - self.backgroundStackedWidget.addWidget(self.gradientPage) - self.imagePage = QtGui.QWidget() - self.imagePage.setObjectName(u'imagePage') - self.imageLayout = QtGui.QFormLayout(self.imagePage) - self.imageLayout.setMargin(0) - self.imageLayout.setSpacing(8) - self.imageLayout.setObjectName(u'imageLayout') - self.imageLabel = QtGui.QLabel(self.imagePage) - self.imageLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.imageLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) + self.backgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, + self.gradientComboBox) + self.imageLabel = QtGui.QLabel(self.backgroundPage) + self.imageLabel.setVisible(False) self.imageLabel.setObjectName(u'imageLabel') - self.imageLayout.setWidget(0, - QtGui.QFormLayout.LabelRole, self.imageLabel) + self.backgroundLayout.setWidget(5, QtGui.QFormLayout.LabelRole, + self.imageLabel) self.imageFileLayout = QtGui.QHBoxLayout() - self.imageFileLayout.setSpacing(8) self.imageFileLayout.setObjectName(u'imageFileLayout') - self.imageLineEdit = QtGui.QLineEdit(self.imagePage) + self.imageLineEdit = QtGui.QLineEdit(self.backgroundPage) + self.imageLineEdit.setVisible(False) self.imageLineEdit.setObjectName(u'imageLineEdit') self.imageFileLayout.addWidget(self.imageLineEdit) - self.imageBrowseButton = QtGui.QToolButton(self.imagePage) - self.imageBrowseButton.setText(u'') + self.imageBrowseButton = QtGui.QToolButton(self.backgroundPage) + self.imageBrowseButton.setVisible(False) + self.imageBrowseButton.setObjectName(u'imageBrowseButton') self.imageBrowseButton.setIcon( build_icon(u':/general/general_open.png')) - self.imageBrowseButton.setObjectName(u'imageBrowseButton') self.imageFileLayout.addWidget(self.imageBrowseButton) - self.imageLayout.setLayout(0, - QtGui.QFormLayout.FieldRole, self.imageFileLayout) - self.backgroundStackedWidget.addWidget(self.imagePage) - self.backgroundLayout.addWidget(self.backgroundStackedWidget) + self.backgroundLayout.setLayout(5, QtGui.QFormLayout.FieldRole, + self.imageFileLayout) ThemeWizard.addPage(self.backgroundPage) self.mainAreaPage = QtGui.QWizardPage() self.mainAreaPage.setObjectName(u'mainAreaPage') self.mainAreaLayout = QtGui.QFormLayout(self.mainAreaPage) - self.mainAreaLayout.setFormAlignment(QtCore.Qt.AlignLeading | - QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) - self.mainAreaLayout.setMargin(20) - self.mainAreaLayout.setSpacing(8) + self.mainAreaLayout.setMargin(12) + self.mainAreaLayout.setVerticalSpacing(6) self.mainAreaLayout.setObjectName(u'mainAreaLayout') self.mainFontLabel = QtGui.QLabel(self.mainAreaPage) - self.mainFontLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.mainFontLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.mainFontLabel.setObjectName(u'mainFontLabel') self.mainAreaLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.mainFontLabel) @@ -211,10 +161,9 @@ class Ui_ThemeWizard(object): self.mainAreaLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.mainColorLabel) self.fontPropertiesLayout = QtGui.QHBoxLayout() - self.fontPropertiesLayout.setSpacing(24) + self.fontPropertiesLayout.setSpacing(12) self.fontPropertiesLayout.setObjectName(u'fontPropertiesLayout') self.mainColorPushButton = QtGui.QPushButton(self.mainAreaPage) - self.mainColorPushButton.setText(u'') self.mainColorPushButton.setObjectName(u'mainColorPushButton') self.fontPropertiesLayout.addWidget(self.mainColorPushButton) self.boldCheckBox = QtGui.QCheckBox(self.mainAreaPage) @@ -230,18 +179,8 @@ class Ui_ThemeWizard(object): self.mainAreaLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.mainSizeLabel) self.mainSizeLayout = QtGui.QHBoxLayout() - self.mainSizeLayout.setSpacing(8) - self.mainSizeLayout.setMargin(0) self.mainSizeLayout.setObjectName(u'mainSizeLayout') self.mainSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.mainSizeSpinBox.sizePolicy().hasHeightForWidth()) - self.mainSizeSpinBox.setSizePolicy(sizePolicy) - self.mainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) self.mainSizeSpinBox.setMaximum(999) self.mainSizeSpinBox.setProperty(u'value', 16) self.mainSizeSpinBox.setObjectName(u'mainSizeSpinBox') @@ -268,8 +207,6 @@ class Ui_ThemeWizard(object): self.outlineLayout = QtGui.QHBoxLayout() self.outlineLayout.setObjectName(u'outlineLayout') self.outlineColorPushButton = QtGui.QPushButton(self.mainAreaPage) - self.outlineColorPushButton.setEnabled(True) - self.outlineColorPushButton.setText(u'') self.outlineColorPushButton.setObjectName(u'outlineColorPushButton') self.outlineLayout.addWidget(self.outlineColorPushButton) self.outlineSizeLabel = QtGui.QLabel(self.mainAreaPage) @@ -287,8 +224,6 @@ class Ui_ThemeWizard(object): self.shadowLayout = QtGui.QHBoxLayout() self.shadowLayout.setObjectName(u'shadowLayout') self.shadowColorPushButton = QtGui.QPushButton(self.mainAreaPage) - self.shadowColorPushButton.setEnabled(True) - self.shadowColorPushButton.setText(u'') self.shadowColorPushButton.setObjectName(u'shadowColorPushButton') self.shadowLayout.addWidget(self.shadowColorPushButton) self.shadowSizeLabel = QtGui.QLabel(self.mainAreaPage) @@ -303,15 +238,10 @@ class Ui_ThemeWizard(object): self.footerAreaPage = QtGui.QWizardPage() self.footerAreaPage.setObjectName(u'footerAreaPage') self.footerLayout = QtGui.QFormLayout(self.footerAreaPage) - self.footerLayout.setFieldGrowthPolicy( - QtGui.QFormLayout.ExpandingFieldsGrow) - self.footerLayout.setMargin(20) - self.footerLayout.setSpacing(8) + self.footerLayout.setMargin(12) + self.footerLayout.setVerticalSpacing(6) self.footerLayout.setObjectName(u'footerLayout') self.footerFontLabel = QtGui.QLabel(self.footerAreaPage) - self.footerFontLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.footerFontLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.footerFontLabel.setObjectName(u'footerFontLabel') self.footerLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.footerFontLabel) @@ -324,7 +254,6 @@ class Ui_ThemeWizard(object): self.footerLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.footerColorLabel) self.footerColorPushButton = QtGui.QPushButton(self.footerAreaPage) - self.footerColorPushButton.setText(u'') self.footerColorPushButton.setObjectName(u'footerColorPushButton') self.footerLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.footerColorPushButton) @@ -333,14 +262,6 @@ class Ui_ThemeWizard(object): self.footerLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.footerSizeLabel) self.footerSizeSpinBox = QtGui.QSpinBox(self.footerAreaPage) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.footerSizeSpinBox.sizePolicy().hasHeightForWidth()) - self.footerSizeSpinBox.setSizePolicy(sizePolicy) - self.footerSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) self.footerSizeSpinBox.setMaximum(999) self.footerSizeSpinBox.setProperty(u'value', 10) self.footerSizeSpinBox.setObjectName(u'footerSizeSpinBox') @@ -350,18 +271,14 @@ class Ui_ThemeWizard(object): self.alignmentPage = QtGui.QWizardPage() self.alignmentPage.setObjectName(u'alignmentPage') self.alignmentLayout = QtGui.QFormLayout(self.alignmentPage) - self.alignmentLayout.setMargin(20) - self.alignmentLayout.setSpacing(8) + self.alignmentLayout.setMargin(12) + self.alignmentLayout.setVerticalSpacing(6) self.alignmentLayout.setObjectName(u'alignmentLayout') self.horizontalLabel = QtGui.QLabel(self.alignmentPage) - self.horizontalLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.horizontalLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.horizontalLabel.setObjectName(u'horizontalLabel') self.alignmentLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.horizontalLabel) self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage) - self.horizontalComboBox.setEditable(False) self.horizontalComboBox.setObjectName(u'horizontalComboBox') self.horizontalComboBox.addItem(u'') self.horizontalComboBox.addItem(u'') @@ -387,106 +304,67 @@ class Ui_ThemeWizard(object): self.areaPositionPage = QtGui.QWizardPage() self.areaPositionPage.setObjectName(u'areaPositionPage') self.areaPositionLayout = QtGui.QGridLayout(self.areaPositionPage) - self.areaPositionLayout.setMargin(20) - self.areaPositionLayout.setSpacing(8) self.areaPositionLayout.setObjectName(u'areaPositionLayout') self.mainPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage) - self.mainPositionGroupBox.setMinimumSize(QtCore.QSize(248, 0)) self.mainPositionGroupBox.setObjectName(u'mainPositionGroupBox') self.mainPositionLayout = QtGui.QFormLayout(self.mainPositionGroupBox) - self.mainPositionLayout.setMargin(8) - self.mainPositionLayout.setSpacing(8) + self.mainPositionLayout.setSpacing(6) self.mainPositionLayout.setObjectName(u'mainPositionLayout') self.mainDefaultPositionCheckBox = QtGui.QCheckBox( self.mainPositionGroupBox) self.mainDefaultPositionCheckBox.setChecked(True) - self.mainDefaultPositionCheckBox.setTristate(False) self.mainDefaultPositionCheckBox.setObjectName( u'mainDefaultPositionCheckBox') self.mainPositionLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.mainDefaultPositionCheckBox) - self.nainXLabel = QtGui.QLabel(self.mainPositionGroupBox) - self.nainXLabel.setObjectName(u'nainXLabel') + self.mainXLabel = QtGui.QLabel(self.mainPositionGroupBox) + self.mainXLabel.setObjectName(u'mainXLabel') self.mainPositionLayout.setWidget(1, - QtGui.QFormLayout.LabelRole, self.nainXLabel) + QtGui.QFormLayout.LabelRole, self.mainXLabel) self.mainXSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) self.mainXSpinBox.setEnabled(False) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.mainXSpinBox.sizePolicy().hasHeightForWidth()) - self.mainXSpinBox.setSizePolicy(sizePolicy) - self.mainXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.mainXSpinBox.setMaximum(9999) self.mainXSpinBox.setProperty(u'value', 0) self.mainXSpinBox.setObjectName(u'mainXSpinBox') self.mainPositionLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.mainXSpinBox) - self.mainYSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) - self.mainYSpinBox.setEnabled(False) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.mainYSpinBox.sizePolicy().hasHeightForWidth()) - self.mainYSpinBox.setSizePolicy(sizePolicy) - self.mainYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.mainYSpinBox.setMaximum(9999) - self.mainYSpinBox.setObjectName(u'mainYSpinBox') - self.mainPositionLayout.setWidget(2, - QtGui.QFormLayout.FieldRole, self.mainYSpinBox) self.mainYLabel = QtGui.QLabel(self.mainPositionGroupBox) self.mainYLabel.setObjectName(u'mainYLabel') self.mainPositionLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.mainYLabel) - self.mainWidthSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) - self.mainWidthSpinBox.setEnabled(False) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.mainWidthSpinBox.sizePolicy().hasHeightForWidth()) - self.mainWidthSpinBox.setSizePolicy(sizePolicy) - self.mainWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.mainWidthSpinBox.setMaximum(9999) - self.mainWidthSpinBox.setObjectName(u'mainWidthSpinBox') - self.mainPositionLayout.setWidget(3, - QtGui.QFormLayout.FieldRole, self.mainWidthSpinBox) + self.mainYSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) + self.mainYSpinBox.setEnabled(False) + self.mainYSpinBox.setMaximum(9999) + self.mainYSpinBox.setObjectName(u'mainYSpinBox') + self.mainPositionLayout.setWidget(2, + QtGui.QFormLayout.FieldRole, self.mainYSpinBox) self.mainWidthLabel = QtGui.QLabel(self.mainPositionGroupBox) self.mainWidthLabel.setObjectName(u'mainWidthLabel') self.mainPositionLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.mainWidthLabel) - self.mainHeightSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) - self.mainHeightSpinBox.setEnabled(False) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.mainHeightSpinBox.sizePolicy().hasHeightForWidth()) - self.mainHeightSpinBox.setSizePolicy(sizePolicy) - self.mainHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.mainHeightSpinBox.setMaximum(9999) - self.mainHeightSpinBox.setObjectName(u'mainHeightSpinBox') - self.mainPositionLayout.setWidget(4, - QtGui.QFormLayout.FieldRole, self.mainHeightSpinBox) + self.mainWidthSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) + self.mainWidthSpinBox.setEnabled(False) + self.mainWidthSpinBox.setMaximum(9999) + self.mainWidthSpinBox.setObjectName(u'mainWidthSpinBox') + self.mainPositionLayout.setWidget(3, + QtGui.QFormLayout.FieldRole, self.mainWidthSpinBox) self.mainHeightLabel = QtGui.QLabel(self.mainPositionGroupBox) self.mainHeightLabel.setObjectName(u'mainHeightLabel') self.mainPositionLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.mainHeightLabel) + self.mainHeightSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) + self.mainHeightSpinBox.setEnabled(False) + self.mainHeightSpinBox.setMaximum(9999) + self.mainHeightSpinBox.setObjectName(u'mainHeightSpinBox') + self.mainPositionLayout.setWidget(4, + QtGui.QFormLayout.FieldRole, self.mainHeightSpinBox) self.areaPositionLayout.addWidget( self.mainPositionGroupBox, 1, 0, 1, 1) self.footerPositionGroupBox = QtGui.QGroupBox(self.areaPositionPage) - self.footerPositionGroupBox.setMinimumSize(QtCore.QSize(248, 0)) self.footerPositionGroupBox.setObjectName(u'footerPositionGroupBox') self.footerPositionLayout = QtGui.QFormLayout( self.footerPositionGroupBox) - self.footerPositionLayout.setMargin(8) - self.footerPositionLayout.setSpacing(8) + self.footerPositionLayout.setVerticalSpacing(6) self.footerPositionLayout.setObjectName(u'footerPositionLayout') self.footerXLabel = QtGui.QLabel(self.footerPositionGroupBox) self.footerXLabel.setObjectName(u'footerXLabel') @@ -494,14 +372,6 @@ class Ui_ThemeWizard(object): QtGui.QFormLayout.LabelRole, self.footerXLabel) self.footerXSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) self.footerXSpinBox.setEnabled(False) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.footerXSpinBox.sizePolicy().hasHeightForWidth()) - self.footerXSpinBox.setSizePolicy(sizePolicy) - self.footerXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.footerXSpinBox.setMaximum(9999) self.footerXSpinBox.setProperty(u'value', 0) self.footerXSpinBox.setObjectName(u'footerXSpinBox') @@ -513,14 +383,6 @@ class Ui_ThemeWizard(object): QtGui.QFormLayout.LabelRole, self.footerYLabel) self.footerYSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) self.footerYSpinBox.setEnabled(False) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.footerYSpinBox.sizePolicy().hasHeightForWidth()) - self.footerYSpinBox.setSizePolicy(sizePolicy) - self.footerYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.footerYSpinBox.setMaximum(9999) self.footerYSpinBox.setProperty(u'value', 0) self.footerYSpinBox.setObjectName(u'footerYSpinBox') @@ -561,17 +423,12 @@ class Ui_ThemeWizard(object): self.previewPage = QtGui.QWizardPage() self.previewPage.setObjectName(u'previewPage') self.previewLayout = QtGui.QVBoxLayout(self.previewPage) - self.previewLayout.setSpacing(8) - self.previewLayout.setMargin(20) + self.previewLayout.setSpacing(6) + self.previewLayout.setMargin(12) self.previewLayout.setObjectName(u'previewLayout') self.themeNameLayout = QtGui.QHBoxLayout() - self.themeNameLayout.setSpacing(8) self.themeNameLayout.setObjectName(u'themeNameLayout') self.themeNameLabel = QtGui.QLabel(self.previewPage) - self.themeNameLabel.setMinimumSize(QtCore.QSize(103, 0)) - self.themeNameLabel.setTextFormat(QtCore.Qt.PlainText) - self.themeNameLabel.setAlignment(QtCore.Qt.AlignRight | - QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.themeNameLabel.setObjectName(u'themeNameLabel') self.themeNameLayout.addWidget(self.themeNameLabel) self.themeNameEdit = QtGui.QLineEdit(self.previewPage) @@ -579,9 +436,8 @@ class Ui_ThemeWizard(object): self.themeNameLayout.addWidget(self.themeNameEdit) self.previewLayout.addLayout(self.themeNameLayout) self.previewPaneLayout = QtGui.QHBoxLayout() - self.previewPaneLayout.setSpacing(0) self.previewPaneLayout.setObjectName(u'previewPaneLayout') - self.previewLeftSpacer = QtGui.QSpacerItem(58, 20, + self.previewLeftSpacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.previewPaneLayout.addItem(self.previewLeftSpacer) self.previewBoxLabel = QtGui.QLabel(self.previewPage) @@ -596,11 +452,10 @@ class Ui_ThemeWizard(object): self.previewBoxLabel.setFrameShape(QtGui.QFrame.WinPanel) self.previewBoxLabel.setFrameShadow(QtGui.QFrame.Sunken) self.previewBoxLabel.setLineWidth(1) - self.previewBoxLabel.setText(u'') self.previewBoxLabel.setScaledContents(True) self.previewBoxLabel.setObjectName(u'previewBoxLabel') self.previewPaneLayout.addWidget(self.previewBoxLabel) - self.previewRightSpacer = QtGui.QSpacerItem(78, 20, + self.previewRightSpacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.previewPaneLayout.addItem(self.previewRightSpacer) self.previewLayout.addLayout(self.previewPaneLayout) @@ -608,15 +463,10 @@ class Ui_ThemeWizard(object): self.themeNameLabel.setBuddy(self.themeNameEdit) self.retranslateUi(ThemeWizard) - self.backgroundStackedWidget.setCurrentIndex(0) QtCore.QObject.connect( ThemeWizard, QtCore.SIGNAL(u'accepted()'), ThemeWizard.accept) - QtCore.QObject.connect( - self.backgroundTypeComboBox, - QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.backgroundStackedWidget.setCurrentIndex) QtCore.QMetaObject.connectSlotsByName(ThemeWizard) def retranslateUi(self, ThemeWizard): @@ -627,7 +477,7 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Welcome to the Theme Wizard')) self.informationLabel.setText( translate('OpenLP.ThemeWizard', 'This wizard will help you to ' - 'create and edit your themes . Click the next button below to ' + 'create and edit your themes. Click the next button below to ' 'start the process by setting up your background.')) self.backgroundPage.setTitle( translate('OpenLP.ThemeWizard', 'Set Up Background')) @@ -727,7 +577,7 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', '&Main Area')) self.mainDefaultPositionCheckBox.setText( translate('OpenLP.ThemeWizard', '&Use default location')) - self.nainXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:')) + self.mainXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:')) self.mainXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.mainYSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) self.mainYLabel.setText(translate('OpenLP.ThemeWizard', 'Y position:')) @@ -737,7 +587,7 @@ class Ui_ThemeWizard(object): self.mainHeightLabel.setText( translate('OpenLP.ThemeWizard', 'Height:')) self.footerPositionGroupBox.setTitle( - translate('OpenLP.ThemeWizard', 'Footer Area')) + translate('OpenLP.ThemeWizard', '&Footer Area')) self.footerXLabel.setText( translate('OpenLP.ThemeWizard', 'X position:')) self.footerXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) diff --git a/resources/forms/themewizard.ui b/resources/forms/themewizard.ui index 9e1f8f9e8..f6428cdc7 100644 --- a/resources/forms/themewizard.ui +++ b/resources/forms/themewizard.ui @@ -2,14 +2,6 @@ ThemeWizard - - - 0 - 0 - 550 - 386 - - Theme Wizard @@ -23,51 +15,30 @@ QWizard::IndependentPages|QWizard::NoBackButtonOnStartPage - - - - - - - - 8 - 0 - - - 163 - 0 - - - - - 163 - 16777215 - - - - 0 - - - + + + 0 + 0 + :/wizards/wizard_importbible.bmp - - 0 - - 8 + 6 + + + 12 @@ -78,6 +49,9 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:600;">Welcome to the Theme Wizard</span></p></body></html> + + true + @@ -99,14 +73,11 @@ p, li { white-space: pre-wrap; } - This wizard will help you to maintain Themes . Click the next button below to start the process by setting up your background. + This wizard will help you to maintain Themes. Click the next button below to start the process by setting up your background. true - - 10 - @@ -133,256 +104,127 @@ p, li { white-space: pre-wrap; } Set up your theme's background according to the parameters below. - - - 8 + + + 6 - 20 + 12 - - - - 8 + + + + Background type: + + + + - - - Background type: - - + + Solid Color + - - - - Solid Color - - - - - Gradient - - - - - Image - - - + + Gradient + - - - Qt::Horizontal + + Image + + + + + + + + Color: + + + + + + + + + + Starting color: + + + + + + + + + + Ending color: + + + + + + + + + + Gradient: + + + + + + + + Horizontal + + + + + Vertical + + + + + Circular + + + + + Top Left - Bottom Right + + + + + Bottom Left - Top Right + + + + + + + + Image: + + + + + + + + + + + + + :/general/general_open.png:/general/general_open.png - - - 40 - 20 - - - + - - - - 0 - - - - - 8 - - - 8 - - - 0 - - - - - - 103 - 0 - - - - Color: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - - - 8 - - - 8 - - - 0 - - - - - - 103 - 0 - - - - Starting color: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - - 103 - 0 - - - - Ending color: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - - - - - - - - 103 - 0 - - - - Gradient: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - Horizontal - - - - - Vertical - - - - - Circular - - - - - Top Left - Bottom Right - - - - - Bottom Left - Top Right - - - - - - - - - - 8 - - - 8 - - - 0 - - - - - - 103 - 0 - - - - Image: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 8 - - - - - - - - - - - - :/general/general_open.png:/general/general_open.png - - - - - - - - - @@ -393,29 +235,17 @@ p, li { white-space: pre-wrap; } Define the font and display characteristics for the Display text - - 8 - - 8 + 6 - 20 + 12 - - - 103 - 0 - - Font: - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - @@ -431,14 +261,10 @@ p, li { white-space: pre-wrap; } - 24 + 12 - - - - - + @@ -465,26 +291,8 @@ p, li { white-space: pre-wrap; } - - 8 - - - 0 - - - - 0 - 0 - - - - - 70 - 0 - - pt @@ -535,14 +343,7 @@ p, li { white-space: pre-wrap; } - - - true - - - - - + @@ -574,9 +375,6 @@ p, li { white-space: pre-wrap; } true - - - @@ -605,32 +403,17 @@ p, li { white-space: pre-wrap; } Define the font and display characteristics for the Footer text - - QFormLayout::ExpandingFieldsGrow - - - 8 - - 8 + 6 - 20 + 12 - - - 103 - 0 - - Font: - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - @@ -644,11 +427,7 @@ p, li { white-space: pre-wrap; } - - - - - + @@ -659,18 +438,6 @@ p, li { white-space: pre-wrap; } - - - 0 - 0 - - - - - 70 - 0 - - pt @@ -692,36 +459,21 @@ p, li { white-space: pre-wrap; } Allows additional display formatting information to be defined - - 8 - - 8 + 6 - 20 + 12 - - - 103 - 0 - - Horizontal Align: - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - Left @@ -783,31 +535,16 @@ p, li { white-space: pre-wrap; } - 20 - - - 8 + 12 - - - 248 - 0 - - &Main Area - - 8 - - 8 - - - 8 + 6 @@ -817,13 +554,10 @@ p, li { white-space: pre-wrap; } true - - false - - + X position: @@ -840,12 +574,6 @@ p, li { white-space: pre-wrap; } 0 - - - 78 - 0 - - px @@ -868,12 +596,6 @@ p, li { white-space: pre-wrap; } 0 - - - 78 - 0 - - px @@ -900,12 +622,6 @@ p, li { white-space: pre-wrap; } 0 - - - 78 - 0 - - px @@ -926,18 +642,6 @@ p, li { white-space: pre-wrap; } false - - - 0 - 0 - - - - - 78 - 0 - - px @@ -958,24 +662,12 @@ p, li { white-space: pre-wrap; } - - - 248 - 0 - - - Footer Area + &Footer Area - - 8 - - 8 - - - 8 + 6 @@ -989,18 +681,6 @@ p, li { white-space: pre-wrap; } false - - - 0 - 0 - - - - - 78 - 0 - - px @@ -1024,18 +704,6 @@ p, li { white-space: pre-wrap; } false - - - 0 - 0 - - - - - 78 - 0 - - px @@ -1059,12 +727,6 @@ p, li { white-space: pre-wrap; } false - - - 78 - 0 - - px @@ -1085,12 +747,6 @@ p, li { white-space: pre-wrap; } false - - - 78 - 0 - - px @@ -1123,33 +779,18 @@ p, li { white-space: pre-wrap; } - 8 + 6 - 20 + 12 - - 8 - - - - 103 - 0 - - Theme name: - - Qt::PlainText - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - themeNameEdit @@ -1162,9 +803,6 @@ p, li { white-space: pre-wrap; } - - 0 - @@ -1172,7 +810,7 @@ p, li { white-space: pre-wrap; } - 58 + 40 20 @@ -1201,9 +839,6 @@ p, li { white-space: pre-wrap; } 1 - - - true @@ -1216,7 +851,7 @@ p, li { white-space: pre-wrap; } - 78 + 40 20 @@ -1247,21 +882,5 @@ p, li { white-space: pre-wrap; } - - backgroundTypeComboBox - currentIndexChanged(int) - backgroundStackedWidget - setCurrentIndex(int) - - - 178 - 78 - - - 249 - 199 - - - From b0a53020f6ad87ebb4923216b00004d58f5be0cf Mon Sep 17 00:00:00 2001 From: M2j Date: Fri, 24 Dec 2010 01:44:41 +0100 Subject: [PATCH 02/13] bible wizard without manual design tweaks --- openlp/core/ui/themewizard.py | 18 +- .../plugins/bibles/forms/bibleimportform.py | 81 ++-- .../plugins/bibles/forms/bibleimportwizard.py | 445 ++++++++---------- 3 files changed, 258 insertions(+), 286 deletions(-) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 84ef6c714..ce17e233a 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -40,27 +40,23 @@ class Ui_ThemeWizard(object): self.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap, QtGui.QPixmap(u':/wizards/wizard_createtheme.bmp')) self.welcomePage.setObjectName(u'welcomePage') - self.welcomeLayout = QtGui.QHBoxLayout(self.welcomePage) - self.welcomeLayout.setMargin(0) + self.welcomeLayout = QtGui.QVBoxLayout(self.welcomePage) + self.welcomeLayout.setMargin(12) + self.welcomeLayout.setSpacing(6) self.welcomeLayout.setObjectName(u'welcomeLayout') - self.welcomePageLayout = QtGui.QVBoxLayout() - self.welcomePageLayout.setSpacing(6) - self.welcomePageLayout.setMargin(12) - self.welcomePageLayout.setObjectName(u'welcomePageLayout') self.titleLabel = QtGui.QLabel(self.welcomePage) self.titleLabel.setObjectName(u'titleLabel') - self.welcomePageLayout.addWidget(self.titleLabel) + self.welcomeLayout.addWidget(self.titleLabel) self.welcomeTopSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - self.welcomePageLayout.addItem(self.welcomeTopSpacer) + self.welcomeLayout.addItem(self.welcomeTopSpacer) self.informationLabel = QtGui.QLabel(self.welcomePage) self.informationLabel.setWordWrap(True) self.informationLabel.setObjectName(u'informationLabel') - self.welcomePageLayout.addWidget(self.informationLabel) + self.welcomeLayout.addWidget(self.informationLabel) self.welcomeBottomSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.welcomePageLayout.addItem(self.welcomeBottomSpacer) - self.welcomeLayout.addLayout(self.welcomePageLayout) + self.welcomeLayout.addItem(self.welcomeBottomSpacer) ThemeWizard.addPage(self.welcomePage) self.backgroundPage = QtGui.QWizardPage() self.backgroundPage.setObjectName(u'backgroundPage') diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 0cc62074c..82f549694 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -79,12 +79,8 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): QtGui.QWizard.__init__(self, parent) self.setupUi(self) self.registerFields() - if not BibleFormat.get_availability(BibleFormat.OpenLP1): - self.openlp1Page.setVisible(False) - self.openlp1LocationLabel.setVisible(False) - self.openlp1LocationEdit.setVisible(False) - self.openlp1FileButton.setVisible(False) - self.openlp1DisabledLabel.setVisible(True) + self.hasOpenlp1Import = \ + BibleFormat.get_availability(BibleFormat.OpenLP1) self.finishButton = self.button(QtGui.QWizard.FinishButton) self.cancelButton = self.button(QtGui.QWizard.CancelButton) self.manager = manager @@ -92,19 +88,22 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.manager.set_process_dialog(self) self.web_bible_list = {} self.loadWebBibles() - QtCore.QObject.connect(self.locationComboBox, + QtCore.QObject.connect(self.formatComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.onLocationComboBoxChanged) + self.onFormatComboBoxChanged) + QtCore.QObject.connect(self.webSourceComboBox, + QtCore.SIGNAL(u'currentIndexChanged(int)'), + self.onWebSourceComboBoxChanged) QtCore.QObject.connect(self.osisFileButton, QtCore.SIGNAL(u'clicked()'), self.onOsisFileButtonClicked) - QtCore.QObject.connect(self.booksFileButton, + QtCore.QObject.connect(self.csvBooksButton, QtCore.SIGNAL(u'clicked()'), self.onBooksFileButtonClicked) - QtCore.QObject.connect(self.csvVersesFileButton, + QtCore.QObject.connect(self.csvVersesButton, QtCore.SIGNAL(u'clicked()'), self.onCsvVersesFileButtonClicked) - QtCore.QObject.connect(self.openSongBrowseButton, + QtCore.QObject.connect(self.openSongFileButton, QtCore.SIGNAL(u'clicked()'), self.onOpenSongBrowseButtonClicked) QtCore.QObject.connect(self.openlp1FileButton, @@ -225,7 +224,28 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): # Progress page return True - def onLocationComboBoxChanged(self, index): + def onFormatComboBoxChanged(self, index): + """ + Set Widgets for the selected import format visible. + + ``index`` + The index of the combo box. + """ + self.osisFileLabel.setVisible(index == 0) + self.osisFileWidget.setVisible(index == 0) + self.csvBooksLabel.setVisible(index == 1) + self.csvBooksWidget.setVisible(index == 1) + self.csvVersesLabel.setVisible(index == 1) + self.csvVersesWidget.setVisible(index == 1) + self.openSongFileLabel.setVisible(index == 2) + self.openSongFileWidget.setVisible(index == 2) + self.webTabWidget.setVisible(index == 3) + self.openlp1FileLabel.setVisible(index == 4 and self.hasOpenlp1Import) + self.openlp1FileWidget.setVisible(index == 4 and self.hasOpenlp1Import) + self.openlp1DisabledLabel.setVisible(index == 4 and + not self.hasOpenlp1Import) + + def onWebSourceComboBoxChanged(self, index): """ Setup the list of Bibles when you select a different source on the web download page. @@ -233,11 +253,11 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): ``index`` The index of the combo box. """ - self.bibleComboBox.clear() + self.webTranslationComboBox.clear() bibles = self.web_bible_list[index].keys() bibles.sort() for bible in bibles: - self.bibleComboBox.addItem(bible) + self.webTranslationComboBox.addItem(bible) def onOsisFileButtonClicked(self): """ @@ -245,7 +265,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): """ self.getFileName( translate('BiblesPlugin.ImportWizardForm', 'Open OSIS File'), - self.OSISLocationEdit) + self.osisFileEdit) def onBooksFileButtonClicked(self): """ @@ -253,7 +273,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): """ self.getFileName( translate('BiblesPlugin.ImportWizardForm', 'Open Books CSV File'), - self.booksLocationEdit, u'%s (*.csv)' + self.csvBooksEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) def onCsvVersesFileButtonClicked(self): @@ -261,7 +281,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): Show the file open dialog for the verses CSV file. """ self.getFileName(translate('BiblesPlugin.ImportWizardForm', - 'Open Verses CSV File'), self.csvVerseLocationEdit, u'%s (*.csv)' + 'Open Verses CSV File'), self.csvVersesEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) def onOpenSongBrowseButtonClicked(self): @@ -278,7 +298,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): """ self.getFileName( translate('BiblesPlugin.ImportWizardForm', - 'Open openlp.org 1.x Bible'), self.openlp1LocationEdit, + 'Open openlp.org 1.x Bible'), self.openlp1FileEdit, u'%s (*.bible)' % translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x bible')) @@ -290,18 +310,17 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): def registerFields(self): self.selectPage.registerField(u'source_format', self.formatComboBox) - self.selectPage.registerField(u'osis_location', self.OSISLocationEdit) - self.selectPage.registerField(u'csv_booksfile', self.booksLocationEdit) - self.selectPage.registerField( - u'csv_versefile', self.csvVerseLocationEdit) + self.selectPage.registerField(u'osis_location', self.osisFileEdit) + self.selectPage.registerField(u'csv_booksfile', self.csvBooksEdit) + self.selectPage.registerField(u'csv_versefile', self.csvVersesEdit) self.selectPage.registerField(u'opensong_file', self.openSongFileEdit) - self.selectPage.registerField(u'web_location', self.locationComboBox) - self.selectPage.registerField(u'web_biblename', self.bibleComboBox) - self.selectPage.registerField(u'proxy_server', self.addressEdit) - self.selectPage.registerField(u'proxy_username', self.usernameEdit) - self.selectPage.registerField(u'proxy_password', self.passwordEdit) - self.selectPage.registerField( - u'openlp1_location', self.openlp1LocationEdit) + self.selectPage.registerField(u'web_location', self.webSourceComboBox) + self.selectPage.registerField(u'web_biblename', + self.webTranslationComboBox) + self.selectPage.registerField(u'proxy_server', self.webServerEdit) + self.selectPage.registerField(u'proxy_username', self.webUserEdit) + self.selectPage.registerField(u'proxy_password', self.webPasswordEdit) + self.selectPage.registerField(u'openlp1_location', self.openlp1FileEdit) self.licenseDetailsPage.registerField( u'license_version', self.versionNameEdit) self.licenseDetailsPage.registerField( @@ -322,7 +341,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.setField(u'opensong_file', QtCore.QVariant('')) self.setField(u'web_location', QtCore.QVariant(WebDownload.Crosswalk)) self.setField(u'web_biblename', - QtCore.QVariant(self.bibleComboBox.currentIndex())) + QtCore.QVariant(self.webTranslationComboBox.currentIndex())) self.setField(u'proxy_server', settings.value(u'proxy address', QtCore.QVariant(u''))) self.setField(u'proxy_username', @@ -336,7 +355,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): QtCore.QVariant(self.copyrightEdit.text())) self.setField(u'license_permissions', QtCore.QVariant(self.permissionsEdit.text())) - self.onLocationComboBoxChanged(WebDownload.Crosswalk) + self.onWebSourceComboBoxChanged(WebDownload.Crosswalk) settings.endGroup() def loadWebBibles(self): diff --git a/openlp/plugins/bibles/forms/bibleimportwizard.py b/openlp/plugins/bibles/forms/bibleimportwizard.py index a0b2b99b9..647754674 100644 --- a/openlp/plugins/bibles/forms/bibleimportwizard.py +++ b/openlp/plugins/bibles/forms/bibleimportwizard.py @@ -31,7 +31,6 @@ from openlp.core.lib import build_icon, translate class Ui_BibleImportWizard(object): def setupUi(self, bibleImportWizard): bibleImportWizard.setObjectName(u'bibleImportWizard') - bibleImportWizard.resize(550, 386) bibleImportWizard.setModal(True) bibleImportWizard.setWizardStyle(QtGui.QWizard.ModernStyle) bibleImportWizard.setOptions( @@ -44,256 +43,221 @@ class Ui_BibleImportWizard(object): QtGui.QPixmap(u':/wizards/wizard_importbible.bmp')) self.welcomePage.setObjectName(u'WelcomePage') self.welcomeLayout = QtGui.QVBoxLayout(self.welcomePage) - self.welcomeLayout.setSpacing(8) - self.welcomeLayout.setMargin(0) + self.welcomeLayout.setMargin(12) + self.welcomeLayout.setSpacing(6) self.welcomeLayout.setObjectName(u'WelcomeLayout') self.titleLabel = QtGui.QLabel(self.welcomePage) self.titleLabel.setObjectName(u'TitleLabel') self.welcomeLayout.addWidget(self.titleLabel) - spacerItem = QtGui.QSpacerItem(20, 40, + self.welcomeTopSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - self.welcomeLayout.addItem(spacerItem) + self.welcomeLayout.addItem(self.welcomeTopSpacer) self.informationLabel = QtGui.QLabel(self.welcomePage) self.informationLabel.setWordWrap(True) - self.informationLabel.setMargin(10) self.informationLabel.setObjectName(u'InformationLabel') self.welcomeLayout.addWidget(self.informationLabel) - spacerItem1 = QtGui.QSpacerItem(20, 40, + self.welcomeBottomSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.welcomeLayout.addItem(spacerItem1) + self.welcomeLayout.addItem(self.welcomeBottomSpacer) bibleImportWizard.addPage(self.welcomePage) # Select page self.selectPage = QtGui.QWizardPage() self.selectPage.setObjectName(u'SelectPage') self.selectPageLayout = QtGui.QVBoxLayout(self.selectPage) - self.selectPageLayout.setSpacing(8) - self.selectPageLayout.setMargin(20) - self.selectPageLayout.setObjectName(u'selectPageLayout') - self.formatSelectLayout = QtGui.QHBoxLayout() - self.formatSelectLayout.setSpacing(8) - self.formatSelectLayout.setObjectName(u'FormatSelectLayout') + self.selectPageLayout.setMargin(12) + self.selectPageLayout.setObjectName(u'SelectPageLayout') + self.selectFormLayout = QtGui.QFormLayout() + self.selectFormLayout.setVerticalSpacing(6) + self.selectFormLayout.setObjectName(u'SelectFormLayout') self.formatLabel = QtGui.QLabel(self.selectPage) self.formatLabel.setObjectName(u'FormatLabel') - self.formatSelectLayout.addWidget(self.formatLabel) + self.selectFormLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.formatLabel) self.formatComboBox = QtGui.QComboBox(self.selectPage) + self.formatComboBox.addItem(u'') + self.formatComboBox.addItem(u'') + self.formatComboBox.addItem(u'') + self.formatComboBox.addItem(u'') + self.formatComboBox.addItem(u'') self.formatComboBox.setObjectName(u'FormatComboBox') - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') - self.formatSelectLayout.addWidget(self.formatComboBox) - spacerItem2 = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.formatSelectLayout.addItem(spacerItem2) - self.selectPageLayout.addLayout(self.formatSelectLayout) - self.formatWidget = QtGui.QStackedWidget(self.selectPage) - self.formatWidget.setObjectName(u'FormatWidget') - generalIcon = build_icon(u':/general/general_open.png') - self.osisPage = QtGui.QWidget() - self.osisPage.setObjectName(u'OsisPage') - self.osisLayout = QtGui.QFormLayout(self.osisPage) - self.osisLayout.setFieldGrowthPolicy( - QtGui.QFormLayout.ExpandingFieldsGrow) - self.osisLayout.setMargin(0) - self.osisLayout.setSpacing(8) - self.osisLayout.setObjectName(u'OsisLayout') - self.osisLocationLabel = QtGui.QLabel(self.osisPage) - self.osisLocationLabel.setObjectName(u'OsisLocationLabel') - self.osisLayout.setWidget(1, QtGui.QFormLayout.LabelRole, - self.osisLocationLabel) - self.osisLocationLayout = QtGui.QHBoxLayout() - self.osisLocationLayout.setSpacing(8) - self.osisLocationLayout.setObjectName(u'OsisLocationLayout') - self.OSISLocationEdit = QtGui.QLineEdit(self.osisPage) - self.OSISLocationEdit.setObjectName(u'OSISLocationEdit') - self.osisLocationLayout.addWidget(self.OSISLocationEdit) - self.osisFileButton = QtGui.QToolButton(self.osisPage) - self.osisFileButton.setMaximumSize(QtCore.QSize(32, 16777215)) - self.osisFileButton.setIcon(generalIcon) + self.selectFormLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.formatComboBox) + self.osisFileLabel = QtGui.QLabel(self.selectPage) + self.osisFileLabel.setObjectName(u'OsisFileLabel') + self.selectFormLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.osisFileLabel) + self.osisFileWidget = QtGui.QWidget(self.selectPage) + self.osisFileWidget.setObjectName(u'OsisFileWidget') + self.osisFileLayout = QtGui.QHBoxLayout(self.osisFileWidget) + self.osisFileLayout.setMargin(0) + self.osisFileLayout.setObjectName(u'OsisFileLayout') + self.osisFileEdit = QtGui.QLineEdit(self.osisFileWidget) + self.osisFileEdit.setObjectName(u'OsisFileEdit') + self.osisFileLayout.addWidget(self.osisFileEdit) + self.osisFileButton = QtGui.QToolButton(self.osisFileWidget) + self.osisFileButton.setIcon(build_icon(u':/general/general_open.png')) self.osisFileButton.setObjectName(u'OsisFileButton') - self.osisLocationLayout.addWidget(self.osisFileButton) - self.osisLayout.setLayout(1, QtGui.QFormLayout.FieldRole, - self.osisLocationLayout) - self.formatWidget.addWidget(self.osisPage) - self.csvPage = QtGui.QWidget() - self.csvPage.setObjectName(u'CsvPage') - self.csvSourceLayout = QtGui.QFormLayout(self.csvPage) - self.csvSourceLayout.setFieldGrowthPolicy( - QtGui.QFormLayout.ExpandingFieldsGrow) - self.csvSourceLayout.setLabelAlignment(QtCore.Qt.AlignBottom | - QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing) - self.csvSourceLayout.setFormAlignment(QtCore.Qt.AlignLeading | - QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) - self.csvSourceLayout.setMargin(0) - self.csvSourceLayout.setSpacing(8) - self.csvSourceLayout.setObjectName(u'CsvSourceLayout') - self.booksLocationLabel = QtGui.QLabel(self.csvPage) - self.booksLocationLabel.setObjectName(u'BooksLocationLabel') - self.csvSourceLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.booksLocationLabel) - self.csvBooksLayout = QtGui.QHBoxLayout() - self.csvBooksLayout.setSpacing(8) + self.osisFileLayout.addWidget(self.osisFileButton) + self.selectFormLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.osisFileWidget) + self.csvBooksLabel = QtGui.QLabel(self.selectPage) + self.csvBooksLabel.setVisible(False) + self.csvBooksLabel.setObjectName(u'CsvBooksLabel') + self.selectFormLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.csvBooksLabel) + self.csvBooksWidget = QtGui.QWidget(self.selectPage) + self.csvBooksWidget.setVisible(False) + self.csvBooksWidget.setObjectName(u'CsvBooksWidget') + self.csvBooksLayout = QtGui.QHBoxLayout(self.csvBooksWidget) + self.csvBooksLayout.setMargin(0) self.csvBooksLayout.setObjectName(u'CsvBooksLayout') - self.booksLocationEdit = QtGui.QLineEdit(self.csvPage) - self.booksLocationEdit.setObjectName(u'BooksLocationEdit') - self.csvBooksLayout.addWidget(self.booksLocationEdit) - self.booksFileButton = QtGui.QToolButton(self.csvPage) - self.booksFileButton.setMaximumSize(QtCore.QSize(32, 16777215)) - self.booksFileButton.setIcon(generalIcon) - self.booksFileButton.setObjectName(u'BooksFileButton') - self.csvBooksLayout.addWidget(self.booksFileButton) - self.csvSourceLayout.setLayout(0, QtGui.QFormLayout.FieldRole, - self.csvBooksLayout) - self.verseLocationLabel = QtGui.QLabel(self.csvPage) - self.verseLocationLabel.setObjectName(u'VerseLocationLabel') - self.csvSourceLayout.setWidget(1, QtGui.QFormLayout.LabelRole, - self.verseLocationLabel) - self.csvVerseLayout = QtGui.QHBoxLayout() - self.csvVerseLayout.setSpacing(8) - self.csvVerseLayout.setObjectName(u'CsvVerseLayout') - self.csvVerseLocationEdit = QtGui.QLineEdit(self.csvPage) - self.csvVerseLocationEdit.setObjectName(u'CsvVerseLocationEdit') - self.csvVerseLayout.addWidget(self.csvVerseLocationEdit) - self.csvVersesFileButton = QtGui.QToolButton(self.csvPage) - self.csvVersesFileButton.setMaximumSize(QtCore.QSize(32, 16777215)) - self.csvVersesFileButton.setIcon(generalIcon) - self.csvVersesFileButton.setObjectName(u'CsvVersesFileButton') - self.csvVerseLayout.addWidget(self.csvVersesFileButton) - self.csvSourceLayout.setLayout(1, QtGui.QFormLayout.FieldRole, - self.csvVerseLayout) - self.formatWidget.addWidget(self.csvPage) - self.openSongPage = QtGui.QWidget() - self.openSongPage.setObjectName(u'OpenSongPage') - self.openSongLayout = QtGui.QFormLayout(self.openSongPage) - self.openSongLayout.setMargin(0) - self.openSongLayout.setSpacing(8) - self.openSongLayout.setObjectName(u'OpenSongLayout') - self.openSongFileLabel = QtGui.QLabel(self.openSongPage) + self.csvBooksEdit = QtGui.QLineEdit(self.csvBooksWidget) + self.csvBooksEdit.setObjectName(u'CsvBooksEdit') + self.csvBooksLayout.addWidget(self.csvBooksEdit) + self.csvBooksButton = QtGui.QToolButton(self.csvBooksWidget) + self.csvBooksButton.setIcon(build_icon(u':/general/general_open.png')) + self.csvBooksButton.setObjectName(u'CsvBooksButton') + self.csvBooksLayout.addWidget(self.csvBooksButton) + self.selectFormLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.csvBooksWidget) + self.csvVersesLabel = QtGui.QLabel(self.selectPage) + self.csvVersesLabel.setVisible(False) + self.csvVersesLabel.setObjectName(u'CsvVersesLabel') + self.selectFormLayout.setWidget(3, QtGui.QFormLayout.LabelRole, + self.csvVersesLabel) + self.csvVersesWidget = QtGui.QWidget(self.selectPage) + self.csvVersesWidget.setVisible(False) + self.csvVersesWidget.setObjectName(u'CsvVersesWidget') + self.csvVersesLayout = QtGui.QHBoxLayout(self.csvVersesWidget) + self.csvVersesLayout.setMargin(0) + self.csvVersesLayout.setObjectName(u'CsvVersesLayout') + self.csvVersesEdit = QtGui.QLineEdit(self.csvVersesWidget) + self.csvVersesEdit.setObjectName(u'CsvVersesEdit') + self.csvVersesLayout.addWidget(self.csvVersesEdit) + self.csvVersesButton = QtGui.QToolButton(self.csvVersesWidget) + self.csvVersesButton.setIcon(build_icon(u':/general/general_open.png')) + self.csvVersesButton.setObjectName(u'CsvVersesButton') + self.csvVersesLayout.addWidget(self.csvVersesButton) + self.selectFormLayout.setWidget(3, QtGui.QFormLayout.FieldRole, + self.csvVersesWidget) + self.openSongFileLabel = QtGui.QLabel(self.selectPage) + self.openSongFileLabel.setVisible(False) self.openSongFileLabel.setObjectName(u'OpenSongFileLabel') - self.openSongLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.selectFormLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.openSongFileLabel) - self.openSongFileLayout = QtGui.QHBoxLayout() - self.openSongFileLayout.setSpacing(8) + self.openSongFileWidget = QtGui.QWidget(self.selectPage) + self.openSongFileWidget.setVisible(False) + self.openSongFileWidget.setObjectName(u'OpenSongFileWidget') + self.openSongFileLayout = QtGui.QHBoxLayout(self.openSongFileWidget) + self.openSongFileLayout.setMargin(0) self.openSongFileLayout.setObjectName(u'OpenSongFileLayout') - self.openSongFileEdit = QtGui.QLineEdit(self.openSongPage) + self.openSongFileEdit = QtGui.QLineEdit(self.openSongFileWidget) self.openSongFileEdit.setObjectName(u'OpenSongFileEdit') self.openSongFileLayout.addWidget(self.openSongFileEdit) - self.openSongBrowseButton = QtGui.QToolButton(self.openSongPage) - self.openSongBrowseButton.setIcon(generalIcon) - self.openSongBrowseButton.setObjectName(u'OpenSongBrowseButton') - self.openSongFileLayout.addWidget(self.openSongBrowseButton) - self.openSongLayout.setLayout(0, QtGui.QFormLayout.FieldRole, - self.openSongFileLayout) - self.formatWidget.addWidget(self.openSongPage) - self.webDownloadPage = QtGui.QWidget() - self.webDownloadPage.setObjectName(u'WebDownloadPage') - self.webDownloadLayout = QtGui.QVBoxLayout(self.webDownloadPage) - self.webDownloadLayout.setSpacing(8) - self.webDownloadLayout.setMargin(0) - self.webDownloadLayout.setObjectName(u'WebDownloadLayout') - self.webDownloadTabWidget = QtGui.QTabWidget(self.webDownloadPage) - self.webDownloadTabWidget.setObjectName(u'WebDownloadTabWidget') - self.downloadOptionsTab = QtGui.QWidget() - self.downloadOptionsTab.setObjectName(u'DownloadOptionsTab') - self.downloadOptionsLayout = QtGui.QFormLayout(self.downloadOptionsTab) - self.downloadOptionsLayout.setMargin(8) - self.downloadOptionsLayout.setSpacing(8) - self.downloadOptionsLayout.setObjectName(u'DownloadOptionsLayout') - self.locationLabel = QtGui.QLabel(self.downloadOptionsTab) - self.locationLabel.setObjectName(u'LocationLabel') - self.downloadOptionsLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.locationLabel) - self.locationComboBox = QtGui.QComboBox(self.downloadOptionsTab) - self.locationComboBox.setObjectName(u'LocationComboBox') - self.locationComboBox.addItem(u'') - self.locationComboBox.addItem(u'') - self.locationComboBox.addItem(u'') - self.downloadOptionsLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.locationComboBox) - self.bibleLabel = QtGui.QLabel(self.downloadOptionsTab) - self.bibleLabel.setObjectName(u'BibleLabel') - self.downloadOptionsLayout.setWidget(1, QtGui.QFormLayout.LabelRole, - self.bibleLabel) - self.bibleComboBox = QtGui.QComboBox(self.downloadOptionsTab) - self.bibleComboBox.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents) - self.bibleComboBox.setObjectName(u'BibleComboBox') - self.bibleComboBox.addItem(u'') - self.bibleComboBox.addItem(u'') - self.bibleComboBox.addItem(u'') - self.downloadOptionsLayout.setWidget(1, QtGui.QFormLayout.FieldRole, - self.bibleComboBox) - self.webDownloadTabWidget.addTab(self.downloadOptionsTab, u'') - self.proxyServerTab = QtGui.QWidget() - self.proxyServerTab.setObjectName(u'ProxyServerTab') - self.proxyServerLayout = QtGui.QFormLayout(self.proxyServerTab) - self.proxyServerLayout.setObjectName(u'ProxyServerLayout') - self.addressLabel = QtGui.QLabel(self.proxyServerTab) - self.addressLabel.setObjectName(u'AddressLabel') - self.proxyServerLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.addressLabel) - self.addressEdit = QtGui.QLineEdit(self.proxyServerTab) - self.addressEdit.setObjectName(u'AddressEdit') - self.proxyServerLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.addressEdit) - self.usernameLabel = QtGui.QLabel(self.proxyServerTab) - self.usernameLabel.setObjectName(u'UsernameLabel') - self.proxyServerLayout.setWidget(1, QtGui.QFormLayout.LabelRole, - self.usernameLabel) - self.usernameEdit = QtGui.QLineEdit(self.proxyServerTab) - self.usernameEdit.setObjectName(u'UsernameEdit') - self.proxyServerLayout.setWidget(1, QtGui.QFormLayout.FieldRole, - self.usernameEdit) - self.passwordLabel = QtGui.QLabel(self.proxyServerTab) - self.passwordLabel.setObjectName(u'PasswordLabel') - self.proxyServerLayout.setWidget(2, QtGui.QFormLayout.LabelRole, - self.passwordLabel) - self.passwordEdit = QtGui.QLineEdit(self.proxyServerTab) - self.passwordEdit.setObjectName(u'PasswordEdit') - self.proxyServerLayout.setWidget(2, QtGui.QFormLayout.FieldRole, - self.passwordEdit) - self.webDownloadTabWidget.addTab(self.proxyServerTab, u'') - self.webDownloadLayout.addWidget(self.webDownloadTabWidget) - self.formatWidget.addWidget(self.webDownloadPage) - self.openlp1Page = QtGui.QWidget() - self.openlp1Page.setObjectName(u'Openlp1Page') - self.openlp1Layout = QtGui.QFormLayout(self.openlp1Page) - self.openlp1Layout.setFieldGrowthPolicy( - QtGui.QFormLayout.ExpandingFieldsGrow) - self.openlp1Layout.setMargin(0) - self.openlp1Layout.setSpacing(8) - self.openlp1Layout.setObjectName(u'Openlp1Layout') - self.openlp1LocationLabel = QtGui.QLabel(self.openlp1Page) - self.openlp1LocationLabel.setObjectName(u'Openlp1LocationLabel') - self.openlp1Layout.setWidget(1, QtGui.QFormLayout.LabelRole, - self.openlp1LocationLabel) - self.openlp1LocationLayout = QtGui.QHBoxLayout() - self.openlp1LocationLayout.setSpacing(8) - self.openlp1LocationLayout.setObjectName(u'Openlp1LocationLayout') - self.openlp1LocationEdit = QtGui.QLineEdit(self.openlp1Page) - self.openlp1LocationEdit.setObjectName(u'Openlp1LocationEdit') - self.openlp1LocationLayout.addWidget(self.openlp1LocationEdit) - self.openlp1FileButton = QtGui.QToolButton(self.openlp1Page) - self.openlp1FileButton.setMaximumSize(QtCore.QSize(32, 16777215)) - self.openlp1FileButton.setIcon(generalIcon) + self.openSongFileButton = QtGui.QToolButton(self.openSongFileWidget) + self.openSongFileButton.setIcon( + build_icon(u':/general/general_open.png')) + self.openSongFileButton.setObjectName(u'OpenSongFileButton') + self.openSongFileLayout.addWidget(self.openSongFileButton) + self.selectFormLayout.setWidget(4, QtGui.QFormLayout.FieldRole, + self.openSongFileWidget) + self.openlp1FileLabel = QtGui.QLabel(self.selectPage) + self.openlp1FileLabel.setVisible(False) + self.openlp1FileLabel.setObjectName(u'Openlp1FileLabel') + self.selectFormLayout.setWidget(5, QtGui.QFormLayout.LabelRole, + self.openlp1FileLabel) + self.openlp1FileWidget = QtGui.QWidget(self.selectPage) + self.openlp1FileWidget.setVisible(False) + self.openlp1FileWidget.setObjectName(u'Openlp1FileWidget') + self.openlp1FileLayout = QtGui.QHBoxLayout(self.openlp1FileWidget) + self.openlp1FileLayout.setMargin(0) + self.openlp1FileLayout.setObjectName(u'Openlp1FileLayout') + self.openlp1FileEdit = QtGui.QLineEdit(self.openlp1FileWidget) + self.openlp1FileEdit.setObjectName(u'Openlp1FileEdit') + self.openlp1FileLayout.addWidget(self.openlp1FileEdit) + self.openlp1FileButton = QtGui.QToolButton(self.openlp1FileWidget) + self.openlp1FileButton.setIcon( + build_icon(u':/general/general_open.png')) self.openlp1FileButton.setObjectName(u'Openlp1FileButton') - self.openlp1LocationLayout.addWidget(self.openlp1FileButton) - self.openlp1Layout.setLayout(1, QtGui.QFormLayout.FieldRole, - self.openlp1LocationLayout) - self.openlp1DisabledLabel = QtGui.QLabel(self.openlp1Page) - self.openlp1DisabledLabel.setObjectName(u'openlp1DisabledLabel') + self.openlp1FileLayout.addWidget(self.openlp1FileButton) + self.selectFormLayout.setWidget(5, QtGui.QFormLayout.FieldRole, + self.openlp1FileWidget) + self.selectPageLayout.addItem(self.selectFormLayout) + self.openlp1DisabledLabel = QtGui.QLabel(self.selectPage) self.openlp1DisabledLabel.setVisible(False) - self.openlp1DisabledLabel.setWordWrap(True) - self.openlp1Layout.addWidget(self.openlp1DisabledLabel) - self.formatWidget.addWidget(self.openlp1Page) - self.selectPageLayout.addWidget(self.formatWidget) + self.openlp1DisabledLabel.setObjectName(u'Openlp1DisabledLabel') + self.selectPageLayout.addWidget(self.openlp1DisabledLabel) + self.webTabWidget = QtGui.QTabWidget(self.selectPage) + self.webTabWidget.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, + QtGui.QSizePolicy.MinimumExpanding) + self.webTabWidget.setVisible(False) + self.webTabWidget.setObjectName(u'WebTabWidget') + self.webBibleTab = QtGui.QWidget() + self.webBibleTab.setObjectName(u'WebBibleTab') + self.webBibleLayout = QtGui.QFormLayout(self.webBibleTab) + self.webBibleLayout.setVerticalSpacing(6) + self.webBibleLayout.setObjectName(u'WebBibleLayout') + self.webSourceLabel = QtGui.QLabel(self.webBibleTab) + self.webSourceLabel.setObjectName(u'WebSourceLabel') + self.webBibleLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.webSourceLabel) + self.webSourceComboBox = QtGui.QComboBox(self.webBibleTab) + self.webSourceComboBox.setObjectName(u'WebSourceComboBox') + self.webSourceComboBox.addItem(u'') + self.webSourceComboBox.addItem(u'') + self.webSourceComboBox.addItem(u'') + self.webBibleLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.webSourceComboBox) + self.webTranslationLabel = QtGui.QLabel(self.webBibleTab) + self.webTranslationLabel.setObjectName(u'webTranslationLabel') + self.webBibleLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.webTranslationLabel) + self.webTranslationComboBox = QtGui.QComboBox(self.webBibleTab) + self.webTranslationComboBox.setObjectName(u'WebTranslationComboBox') + self.webTranslationComboBox.addItem(u'') + self.webTranslationComboBox.addItem(u'') + self.webTranslationComboBox.addItem(u'') + self.webBibleLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.webTranslationComboBox) + self.webTabWidget.addTab(self.webBibleTab, u'') + self.webProxyTab = QtGui.QWidget() + self.webProxyTab.setObjectName(u'WebProxyTab') + self.webProxyLayout = QtGui.QFormLayout(self.webProxyTab) + self.webProxyLayout.setVerticalSpacing(6) + self.webProxyLayout.setObjectName(u'WebProxyLayout') + self.webServerLabel = QtGui.QLabel(self.webProxyTab) + self.webServerLabel.setObjectName(u'WebServerLabel') + self.webProxyLayout.setWidget(0, QtGui.QFormLayout.LabelRole, + self.webServerLabel) + self.webServerEdit = QtGui.QLineEdit(self.webProxyTab) + self.webServerEdit.setObjectName(u'WebServerEdit') + self.webProxyLayout.setWidget(0, QtGui.QFormLayout.FieldRole, + self.webServerEdit) + self.webUserLabel = QtGui.QLabel(self.webProxyTab) + self.webUserLabel.setObjectName(u'WebUserLabel') + self.webProxyLayout.setWidget(1, QtGui.QFormLayout.LabelRole, + self.webUserLabel) + self.webUserEdit = QtGui.QLineEdit(self.webProxyTab) + self.webUserEdit.setObjectName(u'WebUserEdit') + self.webProxyLayout.setWidget(1, QtGui.QFormLayout.FieldRole, + self.webUserEdit) + self.webPasswordLabel = QtGui.QLabel(self.webProxyTab) + self.webPasswordLabel.setObjectName(u'WebPasswordLabel') + self.webProxyLayout.setWidget(2, QtGui.QFormLayout.LabelRole, + self.webPasswordLabel) + self.webPasswordEdit = QtGui.QLineEdit(self.webProxyTab) + self.webPasswordEdit.setObjectName(u'WebPasswordEdit') + self.webProxyLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + self.webPasswordEdit) + self.webTabWidget.addTab(self.webProxyTab, u'') + self.selectPageLayout.addWidget(self.webTabWidget) bibleImportWizard.addPage(self.selectPage) # License page self.licenseDetailsPage = QtGui.QWizardPage() self.licenseDetailsPage.setObjectName(u'LicenseDetailsPage') self.licenseDetailsLayout = QtGui.QFormLayout(self.licenseDetailsPage) - self.licenseDetailsLayout.setMargin(20) - self.licenseDetailsLayout.setSpacing(8) + self.licenseDetailsLayout.setMargin(12) + self.licenseDetailsLayout.setVerticalSpacing(6) self.licenseDetailsLayout.setObjectName(u'LicenseDetailsLayout') self.versionNameLabel = QtGui.QLabel(self.licenseDetailsPage) self.versionNameLabel.setObjectName(u'VersionNameLabel') @@ -324,25 +288,18 @@ class Ui_BibleImportWizard(object): self.importPage = QtGui.QWizardPage() self.importPage.setObjectName(u'ImportPage') self.importLayout = QtGui.QVBoxLayout(self.importPage) - self.importLayout.setSpacing(8) - self.importLayout.setMargin(50) + self.importLayout.setSpacing(6) + self.importLayout.setMargin(48) self.importLayout.setObjectName(u'ImportLayout') self.importProgressLabel = QtGui.QLabel(self.importPage) self.importProgressLabel.setObjectName(u'ImportProgressLabel') self.importLayout.addWidget(self.importProgressLabel) self.importProgressBar = QtGui.QProgressBar(self.importPage) - self.importProgressBar.setValue(0) self.importProgressBar.setObjectName(u'ImportProgressBar') self.importLayout.addWidget(self.importProgressBar) bibleImportWizard.addPage(self.importPage) - self.retranslateUi(bibleImportWizard) - self.formatWidget.setCurrentIndex(0) - self.webDownloadTabWidget.setCurrentIndex(0) - QtCore.QObject.connect(self.formatComboBox, - QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.formatWidget.setCurrentIndex) - QtCore.QMetaObject.connectSlotsByName(bibleImportWizard) + self.webTabWidget.setCurrentIndex(0) def retranslateUi(self, bibleImportWizard): bibleImportWizard.setWindowTitle( @@ -373,37 +330,37 @@ class Ui_BibleImportWizard(object): translate('BiblesPlugin.ImportWizardForm', 'Web Download')) self.formatComboBox.setItemText(4, translate('BiblesPlugin.ImportWizardForm', 'openlp.org 1.x')) - self.openlp1LocationLabel.setText( + self.openlp1FileLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'File location:')) - self.osisLocationLabel.setText( + self.osisFileLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'File location:')) - self.booksLocationLabel.setText( + self.csvBooksLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Books location:')) - self.verseLocationLabel.setText( + self.csvVersesLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Verse location:')) self.openSongFileLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Bible filename:')) - self.locationLabel.setText( + self.webSourceLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Location:')) - self.locationComboBox.setItemText(0, + self.webSourceComboBox.setItemText(0, translate('BiblesPlugin.ImportWizardForm', 'Crosswalk')) - self.locationComboBox.setItemText(1, + self.webSourceComboBox.setItemText(1, translate('BiblesPlugin.ImportWizardForm', 'BibleGateway')) - self.locationComboBox.setItemText(2, + self.webSourceComboBox.setItemText(2, translate('BiblesPlugin.ImportWizardForm', 'Bibleserver')) - self.bibleLabel.setText( + self.webTranslationLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Bible:')) - self.webDownloadTabWidget.setTabText( - self.webDownloadTabWidget.indexOf(self.downloadOptionsTab), + self.webTabWidget.setTabText( + self.webTabWidget.indexOf(self.webBibleTab), translate('BiblesPlugin.ImportWizardForm', 'Download Options')) - self.addressLabel.setText( + self.webServerLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Server:')) - self.usernameLabel.setText( + self.webUserLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Username:')) - self.passwordLabel.setText( + self.webPasswordLabel.setText( translate('BiblesPlugin.ImportWizardForm', 'Password:')) - self.webDownloadTabWidget.setTabText( - self.webDownloadTabWidget.indexOf(self.proxyServerTab), + self.webTabWidget.setTabText( + self.webTabWidget.indexOf(self.webProxyTab), translate('BiblesPlugin.ImportWizardForm', 'Proxy Server (Optional)')) self.licenseDetailsPage.setTitle( From 6815ac31465dd7e768b20e2553189768321f8246 Mon Sep 17 00:00:00 2001 From: M2j Date: Mon, 27 Dec 2010 16:31:53 +0100 Subject: [PATCH 03/13] - Finishes and tested rewrite of themewizard and bibleimportwizard - Added exceptions to OpenSong and CSV bible import wich occur for invalid files --- openlp/core/ui/themeform.py | 200 ++---- openlp/core/ui/themewizard.py | 613 +++++++++--------- .../plugins/bibles/forms/bibleimportform.py | 85 +-- .../plugins/bibles/forms/bibleimportwizard.py | 231 +++---- openlp/plugins/bibles/lib/csvbible.py | 2 +- openlp/plugins/bibles/lib/opensong.py | 2 +- 6 files changed, 515 insertions(+), 618 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 94a4e858a..95d4527c1 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -56,7 +56,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.registerFields() self.accepted = False self.updateThemeAllowed = True - QtCore.QObject.connect(self.backgroundTypeComboBox, + QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onBackgroundComboBox) QtCore.QObject.connect(self.gradientComboBox, @@ -74,30 +74,30 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): QtCore.QObject.connect(self.imageBrowseButton, QtCore.SIGNAL(u'pressed()'), self.onImageBrowseButtonClicked) - QtCore.QObject.connect(self.mainColorPushButton, + QtCore.QObject.connect(self.mainColorButton, QtCore.SIGNAL(u'pressed()'), - self.onMainColourPushButtonClicked) - QtCore.QObject.connect(self.outlineColorPushButton, + self.onMainColourButtonClicked) + QtCore.QObject.connect(self.outlineColorButton, QtCore.SIGNAL(u'pressed()'), - self.onOutlineColourPushButtonClicked) - QtCore.QObject.connect(self.shadowColorPushButton, + self.onOutlineColourButtonClicked) + QtCore.QObject.connect(self.shadowColorButton, QtCore.SIGNAL(u'pressed()'), - self.onShadowColourPushButtonClicked) + self.onShadowColourButtonClicked) QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onOutlineCheckCheckBoxChanged) QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), self.onShadowCheckCheckBoxChanged) - QtCore.QObject.connect(self.footerColorPushButton, + QtCore.QObject.connect(self.footerColorButton, QtCore.SIGNAL(u'pressed()'), - self.onFooterColourPushButtonClicked) - QtCore.QObject.connect(self.mainDefaultPositionCheckBox, + self.onFooterColourButtonClicked) + QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onMainDefaultPositionCheckBox) - QtCore.QObject.connect(self.footerDefaultPositionCheckBox, + self.onMainPositionCheckBox) + QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onFooterDefaultPositionCheckBox) + self.onFooterPositionCheckBox) QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.pageChanged) @@ -107,36 +107,25 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): QtCore.QObject.connect(self.mainSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines) - QtCore.QObject.connect(self.mainSizeSpinBox, - QtCore.SIGNAL(u'editingFinished()'), - self.calculateLines) QtCore.QObject.connect(self.lineSpacingSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines) - QtCore.QObject.connect(self.lineSpacingSpinBox, - QtCore.SIGNAL(u'editingFinished()'), - self.calculateLines) QtCore.QObject.connect(self.outlineSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines) - QtCore.QObject.connect(self.outlineSizeSpinBox, - QtCore.SIGNAL(u'editingFinished()'), - self.calculateLines) QtCore.QObject.connect(self.shadowSizeSpinBox, QtCore.SIGNAL(u'valueChanged(int)'), self.calculateLines) - QtCore.QObject.connect(self.shadowSizeSpinBox, - QtCore.SIGNAL(u'editingFinished()'), - self.calculateLines) QtCore.QObject.connect(self.mainFontComboBox, QtCore.SIGNAL(u'activated(int)'), self.calculateLines) + QtCore.QObject.connect(self, QtCore.SIGNAL(u'accepted()'), self.accept) def pageChanged(self, pageId): """ Detects Page changes and updates as approprate. """ - if pageId == 6: + if self.page(pageId) == self.previewPage: self.updateTheme() frame = self.thememanager.generateImage(self.theme) self.previewBoxLabel.setPixmap(QtGui.QPixmap.fromImage(frame)) @@ -159,7 +148,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Map field names to screen names, """ self.backgroundPage.registerField( - u'background_type', self.backgroundTypeComboBox) + u'background_type', self.backgroundComboBox) self.backgroundPage.registerField( u'color', self.colorButton) self.backgroundPage.registerField( @@ -167,11 +156,11 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.backgroundPage.registerField( u'grandient_end', self.gradientEndButton) self.backgroundPage.registerField( - u'background_image', self.imageLineEdit) + u'background_image', self.imageFileEdit) self.backgroundPage.registerField( u'gradient', self.gradientComboBox) self.mainAreaPage.registerField( - u'mainColorPushButton', self.mainColorPushButton) + u'mainColorButton', self.mainColorButton) self.mainAreaPage.registerField( u'mainSizeSpinBox', self.mainSizeSpinBox) self.mainAreaPage.registerField( @@ -179,17 +168,17 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.mainAreaPage.registerField( u'outlineCheckBox', self.outlineCheckBox) self.mainAreaPage.registerField( - u'outlineColorPushButton', self.outlineColorPushButton) + u'outlineColorPushButton', self.outlineColorButton) self.mainAreaPage.registerField( u'outlineSizeSpinBox', self.outlineSizeSpinBox) self.mainAreaPage.registerField( u'shadowCheckBox', self.shadowCheckBox) self.mainAreaPage.registerField( - u'boldCheckBox', self.boldCheckBox) + u'mainBoldCheckBox', self.mainBoldCheckBox) self.mainAreaPage.registerField( - u'italicsCheckBox', self.italicsCheckBox) + u'mainItalicsCheckBox', self.mainItalicsCheckBox) self.mainAreaPage.registerField( - u'shadowColorPushButton', self.shadowColorPushButton) + u'shadowColorButton', self.shadowColorButton) self.mainAreaPage.registerField( u'shadowSizeSpinBox', self.shadowSizeSpinBox) self.mainAreaPage.registerField( @@ -224,7 +213,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Calculate the number of lines on a page by rendering text """ # Do not trigger on start up - if self.page != 0: + if self.currentPage != self.welcomePage: self.updateTheme() frame = self.thememanager.generateImage(self.theme, True) @@ -243,7 +232,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.theme.font_main_outline = True else: self.theme.font_main_outline = False - self.outlineColorPushButton.setEnabled(self.theme.font_main_outline) + self.outlineColorButton.setEnabled(self.theme.font_main_outline) self.outlineSizeSpinBox.setEnabled(self.theme.font_main_outline) self.calculateLines() @@ -255,35 +244,21 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.theme.font_main_shadow = True else: self.theme.font_main_shadow = False - self.shadowColorPushButton.setEnabled(self.theme.font_main_shadow) + self.shadowColorButton.setEnabled(self.theme.font_main_shadow) self.shadowSizeSpinBox.setEnabled(self.theme.font_main_shadow) self.calculateLines() - def onMainDefaultPositionCheckBox(self, value): + def onMainPositionCheckBox(self, value): """ Change state as Main Area Position check box changed """ - if value == QtCore.Qt.Checked: - self.theme.font_main_override = False - else: - self.theme.font_main_override = True - self.mainXSpinBox.setEnabled(self.theme.font_main_override) - self.mainYSpinBox.setEnabled(self.theme.font_main_override) - self.mainHeightSpinBox.setEnabled(self.theme.font_main_override) - self.mainWidthSpinBox.setEnabled(self.theme.font_main_override) + self.theme.font_main_override = (value == QtCore.Qt.Checked) - def onFooterDefaultPositionCheckBox(self, value): + def onFooterPositionCheckBox(self, value): """ Change state as Footer Area Position check box changed """ - if value == QtCore.Qt.Checked: - self.theme.font_footer_override = False - else: - self.theme.font_footer_override = True - self.footerXSpinBox.setEnabled(self.theme.font_footer_override) - self.footerYSpinBox.setEnabled(self.theme.font_footer_override) - self.footerHeightSpinBox.setEnabled(self.theme.font_footer_override) - self.footerWidthSpinBox.setEnabled(self.theme.font_footer_override) + self.theme.font_footer_override = (value == QtCore.Qt.Checked) def exec_(self, edit=False): """ @@ -302,16 +277,16 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Set up the pages for Initial run through dialog """ log.debug(u'initializePage %s' % id) - self.page = id - if id == 1: + wizardPage = self.page(id) + if wizardPage == self.backgroundPage: self.setBackgroundTabValues() - elif id == 2: + elif wizardPage == self.mainAreaPage: self.setMainAreaTabValues() - elif id == 3: + elif wizardPage == self.footerAreaPage: self.setFooterAreaTabValues() - elif id == 4: + elif wizardPage == self.alignmentPage: self.setAlignmentTabValues() - elif id == 5: + elif wizardPage == self.areaPositionPage: self.setPositionTabValues() def setBackgroundTabValues(self): @@ -331,7 +306,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.theme.background_end_color) self.setField(u'background_type', QtCore.QVariant(1)) else: - self.imageLineEdit.setText(self.theme.background_filename) + self.imageFileEdit.setText(self.theme.background_filename) self.setField(u'background_type', QtCore.QVariant(2)) if self.theme.background_direction == \ BackgroundGradientType.to_string(BackgroundGradientType.Horizontal): @@ -354,41 +329,28 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.mainFontComboBox.setCurrentFont( QtGui.QFont(self.theme.font_main_name)) - self.mainColorPushButton.setStyleSheet(u'background-color: %s' % + self.mainColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_main_color) - self.setField(u'mainSizeSpinBox', \ + self.setField(u'mainSizeSpinBox', QtCore.QVariant(self.theme.font_main_size)) - self.setField(u'lineSpacingSpinBox', \ + self.setField(u'lineSpacingSpinBox', QtCore.QVariant(self.theme.font_main_line_adjustment)) - self.setField(u'outlineCheckBox', \ + self.setField(u'outlineCheckBox', QtCore.QVariant(self.theme.font_main_outline)) - self.outlineColorPushButton.setStyleSheet(u'background-color: %s' % + self.outlineColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_main_outline_color) - self.setField(u'outlineSizeSpinBox', \ + self.setField(u'outlineSizeSpinBox', QtCore.QVariant(self.theme.font_main_outline_size)) - self.setField(u'shadowCheckBox', \ + self.setField(u'shadowCheckBox', QtCore.QVariant(self.theme.font_main_shadow)) - self.shadowColorPushButton.setStyleSheet(u'background-color: %s' % + self.shadowColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_main_shadow_color) - self.setField(u'shadowSizeSpinBox', \ + self.setField(u'shadowSizeSpinBox', QtCore.QVariant(self.theme.font_main_shadow_size)) - self.setField(u'boldCheckBox', \ + self.setField(u'mainBoldCheckBox', QtCore.QVariant(self.theme.font_main_bold)) - self.setField(u'italicsCheckBox', \ + self.setField(u'mainItalicsCheckBox', QtCore.QVariant(self.theme.font_main_italics)) - # Set up field states - if self.theme.font_main_outline: - self.setField(u'outlineCheckBox', QtCore.QVariant(False)) - else: - self.setField(u'outlineCheckBox', QtCore.QVariant(True)) - self.outlineColorPushButton.setEnabled(self.theme.font_main_outline) - self.outlineSizeSpinBox.setEnabled(self.theme.font_main_outline) - if self.theme.font_main_shadow: - self.setField(u'shadowCheckBox', QtCore.QVariant(False)) - else: - self.setField(u'shadowCheckBox', QtCore.QVariant(True)) - self.shadowColorPushButton.setEnabled(self.theme.font_main_shadow) - self.shadowSizeSpinBox.setEnabled(self.theme.font_main_shadow) def setFooterAreaTabValues(self): """ @@ -396,9 +358,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.footerFontComboBox.setCurrentFont( QtGui.QFont(self.theme.font_main_name)) - self.footerColorPushButton.setStyleSheet(u'background-color: %s' % + self.footerColorButton.setStyleSheet(u'background-color: %s' % self.theme.font_footer_color) - self.setField(u'footerSizeSpinBox', \ + self.setField(u'footerSizeSpinBox', QtCore.QVariant(self.theme.font_footer_size)) def setPositionTabValues(self): @@ -406,49 +368,40 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): Handle the display and State of the Position tab. """ # Main Area - if self.theme.font_main_override: - self.mainDefaultPositionCheckBox.setChecked(False) - else: - self.mainDefaultPositionCheckBox.setChecked(True) - self.setField(u'mainPositionX', \ - QtCore.QVariant(self.theme.font_main_x)) - self.setField(u'mainPositionY', \ - QtCore.QVariant(self.theme.font_main_y)) - self.setField(u'mainPositionHeight', \ + self.mainPositionCheckBox.setChecked(not self.theme.font_main_override) + self.setField(u'mainPositionX', QtCore.QVariant(self.theme.font_main_x)) + self.setField(u'mainPositionY', QtCore.QVariant(self.theme.font_main_y)) + self.setField(u'mainPositionHeight', QtCore.QVariant(self.theme.font_main_height)) - self.setField(u'mainPositionWidth', \ + self.setField(u'mainPositionWidth', QtCore.QVariant(self.theme.font_main_width)) # Footer - if self.theme.font_footer_override: - self.footerDefaultPositionCheckBox.setChecked(False) - else: - self.footerDefaultPositionCheckBox.setChecked(True) - self.setField(u'footerPositionX', \ + self.footerPositionCheckBox.setChecked( + not self.theme.font_footer_override) + self.setField(u'footerPositionX', QtCore.QVariant(self.theme.font_footer_x)) - self.setField(u'footerPositionY', \ + self.setField(u'footerPositionY', QtCore.QVariant(self.theme.font_footer_y)) - self.setField(u'footerPositionHeight', \ + self.setField(u'footerPositionHeight', QtCore.QVariant(self.theme.font_footer_height)) - self.setField(u'footerPositionWidth', \ + self.setField(u'footerPositionWidth', QtCore.QVariant(self.theme.font_footer_width)) def setAlignmentTabValues(self): """ Define the Tab Alignments Page """ - self.setField(u'horizontal', \ + self.setField(u'horizontal', QtCore.QVariant(self.theme.display_horizontal_align)) - self.setField(u'vertical', \ + self.setField(u'vertical', QtCore.QVariant(self.theme.display_vertical_align)) - self.setField(u'slideTransition', \ + self.setField(u'slideTransition', QtCore.QVariant(self.theme.display_slide_transition)) def setPreviewTabValues(self): self.setField(u'name', QtCore.QVariant(self.theme.theme_name)) - if len(self.theme.theme_name) > 0: - self.themeNameEdit.setEnabled(False) - else: - self.themeNameEdit.setEnabled(True) + self.themeNameEdit.setReadOnly(len(self.theme.theme_name) != 0) + self.themeNameEdit.setFrame(len(self.theme.theme_name) == 0) def onBackgroundComboBox(self, index): """ @@ -456,17 +409,6 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.theme.background_type = BackgroundType.to_string(index) self.setBackgroundTabValues() - self.colorLabel.setVisible(index == 0) - self.colorButton.setVisible(index == 0) - self.gradientStartLabel.setVisible(index == 1) - self.gradientStartButton.setVisible(index == 1) - self.gradientEndLabel.setVisible(index == 1) - self.gradientEndButton.setVisible(index == 1) - self.gradientTypeLabel.setVisible(index == 1) - self.gradientComboBox.setVisible(index == 1) - self.imageLabel.setVisible(index == 2) - self.imageLineEdit.setVisible(index == 2) - self.imageBrowseButton.setVisible(index == 2) def onGradientComboBox(self, index): """ @@ -514,22 +456,22 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.theme.background_filename = unicode(filename) self.setBackgroundTabValues() - def onMainColourPushButtonClicked(self): + def onMainColourButtonClicked(self): self.theme.font_main_color = \ self._colorButton(self.theme.font_main_color) self.setMainAreaTabValues() - def onOutlineColourPushButtonClicked(self): + def onOutlineColourButtonClicked(self): self.theme.font_main_outline_color = \ self._colorButton(self.theme.font_main_outline_color) self.setMainAreaTabValues() - def onShadowColourPushButtonClicked(self): + def onShadowColourButtonClicked(self): self.theme.font_main_shadow_color = \ self._colorButton(self.theme.font_main_shadow_color) self.setMainAreaTabValues() - def onFooterColourPushButtonClicked(self): + def onFooterColourButtonClicked(self): self.theme.font_footer_color = \ self._colorButton(self.theme.font_footer_color) self.setFooterAreaTabValues() @@ -554,9 +496,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.theme.font_main_shadow_size = \ self.field(u'shadowSizeSpinBox').toInt()[0] self.theme.font_main_bold = \ - self.field(u'boldCheckBox').toBool() + self.field(u'mainBoldCheckBox').toBool() self.theme.font_main_italics = \ - self.field(u'italicsCheckBox').toBool() + self.field(u'mainItalicsCheckBox').toBool() # footer page self.theme.font_footer_name = \ unicode(self.footerFontComboBox.currentFont().family()) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index ce17e233a..e7561cccf 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -36,433 +36,389 @@ class Ui_ThemeWizard(object): ThemeWizard.setOptions( QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage) + # welcome page self.welcomePage = QtGui.QWizardPage() self.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap, QtGui.QPixmap(u':/wizards/wizard_createtheme.bmp')) - self.welcomePage.setObjectName(u'welcomePage') + self.welcomePage.setObjectName(u'WelcomePage') self.welcomeLayout = QtGui.QVBoxLayout(self.welcomePage) - self.welcomeLayout.setMargin(12) - self.welcomeLayout.setSpacing(6) - self.welcomeLayout.setObjectName(u'welcomeLayout') + self.welcomeLayout.setObjectName(u'WelcomeLayout') self.titleLabel = QtGui.QLabel(self.welcomePage) - self.titleLabel.setObjectName(u'titleLabel') + self.titleLabel.setObjectName(u'TitleLabel') self.welcomeLayout.addWidget(self.titleLabel) - self.welcomeTopSpacer = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - self.welcomeLayout.addItem(self.welcomeTopSpacer) + self.welcomeLayout.addSpacing(40) self.informationLabel = QtGui.QLabel(self.welcomePage) self.informationLabel.setWordWrap(True) - self.informationLabel.setObjectName(u'informationLabel') + self.informationLabel.setObjectName(u'InformationLabel') self.welcomeLayout.addWidget(self.informationLabel) - self.welcomeBottomSpacer = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.welcomeLayout.addItem(self.welcomeBottomSpacer) + self.welcomeLayout.addStretch() ThemeWizard.addPage(self.welcomePage) + # background page self.backgroundPage = QtGui.QWizardPage() - self.backgroundPage.setObjectName(u'backgroundPage') - self.backgroundLayout = QtGui.QFormLayout(self.backgroundPage) - self.backgroundLayout.setMargin(12) - self.backgroundLayout.setVerticalSpacing(6) - self.backgroundLayout.setObjectName(u'backgroundLayout') - self.backgroundTypeLabel = QtGui.QLabel(self.backgroundPage) - self.backgroundTypeLabel.setObjectName(u'backgroundTypeLabel') - self.backgroundLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.backgroundTypeLabel) - self.backgroundTypeComboBox = QtGui.QComboBox(self.backgroundPage) - self.backgroundTypeComboBox.addItem(u'') - self.backgroundTypeComboBox.addItem(u'') - self.backgroundTypeComboBox.addItem(u'') - self.backgroundTypeComboBox.setObjectName(u'backgroundTypeComboBox') - self.backgroundLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.backgroundTypeComboBox) - self.colorLabel = QtGui.QLabel(self.backgroundPage) - self.colorLabel.setObjectName(u'colorLabel') - self.backgroundLayout.setWidget(1, QtGui.QFormLayout.LabelRole, - self.colorLabel) - self.colorButton = QtGui.QPushButton(self.backgroundPage) - self.colorButton.setObjectName(u'colorButton') - self.backgroundLayout.setWidget(1, QtGui.QFormLayout.FieldRole, - self.colorButton) - self.gradientStartLabel = QtGui.QLabel(self.backgroundPage) - self.gradientStartLabel.setVisible(False) - self.gradientStartLabel.setObjectName(u'gradientStartLabel') - self.backgroundLayout.setWidget(2, QtGui.QFormLayout.LabelRole, - self.gradientStartLabel) - self.gradientStartButton = QtGui.QPushButton(self.backgroundPage) - self.gradientStartButton.setVisible(False) - self.gradientStartButton.setObjectName(u'gradientStartButton') - self.backgroundLayout.setWidget(2, QtGui.QFormLayout.FieldRole, + 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'']) + self.backgroundComboBox.setObjectName(u'BackgroundComboBox') + self.backgroundTypeLayout.addRow(self.backgroundLabel, + self.backgroundComboBox) + self.backgroundTypeSpacer = QtGui.QSpacerItem(10, 0, + QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) + self.backgroundTypeLayout.setItem(1,QtGui.QFormLayout.LabelRole, + self.backgroundTypeSpacer) + 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.colorSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.colorLayout.setItem(1, QtGui.QFormLayout.LabelRole, + self.colorSpacer) + 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.backgroundPage) - self.gradientEndLabel.setVisible(False) - self.gradientEndLabel.setObjectName(u'gradientEndLabel') - self.backgroundLayout.setWidget(3, QtGui.QFormLayout.LabelRole, - self.gradientEndLabel) - self.gradientEndButton = QtGui.QPushButton(self.backgroundPage) - self.gradientEndButton.setVisible(False) - self.gradientEndButton.setObjectName(u'gradientEndButton') - self.backgroundLayout.setWidget(3, QtGui.QFormLayout.FieldRole, + 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.backgroundPage) - self.gradientTypeLabel.setVisible(False) - self.gradientTypeLabel.setObjectName(u'gradientTypeLabel') - self.backgroundLayout.setWidget(4, QtGui.QFormLayout.LabelRole, - self.gradientTypeLabel) - self.gradientComboBox = QtGui.QComboBox(self.backgroundPage) - self.gradientComboBox.setVisible(False) - self.gradientComboBox.setObjectName(u'gradientComboBox') - self.gradientComboBox.addItem(u'') - self.gradientComboBox.addItem(u'') - self.gradientComboBox.addItem(u'') - self.gradientComboBox.addItem(u'') - self.gradientComboBox.addItem(u'') - self.backgroundLayout.setWidget(4, QtGui.QFormLayout.FieldRole, + 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.imageLabel = QtGui.QLabel(self.backgroundPage) - self.imageLabel.setVisible(False) - self.imageLabel.setObjectName(u'imageLabel') - self.backgroundLayout.setWidget(5, QtGui.QFormLayout.LabelRole, - self.imageLabel) + self.gradientSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.gradientLayout.setItem(3, QtGui.QFormLayout.LabelRole, + self.gradientSpacer) + 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.imageLabel = QtGui.QLabel(self.imageWidget) + self.imageLabel.setObjectName(u'ImageLabel') self.imageFileLayout = QtGui.QHBoxLayout() - self.imageFileLayout.setObjectName(u'imageFileLayout') - self.imageLineEdit = QtGui.QLineEdit(self.backgroundPage) - self.imageLineEdit.setVisible(False) - self.imageLineEdit.setObjectName(u'imageLineEdit') - self.imageFileLayout.addWidget(self.imageLineEdit) - self.imageBrowseButton = QtGui.QToolButton(self.backgroundPage) - self.imageBrowseButton.setVisible(False) - self.imageBrowseButton.setObjectName(u'imageBrowseButton') + 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.backgroundLayout.setLayout(5, QtGui.QFormLayout.FieldRole, - self.imageFileLayout) + self.imageLayout.addRow(self.imageLabel, self.imageFileLayout) + self.imageSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.imageLayout.setItem(1, QtGui.QFormLayout.LabelRole, + self.imageSpacer) + self.backgroundStack.addWidget(self.imageWidget) + self.backgroundLayout.addLayout(self.backgroundStack) ThemeWizard.addPage(self.backgroundPage) + # main area page self.mainAreaPage = QtGui.QWizardPage() - self.mainAreaPage.setObjectName(u'mainAreaPage') + self.mainAreaPage.setObjectName(u'MainAreaPage') self.mainAreaLayout = QtGui.QFormLayout(self.mainAreaPage) - self.mainAreaLayout.setMargin(12) - self.mainAreaLayout.setVerticalSpacing(6) - self.mainAreaLayout.setObjectName(u'mainAreaLayout') + self.mainAreaLayout.setObjectName(u'MainAreaLayout') self.mainFontLabel = QtGui.QLabel(self.mainAreaPage) - self.mainFontLabel.setObjectName(u'mainFontLabel') - self.mainAreaLayout.setWidget(0, - QtGui.QFormLayout.LabelRole, self.mainFontLabel) + self.mainFontLabel.setObjectName(u'MainFontLabel') self.mainFontComboBox = QtGui.QFontComboBox(self.mainAreaPage) - self.mainFontComboBox.setObjectName(u'mainFontComboBox') - self.mainAreaLayout.setWidget(0, - QtGui.QFormLayout.FieldRole, self.mainFontComboBox) + self.mainFontComboBox.setObjectName(u'MainFontComboBox') + self.mainAreaLayout.addRow(self.mainFontLabel, self.mainFontComboBox) self.mainColorLabel = QtGui.QLabel(self.mainAreaPage) - self.mainColorLabel.setObjectName(u'mainColorLabel') - self.mainAreaLayout.setWidget(1, - QtGui.QFormLayout.LabelRole, self.mainColorLabel) - self.fontPropertiesLayout = QtGui.QHBoxLayout() - self.fontPropertiesLayout.setSpacing(12) - self.fontPropertiesLayout.setObjectName(u'fontPropertiesLayout') - self.mainColorPushButton = QtGui.QPushButton(self.mainAreaPage) - self.mainColorPushButton.setObjectName(u'mainColorPushButton') - self.fontPropertiesLayout.addWidget(self.mainColorPushButton) - self.boldCheckBox = QtGui.QCheckBox(self.mainAreaPage) - self.boldCheckBox.setObjectName(u'boldCheckBox') - self.fontPropertiesLayout.addWidget(self.boldCheckBox) - self.italicsCheckBox = QtGui.QCheckBox(self.mainAreaPage) - self.italicsCheckBox.setObjectName(u'italicsCheckBox') - self.fontPropertiesLayout.addWidget(self.italicsCheckBox) - self.mainAreaLayout.setLayout(1, - QtGui.QFormLayout.FieldRole, self.fontPropertiesLayout) + 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.mainAreaLayout.setWidget(2, - QtGui.QFormLayout.LabelRole, self.mainSizeLabel) + self.mainSizeLabel.setObjectName(u'MainSizeLabel') self.mainSizeLayout = QtGui.QHBoxLayout() - self.mainSizeLayout.setObjectName(u'mainSizeLayout') + self.mainSizeLayout.setObjectName(u'MainSizeLayout') self.mainSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage) self.mainSizeSpinBox.setMaximum(999) - self.mainSizeSpinBox.setProperty(u'value', 16) - self.mainSizeSpinBox.setObjectName(u'mainSizeSpinBox') + 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.mainLineCountLabel.setObjectName(u'MainLineCountLabel') self.mainSizeLayout.addWidget(self.mainLineCountLabel) - self.mainAreaLayout.setLayout(2, - QtGui.QFormLayout.FieldRole, self.mainSizeLayout) + self.mainAreaLayout.addRow(self.mainSizeLabel, self.mainSizeLayout) self.lineSpacingLabel = QtGui.QLabel(self.mainAreaPage) - self.lineSpacingLabel.setObjectName(u'lineSpacingLabel') - self.mainAreaLayout.setWidget(3, - QtGui.QFormLayout.LabelRole, self.lineSpacingLabel) + 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.setWidget(3, - QtGui.QFormLayout.FieldRole, self.lineSpacingSpinBox) + self.lineSpacingSpinBox.setObjectName(u'LineSpacingSpinBox') + self.mainAreaLayout.addRow(self.lineSpacingLabel, + self.lineSpacingSpinBox) self.outlineCheckBox = QtGui.QCheckBox(self.mainAreaPage) - self.outlineCheckBox.setObjectName(u'outlineCheckBox') - self.mainAreaLayout.setWidget(4, - QtGui.QFormLayout.LabelRole, self.outlineCheckBox) + self.outlineCheckBox.setObjectName(u'OutlineCheckBox') self.outlineLayout = QtGui.QHBoxLayout() - self.outlineLayout.setObjectName(u'outlineLayout') - self.outlineColorPushButton = QtGui.QPushButton(self.mainAreaPage) - self.outlineColorPushButton.setObjectName(u'outlineColorPushButton') - self.outlineLayout.addWidget(self.outlineColorPushButton) + 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.outlineSizeLabel.setObjectName(u'OutlineSizeLabel') self.outlineLayout.addWidget(self.outlineSizeLabel) self.outlineSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage) - self.outlineSizeSpinBox.setObjectName(u'outlineSizeSpinBox') + self.outlineSizeSpinBox.setEnabled(False) + self.outlineSizeSpinBox.setObjectName(u'OutlineSizeSpinBox') self.outlineLayout.addWidget(self.outlineSizeSpinBox) - self.mainAreaLayout.setLayout(4, - QtGui.QFormLayout.FieldRole, self.outlineLayout) + self.mainAreaLayout.addRow(self.outlineCheckBox, self.outlineLayout) self.shadowCheckBox = QtGui.QCheckBox(self.mainAreaPage) - self.shadowCheckBox.setObjectName(u'shadowCheckBox') - self.mainAreaLayout.setWidget(5, - QtGui.QFormLayout.LabelRole, self.shadowCheckBox) + self.shadowCheckBox.setObjectName(u'ShadowCheckBox') self.shadowLayout = QtGui.QHBoxLayout() - self.shadowLayout.setObjectName(u'shadowLayout') - self.shadowColorPushButton = QtGui.QPushButton(self.mainAreaPage) - self.shadowColorPushButton.setObjectName(u'shadowColorPushButton') - self.shadowLayout.addWidget(self.shadowColorPushButton) + 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.shadowSizeLabel.setObjectName(u'ShadowSizeLabel') self.shadowLayout.addWidget(self.shadowSizeLabel) self.shadowSizeSpinBox = QtGui.QSpinBox(self.mainAreaPage) - self.shadowSizeSpinBox.setObjectName(u'shadowSizeSpinBox') + self.shadowSizeSpinBox.setEnabled(False) + self.shadowSizeSpinBox.setObjectName(u'ShadowSizeSpinBox') self.shadowLayout.addWidget(self.shadowSizeSpinBox) - self.mainAreaLayout.setLayout(5, - QtGui.QFormLayout.FieldRole, self.shadowLayout) + self.mainAreaLayout.addRow(self.shadowCheckBox, self.shadowLayout) ThemeWizard.addPage(self.mainAreaPage) + # footer area page self.footerAreaPage = QtGui.QWizardPage() - self.footerAreaPage.setObjectName(u'footerAreaPage') - self.footerLayout = QtGui.QFormLayout(self.footerAreaPage) - self.footerLayout.setMargin(12) - self.footerLayout.setVerticalSpacing(6) - self.footerLayout.setObjectName(u'footerLayout') + 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.footerLayout.setWidget(0, - QtGui.QFormLayout.LabelRole, self.footerFontLabel) + self.footerFontLabel.setObjectName(u'FooterFontLabel') self.footerFontComboBox = QtGui.QFontComboBox(self.footerAreaPage) self.footerFontComboBox.setObjectName(u'footerFontComboBox') - self.footerLayout.setWidget(0, - QtGui.QFormLayout.FieldRole, self.footerFontComboBox) + self.footerAreaLayout.addRow(self.footerFontLabel, + self.footerFontComboBox) self.footerColorLabel = QtGui.QLabel(self.footerAreaPage) - self.footerColorLabel.setObjectName(u'footerColorLabel') - self.footerLayout.setWidget(1, - QtGui.QFormLayout.LabelRole, self.footerColorLabel) - self.footerColorPushButton = QtGui.QPushButton(self.footerAreaPage) - self.footerColorPushButton.setObjectName(u'footerColorPushButton') - self.footerLayout.setWidget(1, - QtGui.QFormLayout.FieldRole, self.footerColorPushButton) + 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.footerLayout.setWidget(2, - QtGui.QFormLayout.LabelRole, self.footerSizeLabel) + self.footerSizeLabel.setObjectName(u'FooterSizeLabel') self.footerSizeSpinBox = QtGui.QSpinBox(self.footerAreaPage) self.footerSizeSpinBox.setMaximum(999) - self.footerSizeSpinBox.setProperty(u'value', 10) - self.footerSizeSpinBox.setObjectName(u'footerSizeSpinBox') - self.footerLayout.setWidget(2, - QtGui.QFormLayout.FieldRole, self.footerSizeSpinBox) + self.footerSizeSpinBox.setValue(10) + self.footerSizeSpinBox.setObjectName(u'FooterSizeSpinBox') + self.footerAreaLayout.addRow(self.footerSizeLabel, self.footerSizeSpinBox) ThemeWizard.addPage(self.footerAreaPage) + # alignment page self.alignmentPage = QtGui.QWizardPage() - self.alignmentPage.setObjectName(u'alignmentPage') + self.alignmentPage.setObjectName(u'AlignmentPage') self.alignmentLayout = QtGui.QFormLayout(self.alignmentPage) - self.alignmentLayout.setMargin(12) - self.alignmentLayout.setVerticalSpacing(6) - self.alignmentLayout.setObjectName(u'alignmentLayout') + self.alignmentLayout.setObjectName(u'AlignmentLayout') self.horizontalLabel = QtGui.QLabel(self.alignmentPage) - self.horizontalLabel.setObjectName(u'horizontalLabel') - self.alignmentLayout.setWidget(0, - QtGui.QFormLayout.LabelRole, self.horizontalLabel) + self.horizontalLabel.setObjectName(u'HorizontalLabel') self.horizontalComboBox = QtGui.QComboBox(self.alignmentPage) - self.horizontalComboBox.setObjectName(u'horizontalComboBox') - self.horizontalComboBox.addItem(u'') - self.horizontalComboBox.addItem(u'') - self.horizontalComboBox.addItem(u'') - self.alignmentLayout.setWidget(0, - QtGui.QFormLayout.FieldRole, self.horizontalComboBox) + self.horizontalComboBox.addItems([u'', u'', u'']) + self.horizontalComboBox.setObjectName(u'HorizontalComboBox') + self.alignmentLayout.addRow(self.horizontalLabel, + self.horizontalComboBox) self.verticalLabel = QtGui.QLabel(self.alignmentPage) - self.verticalLabel.setObjectName(u'verticalLabel') - self.alignmentLayout.setWidget(1, - QtGui.QFormLayout.LabelRole, self.verticalLabel) + self.verticalLabel.setObjectName(u'VerticalLabel') self.verticalComboBox = QtGui.QComboBox(self.alignmentPage) - self.verticalComboBox.setObjectName(u'verticalComboBox') - self.verticalComboBox.addItem(u'') - self.verticalComboBox.addItem(u'') - self.verticalComboBox.addItem(u'') - self.alignmentLayout.setWidget(1, - QtGui.QFormLayout.FieldRole, self.verticalComboBox) + self.verticalComboBox.addItems([u'', u'', u'']) + self.verticalComboBox.setObjectName(u'VerticalComboBox') + self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox) self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage) - self.transitionsCheckBox.setObjectName(u'transitionsCheckBox') - self.alignmentLayout.setWidget(2, - QtGui.QFormLayout.FieldRole, self.transitionsCheckBox) + self.transitionsCheckBox.setObjectName(u'TransitionsCheckBox') + self.alignmentLayout.addRow(self.transitionsCheckBox) ThemeWizard.addPage(self.alignmentPage) + # area position page self.areaPositionPage = QtGui.QWizardPage() - self.areaPositionPage.setObjectName(u'areaPositionPage') - self.areaPositionLayout = QtGui.QGridLayout(self.areaPositionPage) - self.areaPositionLayout.setObjectName(u'areaPositionLayout') + 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.mainPositionGroupBox.setObjectName(u'MainPositionGroupBox') self.mainPositionLayout = QtGui.QFormLayout(self.mainPositionGroupBox) - self.mainPositionLayout.setSpacing(6) - self.mainPositionLayout.setObjectName(u'mainPositionLayout') - self.mainDefaultPositionCheckBox = QtGui.QCheckBox( - self.mainPositionGroupBox) - self.mainDefaultPositionCheckBox.setChecked(True) - self.mainDefaultPositionCheckBox.setObjectName( - u'mainDefaultPositionCheckBox') - self.mainPositionLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.mainDefaultPositionCheckBox) + 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.mainPositionLayout.setWidget(1, - QtGui.QFormLayout.LabelRole, self.mainXLabel) + self.mainXLabel.setObjectName(u'MainXLabel') self.mainXSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) - self.mainXSpinBox.setEnabled(False) self.mainXSpinBox.setMaximum(9999) - self.mainXSpinBox.setProperty(u'value', 0) - self.mainXSpinBox.setObjectName(u'mainXSpinBox') - self.mainPositionLayout.setWidget(1, - QtGui.QFormLayout.FieldRole, self.mainXSpinBox) + self.mainXSpinBox.setObjectName(u'MainXSpinBox') + self.mainPositionLayout.addRow(self.mainXLabel, self.mainXSpinBox) self.mainYLabel = QtGui.QLabel(self.mainPositionGroupBox) - self.mainYLabel.setObjectName(u'mainYLabel') - self.mainPositionLayout.setWidget(2, - QtGui.QFormLayout.LabelRole, self.mainYLabel) + self.mainYLabel.setObjectName(u'MainYLabel') self.mainYSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) - self.mainYSpinBox.setEnabled(False) self.mainYSpinBox.setMaximum(9999) - self.mainYSpinBox.setObjectName(u'mainYSpinBox') - self.mainPositionLayout.setWidget(2, - QtGui.QFormLayout.FieldRole, self.mainYSpinBox) + self.mainYSpinBox.setObjectName(u'MainYSpinBox') + self.mainPositionLayout.addRow(self.mainYLabel, self.mainYSpinBox) self.mainWidthLabel = QtGui.QLabel(self.mainPositionGroupBox) - self.mainWidthLabel.setObjectName(u'mainWidthLabel') - self.mainPositionLayout.setWidget(3, - QtGui.QFormLayout.LabelRole, self.mainWidthLabel) + self.mainWidthLabel.setObjectName(u'MainWidthLabel') self.mainWidthSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) - self.mainWidthSpinBox.setEnabled(False) self.mainWidthSpinBox.setMaximum(9999) - self.mainWidthSpinBox.setObjectName(u'mainWidthSpinBox') - self.mainPositionLayout.setWidget(3, - QtGui.QFormLayout.FieldRole, self.mainWidthSpinBox) + self.mainWidthSpinBox.setObjectName(u'MainWidthSpinBox') + self.mainPositionLayout.addRow(self.mainWidthLabel, + self.mainWidthSpinBox) self.mainHeightLabel = QtGui.QLabel(self.mainPositionGroupBox) - self.mainHeightLabel.setObjectName(u'mainHeightLabel') - self.mainPositionLayout.setWidget(4, - QtGui.QFormLayout.LabelRole, self.mainHeightLabel) + self.mainHeightLabel.setObjectName(u'MainHeightLabel') self.mainHeightSpinBox = QtGui.QSpinBox(self.mainPositionGroupBox) - self.mainHeightSpinBox.setEnabled(False) self.mainHeightSpinBox.setMaximum(9999) - self.mainHeightSpinBox.setObjectName(u'mainHeightSpinBox') - self.mainPositionLayout.setWidget(4, - QtGui.QFormLayout.FieldRole, self.mainHeightSpinBox) - self.areaPositionLayout.addWidget( - self.mainPositionGroupBox, 1, 0, 1, 1) + 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.setVerticalSpacing(6) - self.footerPositionLayout.setObjectName(u'footerPositionLayout') + 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.footerPositionLayout.setWidget(1, - QtGui.QFormLayout.LabelRole, self.footerXLabel) + self.footerXLabel.setObjectName(u'FooterXLabel') self.footerXSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) - self.footerXSpinBox.setEnabled(False) self.footerXSpinBox.setMaximum(9999) - self.footerXSpinBox.setProperty(u'value', 0) - self.footerXSpinBox.setObjectName(u'footerXSpinBox') - self.footerPositionLayout.setWidget(1, - QtGui.QFormLayout.FieldRole, self.footerXSpinBox) + self.footerXSpinBox.setObjectName(u'FooterXSpinBox') + self.footerPositionLayout.addRow(self.footerXLabel, self.footerXSpinBox) self.footerYLabel = QtGui.QLabel(self.footerPositionGroupBox) - self.footerYLabel.setObjectName(u'footerYLabel') - self.footerPositionLayout.setWidget(2, - QtGui.QFormLayout.LabelRole, self.footerYLabel) + self.footerYLabel.setObjectName(u'FooterYLabel') self.footerYSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) - self.footerYSpinBox.setEnabled(False) self.footerYSpinBox.setMaximum(9999) - self.footerYSpinBox.setProperty(u'value', 0) - self.footerYSpinBox.setObjectName(u'footerYSpinBox') - self.footerPositionLayout.setWidget(2, - QtGui.QFormLayout.FieldRole, self.footerYSpinBox) + self.footerYSpinBox.setObjectName(u'FooterYSpinBox') + self.footerPositionLayout.addRow(self.footerYLabel, self.footerYSpinBox) self.footerWidthLabel = QtGui.QLabel(self.footerPositionGroupBox) - self.footerWidthLabel.setObjectName(u'footerWidthLabel') - self.footerPositionLayout.setWidget(3, - QtGui.QFormLayout.LabelRole, self.footerWidthLabel) + self.footerWidthLabel.setObjectName(u'FooterWidthLabel') self.footerWidthSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) - self.footerWidthSpinBox.setEnabled(False) - self.footerWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.footerWidthSpinBox.setMaximum(9999) - self.footerWidthSpinBox.setObjectName(u'footerWidthSpinBox') - self.footerPositionLayout.setWidget(3, - QtGui.QFormLayout.FieldRole, self.footerWidthSpinBox) + self.footerWidthSpinBox.setObjectName(u'FooterWidthSpinBox') + self.footerPositionLayout.addRow(self.footerWidthLabel, + self.footerWidthSpinBox) self.footerHeightLabel = QtGui.QLabel(self.footerPositionGroupBox) - self.footerHeightLabel.setObjectName(u'footerHeightLabel') - self.footerPositionLayout.setWidget(4, - QtGui.QFormLayout.LabelRole, self.footerHeightLabel) + self.footerHeightLabel.setObjectName(u'FooterHeightLabel') self.footerHeightSpinBox = QtGui.QSpinBox(self.footerPositionGroupBox) - self.footerHeightSpinBox.setEnabled(False) - self.footerHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.footerHeightSpinBox.setMaximum(9999) - self.footerHeightSpinBox.setObjectName(u'footerHeightSpinBox') - self.footerPositionLayout.setWidget(4, - QtGui.QFormLayout.FieldRole, self.footerHeightSpinBox) - self.footerDefaultPositionCheckBox = QtGui.QCheckBox( - self.footerPositionGroupBox) - self.footerDefaultPositionCheckBox.setChecked(True) - self.footerDefaultPositionCheckBox.setObjectName( - u'footerDefaultPositionCheckBox') - self.footerPositionLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.footerDefaultPositionCheckBox) - self.areaPositionLayout.addWidget( - self.footerPositionGroupBox, 1, 1, 1, 1) + 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.previewPage.setObjectName(u'PreviewPage') self.previewLayout = QtGui.QVBoxLayout(self.previewPage) - self.previewLayout.setSpacing(6) - self.previewLayout.setMargin(12) - self.previewLayout.setObjectName(u'previewLayout') - self.themeNameLayout = QtGui.QHBoxLayout() - self.themeNameLayout.setObjectName(u'themeNameLayout') + 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.themeNameLayout.addWidget(self.themeNameLabel) + self.themeNameLabel.setObjectName(u'ThemeNameLabel') self.themeNameEdit = QtGui.QLineEdit(self.previewPage) - self.themeNameEdit.setObjectName(u'themeNameEdit') - self.themeNameLayout.addWidget(self.themeNameEdit) + self.themeNameEdit.setObjectName(u'ThemeNameEdit') + self.themeNameLayout.addRow(self.themeNameLabel, self.themeNameEdit) self.previewLayout.addLayout(self.themeNameLayout) self.previewPaneLayout = QtGui.QHBoxLayout() - self.previewPaneLayout.setObjectName(u'previewPaneLayout') - self.previewLeftSpacer = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.previewPaneLayout.addItem(self.previewLeftSpacer) + self.previewPaneLayout.setObjectName(u'PreviewPaneLayout') + self.previewPaneLayout.addStretch() self.previewBoxLabel = QtGui.QLabel(self.previewPage) sizePolicy = QtGui.QSizePolicy( QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.previewBoxLabel.sizePolicy().hasHeightForWidth()) self.previewBoxLabel.setSizePolicy(sizePolicy) self.previewBoxLabel.setMinimumSize(QtCore.QSize(100, 150)) self.previewBoxLabel.setFrameShape(QtGui.QFrame.WinPanel) self.previewBoxLabel.setFrameShadow(QtGui.QFrame.Sunken) self.previewBoxLabel.setLineWidth(1) self.previewBoxLabel.setScaledContents(True) - self.previewBoxLabel.setObjectName(u'previewBoxLabel') + self.previewBoxLabel.setObjectName(u'PreviewBoxLabel') self.previewPaneLayout.addWidget(self.previewBoxLabel) - self.previewRightSpacer = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.previewPaneLayout.addItem(self.previewRightSpacer) + self.previewPaneLayout.addStretch() self.previewLayout.addLayout(self.previewPaneLayout) ThemeWizard.addPage(self.previewPage) - self.themeNameLabel.setBuddy(self.themeNameEdit) self.retranslateUi(ThemeWizard) - QtCore.QObject.connect( - ThemeWizard, - QtCore.SIGNAL(u'accepted()'), - ThemeWizard.accept) + + 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)')) QtCore.QMetaObject.connectSlotsByName(ThemeWizard) def retranslateUi(self, ThemeWizard): @@ -480,13 +436,13 @@ class Ui_ThemeWizard(object): self.backgroundPage.setSubTitle( translate('OpenLP.ThemeWizard', 'Set up your theme\'s background ' 'according to the parameters below.')) - self.backgroundTypeLabel.setText( + self.backgroundLabel.setText( translate('OpenLP.ThemeWizard', 'Background type:')) - self.backgroundTypeComboBox.setItemText(0, + self.backgroundComboBox.setItemText(0, translate('OpenLP.ThemeWizard', 'Solid Color')) - self.backgroundTypeComboBox.setItemText(1, + self.backgroundComboBox.setItemText(1, translate('OpenLP.ThemeWizard', 'Gradient')) - self.backgroundTypeComboBox.setItemText(2, + self.backgroundComboBox.setItemText(2, translate('OpenLP.ThemeWizard', 'Image')) self.colorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.gradientStartLabel.setText( @@ -528,9 +484,9 @@ class Ui_ThemeWizard(object): self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) - self.boldCheckBox.setText( + self.mainBoldCheckBox.setText( translate('OpenLP.ThemeWizard', 'Bold')) - self.italicsCheckBox.setText( + self.mainItalicsCheckBox.setText( translate('OpenLP.ThemeWizard', 'Italic')) self.footerAreaPage.setTitle( translate('OpenLP.ThemeWizard', 'Footer Area Font Details')) @@ -571,7 +527,7 @@ class Ui_ThemeWizard(object): ' main and footer areas.')) self.mainPositionGroupBox.setTitle( translate('OpenLP.ThemeWizard', '&Main Area')) - self.mainDefaultPositionCheckBox.setText( + self.mainPositionCheckBox.setText( translate('OpenLP.ThemeWizard', '&Use default location')) self.mainXLabel.setText(translate('OpenLP.ThemeWizard', 'X position:')) self.mainXSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'px')) @@ -598,7 +554,7 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Height:')) self.footerHeightSpinBox.setSuffix( translate('OpenLP.ThemeWizard', 'px')) - self.footerDefaultPositionCheckBox.setText( + self.footerPositionCheckBox.setText( translate('OpenLP.ThemeWizard', 'Use default location')) self.previewPage.setTitle( translate('OpenLP.ThemeWizard', 'Save and Preview')) @@ -608,3 +564,18 @@ class Ui_ThemeWizard(object): 'new theme')) self.themeNameLabel.setText( translate('OpenLP.ThemeWizard', 'Theme name:')) + # Align all QFormLayouts towards each other + width = max(self.backgroundLabel.minimumSizeHint().width(), + self.colorLabel.minimumSizeHint().width()) + width = max(width, self.gradientStartLabel.minimumSizeHint().width()) + width = max(width, self.gradientEndLabel.minimumSizeHint().width()) + width = max(width, self.gradientTypeLabel.minimumSizeHint().width()) + width = max(width, self.imageLabel.minimumSizeHint().width()) + self.backgroundTypeSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.colorSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.gradientSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.imageSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 82f549694..9aaf2c312 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -79,8 +79,12 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): QtGui.QWizard.__init__(self, parent) self.setupUi(self) self.registerFields() - self.hasOpenlp1Import = \ - BibleFormat.get_availability(BibleFormat.OpenLP1) + if BibleFormat.get_availability(BibleFormat.OpenLP1): + self.openlp1DisabledLabel.hide() + else: + self.openlp1FileLabel.hide() + self.openlp1FileEdit.hide() + self.openlp1BrowseButton.hide() self.finishButton = self.button(QtGui.QWizard.FinishButton) self.cancelButton = self.button(QtGui.QWizard.CancelButton) self.manager = manager @@ -88,27 +92,26 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.manager.set_process_dialog(self) self.web_bible_list = {} self.loadWebBibles() - QtCore.QObject.connect(self.formatComboBox, - QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.onFormatComboBoxChanged) + self.restart() + self.selectStack.setCurrentIndex(0) QtCore.QObject.connect(self.webSourceComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.onWebSourceComboBoxChanged) - QtCore.QObject.connect(self.osisFileButton, + QtCore.QObject.connect(self.osisBrowseButton, QtCore.SIGNAL(u'clicked()'), - self.onOsisFileButtonClicked) + self.onOsisBrowseButtonClicked) QtCore.QObject.connect(self.csvBooksButton, QtCore.SIGNAL(u'clicked()'), - self.onBooksFileButtonClicked) + self.onBooksBrowseButtonClicked) QtCore.QObject.connect(self.csvVersesButton, QtCore.SIGNAL(u'clicked()'), - self.onCsvVersesFileButtonClicked) - QtCore.QObject.connect(self.openSongFileButton, + self.onCsvVersesBrowseButtonClicked) + QtCore.QObject.connect(self.openSongBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onOpenSongBrowseButtonClicked) - QtCore.QObject.connect(self.openlp1FileButton, + QtCore.QObject.connect(self.openlp1BrowseButton, QtCore.SIGNAL(u'clicked()'), - self.onOpenlp1FileButtonClicked) + self.onOpenlp1BrowseButtonClicked) QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), self.onCurrentIdChanged) @@ -125,7 +128,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): Stop the import on cancel button, close button or ESC key. """ log.debug('Import canceled by user.') - if self.currentId() == 3: + if self.currentPage() == self.importPage: Receiver.send_message(u'bibles_stop_import') self.done(QtGui.QDialog.Rejected) @@ -133,11 +136,9 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): """ Validate the current page before moving on to the next page. """ - if self.currentId() == 0: - # Welcome page + if self.currentPage() == self.welcomePage: return True - elif self.currentId() == 1: - # Select page + elif self.currentPage() == self.selectPage: if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if not self.field(u'osis_location').toString(): QtGui.QMessageBox.critical(self, @@ -146,7 +147,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file to import your ' 'Bible from.')) - self.OSISLocationEdit.setFocus() + self.osisFileEdit.setFocus() return False elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: if not self.field(u'csv_booksfile').toString(): @@ -156,7 +157,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file with books of ' 'the Bible to use in the import.')) - self.booksLocationEdit.setFocus() + self.csvBooksEdit.setFocus() return False elif not self.field(u'csv_versefile').toString(): QtGui.QMessageBox.critical(self, @@ -165,7 +166,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file of Bible ' 'verses to import.')) - self.csvVerseLocationEdit.setFocus() + self.csvVersesEdit.setFocus() return False elif self.field(u'source_format').toInt()[0] == \ BibleFormat.OpenSong: @@ -186,11 +187,10 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): translate('BiblesPlugin.ImportWizardForm', 'You need to specify a file to import your ' 'Bible from.')) - self.openlp1LocationEdit.setFocus() + self.openlp1FileEdit.setFocus() return False return True - elif self.currentId() == 2: - # License details + elif self.currentPage() == self.licenseDetailsPage: license_version = unicode(self.field(u'license_version').toString()) license_copyright = \ unicode(self.field(u'license_copyright').toString()) @@ -220,31 +220,9 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.versionNameEdit.setFocus() return False return True - if self.currentId() == 3: - # Progress page + if self.currentPage() == self.importPage: return True - def onFormatComboBoxChanged(self, index): - """ - Set Widgets for the selected import format visible. - - ``index`` - The index of the combo box. - """ - self.osisFileLabel.setVisible(index == 0) - self.osisFileWidget.setVisible(index == 0) - self.csvBooksLabel.setVisible(index == 1) - self.csvBooksWidget.setVisible(index == 1) - self.csvVersesLabel.setVisible(index == 1) - self.csvVersesWidget.setVisible(index == 1) - self.openSongFileLabel.setVisible(index == 2) - self.openSongFileWidget.setVisible(index == 2) - self.webTabWidget.setVisible(index == 3) - self.openlp1FileLabel.setVisible(index == 4 and self.hasOpenlp1Import) - self.openlp1FileWidget.setVisible(index == 4 and self.hasOpenlp1Import) - self.openlp1DisabledLabel.setVisible(index == 4 and - not self.hasOpenlp1Import) - def onWebSourceComboBoxChanged(self, index): """ Setup the list of Bibles when you select a different source on the web @@ -256,10 +234,9 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.webTranslationComboBox.clear() bibles = self.web_bible_list[index].keys() bibles.sort() - for bible in bibles: - self.webTranslationComboBox.addItem(bible) + self.webTranslationComboBox.addItems(bibles) - def onOsisFileButtonClicked(self): + def onOsisBrowseButtonClicked(self): """ Show the file open dialog for the OSIS file. """ @@ -267,7 +244,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): translate('BiblesPlugin.ImportWizardForm', 'Open OSIS File'), self.osisFileEdit) - def onBooksFileButtonClicked(self): + def onBooksBrowseButtonClicked(self): """ Show the file open dialog for the books CSV file. """ @@ -276,7 +253,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.csvBooksEdit, u'%s (*.csv)' % translate('BiblesPlugin.ImportWizardForm', 'CSV File')) - def onCsvVersesFileButtonClicked(self): + def onCsvVersesBrowseButtonClicked(self): """ Show the file open dialog for the verses CSV file. """ @@ -292,7 +269,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): translate('BiblesPlugin.ImportWizardForm', 'Open OpenSong Bible'), self.openSongFileEdit) - def onOpenlp1FileButtonClicked(self): + def onOpenlp1BrowseButtonClicked(self): """ Show the file open dialog for the openlp.org 1.x file. """ @@ -303,7 +280,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): 'openlp.org 1.x bible')) def onCurrentIdChanged(self, pageId): - if pageId == 3: + if self.page(pageId) == self.importPage: self.preImport() self.performImport() self.postImport() @@ -510,7 +487,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): # Import a bible from the web. self.importProgressBar.setMaximum(1) download_location = self.field(u'web_location').toInt()[0] - bible_version = unicode(self.bibleComboBox.currentText()) + bible_version = unicode(self.webTranslationComboBox.currentText()) if download_location == WebDownload.Crosswalk: bible = \ self.web_bible_list[WebDownload.Crosswalk][bible_version] diff --git a/openlp/plugins/bibles/forms/bibleimportwizard.py b/openlp/plugins/bibles/forms/bibleimportwizard.py index 647754674..1cb5109b6 100644 --- a/openlp/plugins/bibles/forms/bibleimportwizard.py +++ b/openlp/plugins/bibles/forms/bibleimportwizard.py @@ -43,36 +43,26 @@ class Ui_BibleImportWizard(object): QtGui.QPixmap(u':/wizards/wizard_importbible.bmp')) self.welcomePage.setObjectName(u'WelcomePage') self.welcomeLayout = QtGui.QVBoxLayout(self.welcomePage) - self.welcomeLayout.setMargin(12) - self.welcomeLayout.setSpacing(6) self.welcomeLayout.setObjectName(u'WelcomeLayout') self.titleLabel = QtGui.QLabel(self.welcomePage) self.titleLabel.setObjectName(u'TitleLabel') self.welcomeLayout.addWidget(self.titleLabel) - self.welcomeTopSpacer = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - self.welcomeLayout.addItem(self.welcomeTopSpacer) + self.welcomeLayout.addSpacing(40) self.informationLabel = QtGui.QLabel(self.welcomePage) self.informationLabel.setWordWrap(True) self.informationLabel.setObjectName(u'InformationLabel') self.welcomeLayout.addWidget(self.informationLabel) - self.welcomeBottomSpacer = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.welcomeLayout.addItem(self.welcomeBottomSpacer) + self.welcomeLayout.addStretch() bibleImportWizard.addPage(self.welcomePage) # Select page self.selectPage = QtGui.QWizardPage() self.selectPage.setObjectName(u'SelectPage') self.selectPageLayout = QtGui.QVBoxLayout(self.selectPage) - self.selectPageLayout.setMargin(12) - self.selectPageLayout.setObjectName(u'SelectPageLayout') - self.selectFormLayout = QtGui.QFormLayout() - self.selectFormLayout.setVerticalSpacing(6) - self.selectFormLayout.setObjectName(u'SelectFormLayout') + self.selectPageLayout.setObjectName(u'SelectFormLayout') + self.formatLayout = QtGui.QFormLayout() + self.formatLayout.setObjectName(u'FormatLayout') self.formatLabel = QtGui.QLabel(self.selectPage) self.formatLabel.setObjectName(u'FormatLabel') - self.selectFormLayout.setWidget(0, QtGui.QFormLayout.LabelRole, - self.formatLabel) self.formatComboBox = QtGui.QComboBox(self.selectPage) self.formatComboBox.addItem(u'') self.formatComboBox.addItem(u'') @@ -80,122 +70,96 @@ class Ui_BibleImportWizard(object): self.formatComboBox.addItem(u'') self.formatComboBox.addItem(u'') self.formatComboBox.setObjectName(u'FormatComboBox') - self.selectFormLayout.setWidget(0, QtGui.QFormLayout.FieldRole, - self.formatComboBox) - self.osisFileLabel = QtGui.QLabel(self.selectPage) + self.formatLayout.addRow(self.formatLabel, self.formatComboBox) + self.formatSpacer = QtGui.QSpacerItem(10, 0, + QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) + self.formatLayout.setItem(1, QtGui.QFormLayout.LabelRole, + self.formatSpacer) + self.selectPageLayout.addLayout(self.formatLayout) + self.selectStack = QtGui.QStackedLayout() + self.osisWidget = QtGui.QWidget(self.selectPage) + self.osisWidget.setObjectName(u'OsisWidget') + self.osisLayout = QtGui.QFormLayout(self.osisWidget) + self.osisLayout.setMargin(0) + self.osisLayout.setObjectName(u'OsisLayout') + self.osisFileLabel = QtGui.QLabel(self.osisWidget) self.osisFileLabel.setObjectName(u'OsisFileLabel') - self.selectFormLayout.setWidget(1, QtGui.QFormLayout.LabelRole, - self.osisFileLabel) - self.osisFileWidget = QtGui.QWidget(self.selectPage) - self.osisFileWidget.setObjectName(u'OsisFileWidget') - self.osisFileLayout = QtGui.QHBoxLayout(self.osisFileWidget) - self.osisFileLayout.setMargin(0) + self.osisFileLayout = QtGui.QHBoxLayout() self.osisFileLayout.setObjectName(u'OsisFileLayout') - self.osisFileEdit = QtGui.QLineEdit(self.osisFileWidget) + self.osisFileEdit = QtGui.QLineEdit(self.osisWidget) self.osisFileEdit.setObjectName(u'OsisFileEdit') self.osisFileLayout.addWidget(self.osisFileEdit) - self.osisFileButton = QtGui.QToolButton(self.osisFileWidget) - self.osisFileButton.setIcon(build_icon(u':/general/general_open.png')) - self.osisFileButton.setObjectName(u'OsisFileButton') - self.osisFileLayout.addWidget(self.osisFileButton) - self.selectFormLayout.setWidget(1, QtGui.QFormLayout.FieldRole, - self.osisFileWidget) - self.csvBooksLabel = QtGui.QLabel(self.selectPage) - self.csvBooksLabel.setVisible(False) + self.osisBrowseButton = QtGui.QToolButton(self.osisWidget) + self.osisBrowseButton.setIcon(build_icon(u':/general/general_open.png')) + self.osisBrowseButton.setObjectName(u'OsisBrowseButton') + self.osisFileLayout.addWidget(self.osisBrowseButton) + self.osisLayout.addRow(self.osisFileLabel, self.osisFileLayout) + self.osisSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.osisLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.osisSpacer) + self.selectStack.addWidget(self.osisWidget) + self.csvWidget = QtGui.QWidget(self.selectPage) + self.csvWidget.setObjectName(u'CsvWidget') + self.csvLayout = QtGui.QFormLayout(self.csvWidget) + self.csvLayout.setMargin(0) + self.csvLayout.setObjectName(u'CsvLayout') + self.csvBooksLabel = QtGui.QLabel(self.csvWidget) self.csvBooksLabel.setObjectName(u'CsvBooksLabel') - self.selectFormLayout.setWidget(2, QtGui.QFormLayout.LabelRole, - self.csvBooksLabel) - self.csvBooksWidget = QtGui.QWidget(self.selectPage) - self.csvBooksWidget.setVisible(False) - self.csvBooksWidget.setObjectName(u'CsvBooksWidget') - self.csvBooksLayout = QtGui.QHBoxLayout(self.csvBooksWidget) - self.csvBooksLayout.setMargin(0) + self.csvBooksLayout = QtGui.QHBoxLayout() self.csvBooksLayout.setObjectName(u'CsvBooksLayout') - self.csvBooksEdit = QtGui.QLineEdit(self.csvBooksWidget) + self.csvBooksEdit = QtGui.QLineEdit(self.csvWidget) self.csvBooksEdit.setObjectName(u'CsvBooksEdit') self.csvBooksLayout.addWidget(self.csvBooksEdit) - self.csvBooksButton = QtGui.QToolButton(self.csvBooksWidget) + self.csvBooksButton = QtGui.QToolButton(self.csvWidget) self.csvBooksButton.setIcon(build_icon(u':/general/general_open.png')) self.csvBooksButton.setObjectName(u'CsvBooksButton') self.csvBooksLayout.addWidget(self.csvBooksButton) - self.selectFormLayout.setWidget(2, QtGui.QFormLayout.FieldRole, - self.csvBooksWidget) - self.csvVersesLabel = QtGui.QLabel(self.selectPage) - self.csvVersesLabel.setVisible(False) + self.csvLayout.addRow(self.csvBooksLabel, self.csvBooksLayout) + self.csvVersesLabel = QtGui.QLabel(self.csvWidget) self.csvVersesLabel.setObjectName(u'CsvVersesLabel') - self.selectFormLayout.setWidget(3, QtGui.QFormLayout.LabelRole, - self.csvVersesLabel) - self.csvVersesWidget = QtGui.QWidget(self.selectPage) - self.csvVersesWidget.setVisible(False) - self.csvVersesWidget.setObjectName(u'CsvVersesWidget') - self.csvVersesLayout = QtGui.QHBoxLayout(self.csvVersesWidget) - self.csvVersesLayout.setMargin(0) + self.csvVersesLayout = QtGui.QHBoxLayout() self.csvVersesLayout.setObjectName(u'CsvVersesLayout') - self.csvVersesEdit = QtGui.QLineEdit(self.csvVersesWidget) + self.csvVersesEdit = QtGui.QLineEdit(self.csvWidget) self.csvVersesEdit.setObjectName(u'CsvVersesEdit') self.csvVersesLayout.addWidget(self.csvVersesEdit) - self.csvVersesButton = QtGui.QToolButton(self.csvVersesWidget) + self.csvVersesButton = QtGui.QToolButton(self.csvWidget) self.csvVersesButton.setIcon(build_icon(u':/general/general_open.png')) self.csvVersesButton.setObjectName(u'CsvVersesButton') self.csvVersesLayout.addWidget(self.csvVersesButton) - self.selectFormLayout.setWidget(3, QtGui.QFormLayout.FieldRole, - self.csvVersesWidget) - self.openSongFileLabel = QtGui.QLabel(self.selectPage) - self.openSongFileLabel.setVisible(False) + self.csvLayout.addRow(self.csvVersesLabel, self.csvVersesLayout) + self.csvSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.csvLayout.setItem(2, QtGui.QFormLayout.LabelRole, self.csvSpacer) + self.selectStack.addWidget(self.csvWidget) + self.openSongWidget = QtGui.QWidget(self.selectPage) + self.openSongWidget.setObjectName(u'OpenSongWidget') + self.openSongLayout = QtGui.QFormLayout(self.openSongWidget) + self.openSongLayout.setMargin(0) + self.openSongLayout.setObjectName(u'OpenSongLayout') + self.openSongFileLabel = QtGui.QLabel(self.openSongWidget) self.openSongFileLabel.setObjectName(u'OpenSongFileLabel') - self.selectFormLayout.setWidget(4, QtGui.QFormLayout.LabelRole, - self.openSongFileLabel) - self.openSongFileWidget = QtGui.QWidget(self.selectPage) - self.openSongFileWidget.setVisible(False) - self.openSongFileWidget.setObjectName(u'OpenSongFileWidget') - self.openSongFileLayout = QtGui.QHBoxLayout(self.openSongFileWidget) - self.openSongFileLayout.setMargin(0) + self.openSongFileLayout = QtGui.QHBoxLayout() self.openSongFileLayout.setObjectName(u'OpenSongFileLayout') - self.openSongFileEdit = QtGui.QLineEdit(self.openSongFileWidget) + self.openSongFileEdit = QtGui.QLineEdit(self.openSongWidget) self.openSongFileEdit.setObjectName(u'OpenSongFileEdit') self.openSongFileLayout.addWidget(self.openSongFileEdit) - self.openSongFileButton = QtGui.QToolButton(self.openSongFileWidget) - self.openSongFileButton.setIcon( + self.openSongBrowseButton = QtGui.QToolButton(self.openSongWidget) + self.openSongBrowseButton.setIcon( build_icon(u':/general/general_open.png')) - self.openSongFileButton.setObjectName(u'OpenSongFileButton') - self.openSongFileLayout.addWidget(self.openSongFileButton) - self.selectFormLayout.setWidget(4, QtGui.QFormLayout.FieldRole, - self.openSongFileWidget) - self.openlp1FileLabel = QtGui.QLabel(self.selectPage) - self.openlp1FileLabel.setVisible(False) - self.openlp1FileLabel.setObjectName(u'Openlp1FileLabel') - self.selectFormLayout.setWidget(5, QtGui.QFormLayout.LabelRole, - self.openlp1FileLabel) - self.openlp1FileWidget = QtGui.QWidget(self.selectPage) - self.openlp1FileWidget.setVisible(False) - self.openlp1FileWidget.setObjectName(u'Openlp1FileWidget') - self.openlp1FileLayout = QtGui.QHBoxLayout(self.openlp1FileWidget) - self.openlp1FileLayout.setMargin(0) - self.openlp1FileLayout.setObjectName(u'Openlp1FileLayout') - self.openlp1FileEdit = QtGui.QLineEdit(self.openlp1FileWidget) - self.openlp1FileEdit.setObjectName(u'Openlp1FileEdit') - self.openlp1FileLayout.addWidget(self.openlp1FileEdit) - self.openlp1FileButton = QtGui.QToolButton(self.openlp1FileWidget) - self.openlp1FileButton.setIcon( - build_icon(u':/general/general_open.png')) - self.openlp1FileButton.setObjectName(u'Openlp1FileButton') - self.openlp1FileLayout.addWidget(self.openlp1FileButton) - self.selectFormLayout.setWidget(5, QtGui.QFormLayout.FieldRole, - self.openlp1FileWidget) - self.selectPageLayout.addItem(self.selectFormLayout) - self.openlp1DisabledLabel = QtGui.QLabel(self.selectPage) - self.openlp1DisabledLabel.setVisible(False) - self.openlp1DisabledLabel.setObjectName(u'Openlp1DisabledLabel') - self.selectPageLayout.addWidget(self.openlp1DisabledLabel) + self.openSongBrowseButton.setObjectName(u'OpenSongBrowseButton') + self.openSongFileLayout.addWidget(self.openSongBrowseButton) + self.openSongLayout.addRow(self.openSongFileLabel, + self.openSongFileLayout) + self.openSongSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.openSongLayout.setItem(1, QtGui.QFormLayout.LabelRole, + self.openSongSpacer) + self.selectStack.addWidget(self.openSongWidget) self.webTabWidget = QtGui.QTabWidget(self.selectPage) - self.webTabWidget.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, - QtGui.QSizePolicy.MinimumExpanding) - self.webTabWidget.setVisible(False) self.webTabWidget.setObjectName(u'WebTabWidget') self.webBibleTab = QtGui.QWidget() self.webBibleTab.setObjectName(u'WebBibleTab') self.webBibleLayout = QtGui.QFormLayout(self.webBibleTab) - self.webBibleLayout.setVerticalSpacing(6) self.webBibleLayout.setObjectName(u'WebBibleLayout') self.webSourceLabel = QtGui.QLabel(self.webBibleTab) self.webSourceLabel.setObjectName(u'WebSourceLabel') @@ -213,17 +177,15 @@ class Ui_BibleImportWizard(object): self.webBibleLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.webTranslationLabel) self.webTranslationComboBox = QtGui.QComboBox(self.webBibleTab) + self.webTranslationComboBox.setSizeAdjustPolicy( + QtGui.QComboBox.AdjustToContents) self.webTranslationComboBox.setObjectName(u'WebTranslationComboBox') - self.webTranslationComboBox.addItem(u'') - self.webTranslationComboBox.addItem(u'') - self.webTranslationComboBox.addItem(u'') self.webBibleLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.webTranslationComboBox) self.webTabWidget.addTab(self.webBibleTab, u'') self.webProxyTab = QtGui.QWidget() self.webProxyTab.setObjectName(u'WebProxyTab') self.webProxyLayout = QtGui.QFormLayout(self.webProxyTab) - self.webProxyLayout.setVerticalSpacing(6) self.webProxyLayout.setObjectName(u'WebProxyLayout') self.webServerLabel = QtGui.QLabel(self.webProxyTab) self.webServerLabel.setObjectName(u'WebServerLabel') @@ -250,14 +212,40 @@ class Ui_BibleImportWizard(object): self.webProxyLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.webPasswordEdit) self.webTabWidget.addTab(self.webProxyTab, u'') - self.selectPageLayout.addWidget(self.webTabWidget) + self.selectStack.addWidget(self.webTabWidget) + self.openlp1Widget = QtGui.QWidget(self.selectPage) + self.openlp1Widget.setObjectName(u'Openlp1Widget') + self.openlp1Layout = QtGui.QFormLayout(self.openlp1Widget) + self.openlp1Layout.setMargin(0) + self.openlp1Layout.setObjectName(u'Openlp1Layout') + self.openlp1FileLabel = QtGui.QLabel(self.openlp1Widget) + self.openlp1FileLabel.setObjectName(u'Openlp1FileLabel') + self.openlp1FileLayout = QtGui.QHBoxLayout() + self.openlp1FileLayout.setObjectName(u'Openlp1FileLayout') + self.openlp1FileEdit = QtGui.QLineEdit(self.openlp1Widget) + self.openlp1FileEdit.setObjectName(u'Openlp1FileEdit') + self.openlp1FileLayout.addWidget(self.openlp1FileEdit) + self.openlp1BrowseButton = QtGui.QToolButton(self.openlp1Widget) + self.openlp1BrowseButton.setIcon( + build_icon(u':/general/general_open.png')) + self.openlp1BrowseButton.setObjectName(u'Openlp1BrowseButton') + self.openlp1FileLayout.addWidget(self.openlp1BrowseButton) + self.openlp1Layout.addRow(self.openlp1FileLabel, self.openlp1FileLayout) + self.openlp1DisabledLabel = QtGui.QLabel(self.openlp1Widget) + self.openlp1DisabledLabel.setWordWrap(True) + self.openlp1DisabledLabel.setObjectName(u'Openlp1DisabledLabel') + self.openlp1Layout.addRow(self.openlp1DisabledLabel) + self.openlp1Spacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.openlp1Layout.setItem(1, QtGui.QFormLayout.LabelRole, + self.openlp1Spacer) + self.selectStack.addWidget(self.openlp1Widget) + self.selectPageLayout.addLayout(self.selectStack) bibleImportWizard.addPage(self.selectPage) # License page self.licenseDetailsPage = QtGui.QWizardPage() self.licenseDetailsPage.setObjectName(u'LicenseDetailsPage') self.licenseDetailsLayout = QtGui.QFormLayout(self.licenseDetailsPage) - self.licenseDetailsLayout.setMargin(12) - self.licenseDetailsLayout.setVerticalSpacing(6) self.licenseDetailsLayout.setObjectName(u'LicenseDetailsLayout') self.versionNameLabel = QtGui.QLabel(self.licenseDetailsPage) self.versionNameLabel.setObjectName(u'VersionNameLabel') @@ -288,7 +276,6 @@ class Ui_BibleImportWizard(object): self.importPage = QtGui.QWizardPage() self.importPage.setObjectName(u'ImportPage') self.importLayout = QtGui.QVBoxLayout(self.importPage) - self.importLayout.setSpacing(6) self.importLayout.setMargin(48) self.importLayout.setObjectName(u'ImportLayout') self.importProgressLabel = QtGui.QLabel(self.importPage) @@ -299,7 +286,10 @@ class Ui_BibleImportWizard(object): self.importLayout.addWidget(self.importProgressBar) bibleImportWizard.addPage(self.importPage) self.retranslateUi(bibleImportWizard) - self.webTabWidget.setCurrentIndex(0) + QtCore.QMetaObject.connectSlotsByName(bibleImportWizard) + QtCore.QObject.connect(self.formatComboBox, + QtCore.SIGNAL(u'currentIndexChanged(int)'), self.selectStack, + QtCore.SLOT(u'setCurrentIndex(int)')) def retranslateUi(self, bibleImportWizard): bibleImportWizard.setWindowTitle( @@ -387,3 +377,20 @@ class Ui_BibleImportWizard(object): 'importer has been disabled due to a missing Python module. If ' 'you want to use this importer, you will need to install the ' '"python-sqlite" module.')) + # Align all QFormLayouts towards each other + width = max(self.formatLabel.minimumSizeHint().width(), + self.osisFileLabel.minimumSizeHint().width()) + width = max(width, self.csvBooksLabel.minimumSizeHint().width()) + width = max(width, self.csvVersesLabel.minimumSizeHint().width()) + width = max(width, self.openSongFileLabel.minimumSizeHint().width()) + width = max(width, self.openlp1FileLabel.minimumSizeHint().width()) + self.formatSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.osisSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.csvSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.openSongSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.openlp1Spacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index d02ff2a70..62571642e 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -72,7 +72,7 @@ class CSVBible(BibleDB): self.create_book(unicode(line[1], details['encoding']), line[2], int(line[0])) Receiver.send_message(u'openlp_process_events') - except IOError: + except IOError, IndexError: log.exception(u'Loading books from file failed') success = False finally: diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 14454a69f..98b3b6a85 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -88,7 +88,7 @@ class OpenSongBible(BibleDB): translate('BiblesPlugin.Opensong', 'Importing'), db_book.name, chapter.attrib[u'n'])) self.session.commit() - except IOError: + except IOError, AttributeError: log.exception(u'Loading bible from OpenSong file failed') success = False finally: From 914827c023ca4671bca2fca3b8441585b2097c4b Mon Sep 17 00:00:00 2001 From: M2j Date: Mon, 27 Dec 2010 19:23:46 +0100 Subject: [PATCH 04/13] same as before for SongImportWidget (removing unneccesary format instructions and FormLayout alignment) --- openlp/core/ui/themewizard.py | 16 +-- .../plugins/bibles/forms/bibleimportwizard.py | 27 ++--- openlp/plugins/songs/forms/songimportform.py | 15 +-- .../plugins/songs/forms/songimportwizard.py | 112 ++++++++---------- 4 files changed, 74 insertions(+), 96 deletions(-) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 8b89f802c..da25b0f37 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -36,7 +36,7 @@ class Ui_ThemeWizard(object): ThemeWizard.setOptions( QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage) - # welcome page + # Welcome Page self.welcomePage = QtGui.QWizardPage() self.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap, QtGui.QPixmap(u':/wizards/wizard_createtheme.bmp')) @@ -53,7 +53,7 @@ class Ui_ThemeWizard(object): self.welcomeLayout.addWidget(self.informationLabel) self.welcomeLayout.addStretch() ThemeWizard.addPage(self.welcomePage) - # background page + # Background Page self.backgroundPage = QtGui.QWizardPage() self.backgroundPage.setObjectName(u'BackgroundPage') self.backgroundLayout = QtGui.QVBoxLayout(self.backgroundPage) @@ -143,7 +143,7 @@ class Ui_ThemeWizard(object): self.backgroundStack.addWidget(self.imageWidget) self.backgroundLayout.addLayout(self.backgroundStack) ThemeWizard.addPage(self.backgroundPage) - # main area page + # Main Area Page self.mainAreaPage = QtGui.QWizardPage() self.mainAreaPage.setObjectName(u'MainAreaPage') self.mainAreaLayout = QtGui.QFormLayout(self.mainAreaPage) @@ -226,7 +226,7 @@ class Ui_ThemeWizard(object): self.shadowLayout.addWidget(self.shadowSizeSpinBox) self.mainAreaLayout.addRow(self.shadowCheckBox, self.shadowLayout) ThemeWizard.addPage(self.mainAreaPage) - # footer area page + # Footer Area Page self.footerAreaPage = QtGui.QWizardPage() self.footerAreaPage.setObjectName(u'FooterAreaPage') self.footerAreaLayout = QtGui.QFormLayout(self.footerAreaPage) @@ -251,7 +251,7 @@ class Ui_ThemeWizard(object): self.footerSizeSpinBox.setObjectName(u'FooterSizeSpinBox') self.footerAreaLayout.addRow(self.footerSizeLabel, self.footerSizeSpinBox) ThemeWizard.addPage(self.footerAreaPage) - # alignment page + # Alignment Page self.alignmentPage = QtGui.QWizardPage() self.alignmentPage.setObjectName(u'AlignmentPage') self.alignmentLayout = QtGui.QFormLayout(self.alignmentPage) @@ -273,7 +273,7 @@ class Ui_ThemeWizard(object): self.transitionsCheckBox.setObjectName(u'TransitionsCheckBox') self.alignmentLayout.addRow(self.transitionsCheckBox) ThemeWizard.addPage(self.alignmentPage) - # area position page + # Area Position Page self.areaPositionPage = QtGui.QWizardPage() self.areaPositionPage.setObjectName(u'AreaPositionPage') self.areaPositionLayout = QtGui.QHBoxLayout(self.areaPositionPage) @@ -347,7 +347,7 @@ class Ui_ThemeWizard(object): self.footerHeightSpinBox) self.areaPositionLayout.addWidget(self.footerPositionGroupBox) ThemeWizard.addPage(self.areaPositionPage) - # preview page + # Preview Page self.previewPage = QtGui.QWizardPage() self.previewPage.setObjectName(u'PreviewPage') self.previewLayout = QtGui.QVBoxLayout(self.previewPage) @@ -564,7 +564,7 @@ class Ui_ThemeWizard(object): 'new theme')) self.themeNameLabel.setText( translate('OpenLP.ThemeWizard', 'Theme name:')) - # Align all QFormLayouts towards each other + # Align all QFormLayouts towards each other. width = max(self.backgroundLabel.minimumSizeHint().width(), self.colorLabel.minimumSizeHint().width()) width = max(width, self.gradientStartLabel.minimumSizeHint().width()) diff --git a/openlp/plugins/bibles/forms/bibleimportwizard.py b/openlp/plugins/bibles/forms/bibleimportwizard.py index af6bae842..a8d324cf1 100644 --- a/openlp/plugins/bibles/forms/bibleimportwizard.py +++ b/openlp/plugins/bibles/forms/bibleimportwizard.py @@ -37,7 +37,7 @@ class Ui_BibleImportWizard(object): QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage | QtGui.QWizard.NoBackButtonOnLastPage) - # Welcome page + # Welcome Page self.welcomePage = QtGui.QWizardPage() self.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap, QtGui.QPixmap(u':/wizards/wizard_importbible.bmp')) @@ -54,29 +54,26 @@ class Ui_BibleImportWizard(object): self.welcomeLayout.addWidget(self.informationLabel) self.welcomeLayout.addStretch() bibleImportWizard.addPage(self.welcomePage) - # Select page + # Select Page self.selectPage = QtGui.QWizardPage() self.selectPage.setObjectName(u'SelectPage') self.selectPageLayout = QtGui.QVBoxLayout(self.selectPage) - self.selectPageLayout.setObjectName(u'SelectFormLayout') + self.selectPageLayout.setObjectName(u'SelectPageLayout') self.formatLayout = QtGui.QFormLayout() self.formatLayout.setObjectName(u'FormatLayout') self.formatLabel = QtGui.QLabel(self.selectPage) self.formatLabel.setObjectName(u'FormatLabel') self.formatComboBox = QtGui.QComboBox(self.selectPage) - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') - self.formatComboBox.addItem(u'') + self.formatComboBox.addItems([u'', u'', u'', u'', u'']) self.formatComboBox.setObjectName(u'FormatComboBox') self.formatLayout.addRow(self.formatLabel, self.formatComboBox) - self.formatSpacer = QtGui.QSpacerItem(10, 0, - QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) + self.formatSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) self.formatLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.formatSpacer) self.selectPageLayout.addLayout(self.formatLayout) self.selectStack = QtGui.QStackedLayout() + self.selectStack.setObjectName(u'SelectStack') self.osisWidget = QtGui.QWidget(self.selectPage) self.osisWidget.setObjectName(u'OsisWidget') self.osisLayout = QtGui.QFormLayout(self.osisWidget) @@ -167,9 +164,7 @@ class Ui_BibleImportWizard(object): self.webSourceLabel) self.webSourceComboBox = QtGui.QComboBox(self.webBibleTab) self.webSourceComboBox.setObjectName(u'WebSourceComboBox') - self.webSourceComboBox.addItem(u'') - self.webSourceComboBox.addItem(u'') - self.webSourceComboBox.addItem(u'') + self.webSourceComboBox.addItems([u'', u'', u'']) self.webBibleLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.webSourceComboBox) self.webTranslationLabel = QtGui.QLabel(self.webBibleTab) @@ -242,7 +237,7 @@ class Ui_BibleImportWizard(object): self.selectStack.addWidget(self.openlp1Widget) self.selectPageLayout.addLayout(self.selectStack) bibleImportWizard.addPage(self.selectPage) - # License page + # License Page self.licenseDetailsPage = QtGui.QWizardPage() self.licenseDetailsPage.setObjectName(u'LicenseDetailsPage') self.licenseDetailsLayout = QtGui.QFormLayout(self.licenseDetailsPage) @@ -272,7 +267,7 @@ class Ui_BibleImportWizard(object): self.licenseDetailsLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.permissionsEdit) bibleImportWizard.addPage(self.licenseDetailsPage) - # Progress page + # Progress Page self.importPage = QtGui.QWizardPage() self.importPage.setObjectName(u'ImportPage') self.importLayout = QtGui.QVBoxLayout(self.importPage) @@ -377,7 +372,7 @@ class Ui_BibleImportWizard(object): 'importer has been disabled due to a missing Python module. If ' 'you want to use this importer, you will need to install the ' '"python-sqlite" module.')) - # Align all QFormLayouts towards each other + # Align all QFormLayouts towards each other. width = max(self.formatLabel.minimumSizeHint().width(), self.osisFileLabel.minimumSizeHint().width()) width = max(width, self.csvBooksLabel.minimumSizeHint().width()) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index e49334b7a..ecb4fd3e1 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -134,7 +134,7 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): Stop the import on cancel button, close button or ESC key. """ log.debug('Import canceled by user.') - if self.currentId() == 2: + if self.currentPage() == self.importPage: Receiver.send_message(u'songs_stop_import') self.done(QtGui.QDialog.Rejected) @@ -142,11 +142,9 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): """ Validate the current page before moving on to the next page. """ - if self.currentId() == 0: - # Welcome page + if self.currentPage() == self.welcomePage: return True - elif self.currentId() == 1: - # Select page + elif self.currentId() == self.sourcePage: source_format = self.formatComboBox.currentIndex() if source_format == SongFormat.OpenLP2: if self.openLP2FilenameEdit.text().isEmpty(): @@ -250,8 +248,7 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): self.songBeamerAddButton.setFocus() return False return True - elif self.currentId() == 2: - # Progress page + elif self.currentPage() == self.importPage: return True def getFileName(self, title, editbox, filters=u''): @@ -423,7 +420,7 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): self.removeSelectedItems(self.songBeamerFileListWidget) def onCurrentIdChanged(self, id): - if id == 2: + if self.page(id) == self.importPage: self.preImport() self.performImport() self.postImport() @@ -540,4 +537,4 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): self.importProgressBar.setValue(self.importProgressBar.maximum()) self.finishButton.setVisible(True) self.cancelButton.setVisible(False) - Receiver.send_message(u'openlp_process_events') \ No newline at end of file + Receiver.send_message(u'openlp_process_events') diff --git a/openlp/plugins/songs/forms/songimportwizard.py b/openlp/plugins/songs/forms/songimportwizard.py index 809427037..85fbb07fe 100644 --- a/openlp/plugins/songs/forms/songimportwizard.py +++ b/openlp/plugins/songs/forms/songimportwizard.py @@ -33,68 +33,48 @@ class Ui_SongImportWizard(object): self.openIcon = build_icon(u':/general/general_open.png') self.deleteIcon = build_icon(u':/general/general_delete.png') songImportWizard.setObjectName(u'songImportWizard') - songImportWizard.resize(550, 386) songImportWizard.setModal(True) songImportWizard.setWizardStyle(QtGui.QWizard.ModernStyle) songImportWizard.setOptions( QtGui.QWizard.IndependentPages | QtGui.QWizard.NoBackButtonOnStartPage | QtGui.QWizard.NoBackButtonOnLastPage) + # Welcome Page self.welcomePage = QtGui.QWizardPage() - self.welcomePage.setObjectName(u'welcomePage') self.welcomePage.setPixmap(QtGui.QWizard.WatermarkPixmap, QtGui.QPixmap(u':/wizards/wizard_importsong.bmp')) - self.welcomeLayout = QtGui.QHBoxLayout(self.welcomePage) - self.welcomeLayout.setSpacing(8) - self.welcomeLayout.setMargin(0) - self.welcomeLayout.setObjectName(u'welcomeLayout') - self.welcomeTextLayout = QtGui.QVBoxLayout() - self.welcomeTextLayout.setSpacing(8) - self.welcomeTextLayout.setObjectName(u'welcomeTextLayout') + self.welcomePage.setObjectName(u'WelcomePage') + self.welcomeLayout = QtGui.QVBoxLayout(self.welcomePage) + self.welcomeLayout.setObjectName(u'WelcomeLayout') self.titleLabel = QtGui.QLabel(self.welcomePage) self.titleLabel.setObjectName(u'TitleLabel') - self.welcomeTextLayout.addWidget(self.titleLabel) - self.welcomeTopSpacer = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) - self.welcomeTextLayout.addItem(self.welcomeTopSpacer) + self.welcomeLayout.addWidget(self.titleLabel) + self.welcomeLayout.addSpacing(40) self.informationLabel = QtGui.QLabel(self.welcomePage) self.informationLabel.setWordWrap(True) - self.informationLabel.setMargin(10) self.informationLabel.setObjectName(u'InformationLabel') - self.welcomeTextLayout.addWidget(self.informationLabel) - self.welcomeBottomSpacer = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) - self.welcomeTextLayout.addItem(self.welcomeBottomSpacer) - self.welcomeLayout.addLayout(self.welcomeTextLayout) + self.welcomeLayout.addWidget(self.informationLabel) + self.welcomeLayout.addStretch() songImportWizard.addPage(self.welcomePage) + # Source Page self.sourcePage = QtGui.QWizardPage() self.sourcePage.setObjectName(u'SourcePage') self.sourceLayout = QtGui.QVBoxLayout(self.sourcePage) - self.sourceLayout.setSpacing(8) - self.sourceLayout.setMargin(20) self.sourceLayout.setObjectName(u'SourceLayout') - self.formatLayout = QtGui.QHBoxLayout() - self.formatLayout.setSpacing(8) + self.formatLayout = QtGui.QFormLayout() self.formatLayout.setObjectName(u'FormatLayout') self.formatLabel = QtGui.QLabel(self.sourcePage) self.formatLabel.setObjectName(u'FormatLabel') - self.formatLayout.addWidget(self.formatLabel) self.formatComboBox = QtGui.QComboBox(self.sourcePage) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, - QtGui.QSizePolicy.Fixed) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth( - self.formatComboBox.sizePolicy().hasHeightForWidth()) - self.formatComboBox.setSizePolicy(sizePolicy) - self.formatComboBox.setObjectName(u'formatComboBox') - self.formatLayout.addWidget(self.formatComboBox) - self.formatSpacer = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - self.formatLayout.addItem(self.formatSpacer) + self.formatComboBox.setObjectName(u'FormatComboBox') + self.formatLayout.addRow(self.formatLabel, self.formatComboBox) + self.formatSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + self.formatLayout.setItem(1, QtGui.QFormLayout.LabelRole, + self.formatSpacer) self.sourceLayout.addLayout(self.formatLayout) - self.formatStackedWidget = QtGui.QStackedWidget(self.sourcePage) - self.formatStackedWidget.setObjectName(u'FormatStackedWidget') + self.formatStack = QtGui.QStackedLayout() + self.formatStack.setObjectName(u'FormatStack') # OpenLP 2.0 self.addSingleFileSelectItem(u'openLP2') # openlp.org 1.x @@ -120,28 +100,26 @@ class Ui_SongImportWizard(object): self.addMultiFileSelectItem(u'songBeamer') # Commented out for future use. # self.addSingleFileSelectItem(u'csv', u'CSV') - self.sourceLayout.addWidget(self.formatStackedWidget) + self.sourceLayout.addLayout(self.formatStack) songImportWizard.addPage(self.sourcePage) + # Import Page self.importPage = QtGui.QWizardPage() - self.importPage.setObjectName(u'importPage') + self.importPage.setObjectName(u'ImportPage') self.importLayout = QtGui.QVBoxLayout(self.importPage) - self.importLayout.setSpacing(8) - self.importLayout.setMargin(50) - self.importLayout.setObjectName(u'importLayout') + self.importLayout.setMargin(48) + self.importLayout.setObjectName(u'ImportLayout') self.importProgressLabel = QtGui.QLabel(self.importPage) - self.importProgressLabel.setObjectName(u'importProgressLabel') + self.importProgressLabel.setObjectName(u'ImportProgressLabel') self.importLayout.addWidget(self.importProgressLabel) self.importProgressBar = QtGui.QProgressBar(self.importPage) - self.importProgressBar.setProperty(u'value', 0) - self.importProgressBar.setInvertedAppearance(False) - self.importProgressBar.setObjectName(u'importProgressBar') + self.importProgressBar.setObjectName(u'ImportProgressBar') self.importLayout.addWidget(self.importProgressBar) songImportWizard.addPage(self.importPage) self.retranslateUi(songImportWizard) - self.formatStackedWidget.setCurrentIndex(0) + self.formatStack.setCurrentIndex(0) QtCore.QObject.connect(self.formatComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.formatStackedWidget.setCurrentIndex) + self.formatStack.setCurrentIndex) QtCore.QMetaObject.connectSlotsByName(songImportWizard) def retranslateUi(self, songImportWizard): @@ -257,6 +235,19 @@ class Ui_SongImportWizard(object): translate('SongsPlugin.ImportWizardForm', 'Ready.')) self.importProgressBar.setFormat( translate('SongsPlugin.ImportWizardForm', '%p%')) + # Align all QFormLayouts towards each other. + width = max(self.formatLabel.minimumSizeHint().width(), + self.openLP2FilenameLabel.minimumSizeHint().width()) + self.formatSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) + self.openLP2FormLabelSpacer.changeSize(width, 0, + QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + self.openLP1FormLabelSpacer.changeSize(width, 0, + QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) + self.ewFormLabelSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Fixed) +# self.csvFormLabelSpacer.changeSize(width, 0, QtGui.QSizePolicy.Fixed, +# QtGui.QSizePolicy.Fixed) def addSingleFileSelectItem(self, prefix, obj_prefix=None, can_disable=False): @@ -270,16 +261,13 @@ class Ui_SongImportWizard(object): importWidget = page importLayout = QtGui.QFormLayout(importWidget) importLayout.setMargin(0) - importLayout.setSpacing(8) if can_disable: importLayout.setObjectName(obj_prefix + u'ImportLayout') else: importLayout.setObjectName(obj_prefix + u'Layout') filenameLabel = QtGui.QLabel(importWidget) filenameLabel.setObjectName(obj_prefix + u'FilenameLabel') - importLayout.setWidget(0, QtGui.QFormLayout.LabelRole, filenameLabel) fileLayout = QtGui.QHBoxLayout() - fileLayout.setSpacing(8) fileLayout.setObjectName(obj_prefix + u'FileLayout') filenameEdit = QtGui.QLineEdit(importWidget) filenameEdit.setObjectName(obj_prefix + u'FilenameEdit') @@ -288,10 +276,14 @@ class Ui_SongImportWizard(object): browseButton.setIcon(self.openIcon) browseButton.setObjectName(obj_prefix + u'BrowseButton') fileLayout.addWidget(browseButton) - importLayout.setLayout(0, QtGui.QFormLayout.FieldRole, fileLayout) - self.formatStackedWidget.addWidget(page) + importLayout.addRow(filenameLabel, fileLayout) + formSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + QtGui.QSizePolicy.Minimum) + importLayout.setItem(1, QtGui.QFormLayout.LabelRole, formSpacer) + self.formatStack.addWidget(page) setattr(self, prefix + u'Page', page) setattr(self, prefix + u'FilenameLabel', filenameLabel) + setattr(self, prefix + u'FormLabelSpacer', formSpacer) setattr(self, prefix + u'FileLayout', fileLayout) setattr(self, prefix + u'FilenameEdit', filenameEdit) setattr(self, prefix + u'BrowseButton', browseButton) @@ -313,7 +305,6 @@ class Ui_SongImportWizard(object): importWidget = page importLayout = QtGui.QVBoxLayout(importWidget) importLayout.setMargin(0) - importLayout.setSpacing(8) if can_disable: importLayout.setObjectName(obj_prefix + u'ImportLayout') else: @@ -324,25 +315,21 @@ class Ui_SongImportWizard(object): fileListWidget.setObjectName(obj_prefix + u'FileListWidget') importLayout.addWidget(fileListWidget) buttonLayout = QtGui.QHBoxLayout() - buttonLayout.setSpacing(8) buttonLayout.setObjectName(obj_prefix + u'ButtonLayout') addButton = QtGui.QPushButton(importWidget) addButton.setIcon(self.openIcon) addButton.setObjectName(obj_prefix + u'AddButton') buttonLayout.addWidget(addButton) - buttonSpacer = QtGui.QSpacerItem(40, 20, - QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) - buttonLayout.addItem(buttonSpacer) + buttonLayout.addStretch() removeButton = QtGui.QPushButton(importWidget) removeButton.setIcon(self.deleteIcon) removeButton.setObjectName(obj_prefix + u'RemoveButton') buttonLayout.addWidget(removeButton) importLayout.addLayout(buttonLayout) - self.formatStackedWidget.addWidget(page) + self.formatStack.addWidget(page) setattr(self, prefix + u'Page', page) setattr(self, prefix + u'FileListWidget', fileListWidget) setattr(self, prefix + u'ButtonLayout', buttonLayout) - setattr(self, prefix + u'ButtonSpacer', buttonSpacer) setattr(self, prefix + u'AddButton', addButton) setattr(self, prefix + u'RemoveButton', removeButton) if can_disable: @@ -361,7 +348,6 @@ class Ui_SongImportWizard(object): disabledWidget.setObjectName(obj_prefix + u'DisabledWidget') disabledLayout = QtGui.QVBoxLayout(disabledWidget) disabledLayout.setMargin(0) - disabledLayout.setSpacing(8) disabledLayout.setObjectName(obj_prefix + u'DisabledLayout') disabledLabel = QtGui.QLabel(disabledWidget) disabledLabel.setWordWrap(True) @@ -376,4 +362,4 @@ class Ui_SongImportWizard(object): setattr(self, prefix + u'DisabledLayout', disabledLayout) setattr(self, prefix + u'DisabledLabel', disabledLabel) setattr(self, prefix + u'ImportWidget', importWidget) - return importWidget \ No newline at end of file + return importWidget From 9212399ad77971dd96ef7e5abced2e47c9dd04f0 Mon Sep 17 00:00:00 2001 From: M2j Date: Mon, 27 Dec 2010 22:53:02 +0100 Subject: [PATCH 05/13] renamed slots to common naming scheme renamed objects to conform British English (reverted some experimental edit of themewizard.ui) --- openlp/core/ui/themeform.py | 78 +- openlp/core/ui/themewizard.py | 5 +- .../plugins/bibles/forms/bibleimportform.py | 8 +- resources/forms/themewizard.ui | 667 ++++++++++++++---- 4 files changed, 569 insertions(+), 189 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 1160d7645..21e6d0cac 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -58,49 +58,49 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.updateThemeAllowed = True QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.onBackgroundComboBox) + self.onBackgroundComboBoxCurrentIndexChanged) QtCore.QObject.connect(self.gradientComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.onGradientComboBox) + self.onGradientComboBoxCurrentIndexChanged) QtCore.QObject.connect(self.colorButton, - QtCore.SIGNAL(u'pressed()'), + QtCore.SIGNAL(u'clicked()'), self.onColorButtonClicked) QtCore.QObject.connect(self.gradientStartButton, - QtCore.SIGNAL(u'pressed()'), + QtCore.SIGNAL(u'clicked()'), self.onGradientStartButtonClicked) QtCore.QObject.connect(self.gradientEndButton, - QtCore.SIGNAL(u'pressed()'), + QtCore.SIGNAL(u'clicked()'), self.onGradientEndButtonClicked) QtCore.QObject.connect(self.imageBrowseButton, - QtCore.SIGNAL(u'pressed()'), + QtCore.SIGNAL(u'clicked()'), self.onImageBrowseButtonClicked) QtCore.QObject.connect(self.mainColorButton, - QtCore.SIGNAL(u'pressed()'), - self.onMainColourButtonClicked) + QtCore.SIGNAL(u'clicked()'), + self.onMainColorButtonClicked) QtCore.QObject.connect(self.outlineColorButton, - QtCore.SIGNAL(u'pressed()'), - self.onOutlineColourButtonClicked) + QtCore.SIGNAL(u'clicked()'), + self.onOutlineColorButtonClicked) QtCore.QObject.connect(self.shadowColorButton, - QtCore.SIGNAL(u'pressed()'), - self.onShadowColourButtonClicked) + QtCore.SIGNAL(u'clicked()'), + self.onShadowColorButtonClicked) QtCore.QObject.connect(self.outlineCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onOutlineCheckCheckBoxChanged) + self.onOutlineCheckCheckBoxStateChanged) QtCore.QObject.connect(self.shadowCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onShadowCheckCheckBoxChanged) + self.onShadowCheckCheckBoxStateChanged) QtCore.QObject.connect(self.footerColorButton, - QtCore.SIGNAL(u'pressed()'), - self.onFooterColourButtonClicked) + QtCore.SIGNAL(u'clicked()'), + self.onFooterColorButtonClicked) QtCore.QObject.connect(self.mainPositionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onMainPositionCheckBox) + self.onMainPositionCheckBoxStateChanged) QtCore.QObject.connect(self.footerPositionCheckBox, QtCore.SIGNAL(u'stateChanged(int)'), - self.onFooterPositionCheckBox) + self.onFooterPositionCheckBoxStateChanged) QtCore.QObject.connect(self, QtCore.SIGNAL(u'currentIdChanged(int)'), - self.pageChanged) + self.onCurrentIdChanged) QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'theme_line_count'), self.updateLinesText) @@ -121,15 +121,6 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.calculateLines) QtCore.QObject.connect(self, QtCore.SIGNAL(u'accepted()'), self.accept) - def pageChanged(self, pageId): - """ - Detects Page changes and updates as approprate. - """ - if self.page(pageId) == self.previewPage: - self.updateTheme() - frame = self.thememanager.generateImage(self.theme) - self.previewBoxLabel.setPixmap(QtGui.QPixmap.fromImage(frame)) - def setDefaults(self): """ Set up display at start of theme edit. @@ -224,7 +215,16 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm', \ '(%d lines per slide)' % int(lines)))) - def onOutlineCheckCheckBoxChanged(self, state): + def onCurrentIdChanged(self, pageId): + """ + Detects Page changes and updates as approprate. + """ + if self.page(pageId) == self.previewPage: + self.updateTheme() + frame = self.thememanager.generateImage(self.theme) + self.previewBoxLabel.setPixmap(QtGui.QPixmap.fromImage(frame)) + + def onOutlineCheckCheckBoxStateChanged(self, state): """ Change state as Outline check box changed """ @@ -236,7 +236,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.outlineSizeSpinBox.setEnabled(self.theme.font_main_outline) self.calculateLines() - def onShadowCheckCheckBoxChanged(self, state): + def onShadowCheckCheckBoxStateChanged(self, state): """ Change state as Shadow check box changed """ @@ -248,13 +248,13 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.shadowSizeSpinBox.setEnabled(self.theme.font_main_shadow) self.calculateLines() - def onMainPositionCheckBox(self, value): + def onMainPositionCheckBoxStateChanged(self, value): """ Change state as Main Area Position check box changed """ self.theme.font_main_override = (value == QtCore.Qt.Checked) - def onFooterPositionCheckBox(self, value): + def onFooterPositionCheckBoxStateChanged(self, value): """ Change state as Footer Area Position check box changed """ @@ -403,14 +403,14 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.themeNameEdit.setReadOnly(len(self.theme.theme_name) != 0) self.themeNameEdit.setFrame(len(self.theme.theme_name) == 0) - def onBackgroundComboBox(self, index): + def onBackgroundComboBoxCurrentIndexChanged(self, index): """ Background style Combo box has changed. """ self.theme.background_type = BackgroundType.to_string(index) self.setBackgroundTabValues() - def onGradientComboBox(self, index): + def onGradientComboBoxCurrentIndexChanged(self, index): """ Background gradient Combo box has changed. """ @@ -456,22 +456,22 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.theme.background_filename = unicode(filename) self.setBackgroundTabValues() - def onMainColourButtonClicked(self): + def onMainColorButtonClicked(self): self.theme.font_main_color = \ self._colorButton(self.theme.font_main_color) self.setMainAreaTabValues() - def onOutlineColourButtonClicked(self): + def onOutlineColorButtonClicked(self): self.theme.font_main_outline_color = \ self._colorButton(self.theme.font_main_outline_color) self.setMainAreaTabValues() - def onShadowColourButtonClicked(self): + def onShadowColorButtonClicked(self): self.theme.font_main_shadow_color = \ self._colorButton(self.theme.font_main_shadow_color) self.setMainAreaTabValues() - def onFooterColourButtonClicked(self): + def onFooterColorButtonClicked(self): self.theme.font_footer_color = \ self._colorButton(self.theme.font_footer_color) self.setFooterAreaTabValues() @@ -573,4 +573,4 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): QtGui.QColor(field), self) if new_color.isValid(): field = new_color.name() - return field \ No newline at end of file + return field diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index da25b0f37..a088bfd22 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -69,7 +69,7 @@ class Ui_ThemeWizard(object): self.backgroundComboBox) self.backgroundTypeSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) - self.backgroundTypeLayout.setItem(1,QtGui.QFormLayout.LabelRole, + self.backgroundTypeLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.backgroundTypeSpacer) self.backgroundLayout.addLayout(self.backgroundTypeLayout) self.backgroundStack = QtGui.QStackedLayout() @@ -84,7 +84,7 @@ class Ui_ThemeWizard(object): self.colorButton = QtGui.QPushButton(self.colorWidget) self.colorButton.setObjectName(u'ColorButton') self.colorLayout.addRow(self.colorLabel, self.colorButton) - self.colorSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + self.colorSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.colorLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.colorSpacer) @@ -379,7 +379,6 @@ class Ui_ThemeWizard(object): ThemeWizard.addPage(self.previewPage) self.retranslateUi(ThemeWizard) - QtCore.QObject.connect(self.backgroundComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), self.backgroundStack, QtCore.SLOT(u'setCurrentIndex(int)')) diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index b01a10ffb..7d8071faa 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -96,7 +96,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.selectStack.setCurrentIndex(0) QtCore.QObject.connect(self.webSourceComboBox, QtCore.SIGNAL(u'currentIndexChanged(int)'), - self.onWebSourceComboBoxChanged) + self.onWebSourceComboBoxCurrentIndexChanged) QtCore.QObject.connect(self.osisBrowseButton, QtCore.SIGNAL(u'clicked()'), self.onOsisBrowseButtonClicked) @@ -223,7 +223,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): if self.currentPage() == self.importPage: return True - def onWebSourceComboBoxChanged(self, index): + def onWebSourceComboBoxCurrentIndexChanged(self, index): """ Setup the list of Bibles when you select a different source on the web download page. @@ -332,7 +332,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): QtCore.QVariant(self.copyrightEdit.text())) self.setField(u'license_permissions', QtCore.QVariant(self.permissionsEdit.text())) - self.onWebSourceComboBoxChanged(WebDownload.Crosswalk) + self.onWebSourceComboBoxCurrentIndexChanged(WebDownload.Crosswalk) settings.endGroup() def loadWebBibles(self): @@ -534,4 +534,4 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): self.importProgressBar.setValue(self.importProgressBar.maximum()) self.finishButton.setVisible(True) self.cancelButton.setVisible(False) - Receiver.send_message(u'openlp_process_events') \ No newline at end of file + Receiver.send_message(u'openlp_process_events') diff --git a/resources/forms/themewizard.ui b/resources/forms/themewizard.ui index f6428cdc7..9e1f8f9e8 100644 --- a/resources/forms/themewizard.ui +++ b/resources/forms/themewizard.ui @@ -2,6 +2,14 @@ ThemeWizard + + + 0 + 0 + 550 + 386 + + Theme Wizard @@ -15,30 +23,51 @@ QWizard::IndependentPages|QWizard::NoBackButtonOnStartPage + + + + + + + + 8 + 0 - - - 0 - 0 - + + + 163 + 0 + + + + + 163 + 16777215 + + + + 0 + + + :/wizards/wizard_importbible.bmp + + 0 + - 6 - - - 12 + 8 @@ -49,9 +78,6 @@ p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:14pt; font-weight:600;">Welcome to the Theme Wizard</span></p></body></html> - - true - @@ -73,11 +99,14 @@ p, li { white-space: pre-wrap; } - This wizard will help you to maintain Themes. Click the next button below to start the process by setting up your background. + This wizard will help you to maintain Themes . Click the next button below to start the process by setting up your background. true + + 10 + @@ -104,127 +133,256 @@ p, li { white-space: pre-wrap; } Set up your theme's background according to the parameters below. - - - 6 + + + 8 - 12 + 20 - - - - Background type: + + + + 8 - - - - - - Solid Color - - - - - Gradient - - - - - Image - - - - - - - - Color: - - - - - - - - - - Starting color: - - - - - - - - - - Ending color: - - - - - - - - - - Gradient: - - - - - - - - Horizontal - - - - - Vertical - - - - - Circular - - - - - Top Left - Bottom Right - - - - - Bottom Left - Top Right - - - - - - - - Image: - - - - - - - - - - - - - :/general/general_open.png:/general/general_open.png + + + Background type: + + + + + Solid Color + + + + + Gradient + + + + + Image + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0 + + + + + 8 + + + 8 + + + 0 + + + + + + 103 + 0 + + + + Color: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + + 8 + + + 8 + + + 0 + + + + + + 103 + 0 + + + + Starting color: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + 103 + 0 + + + + Ending color: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + + + 103 + 0 + + + + Gradient: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + Horizontal + + + + + Vertical + + + + + Circular + + + + + Top Left - Bottom Right + + + + + Bottom Left - Top Right + + + + + + + + + + 8 + + + 8 + + + 0 + + + + + + 103 + 0 + + + + Image: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 8 + + + + + + + + + + + + :/general/general_open.png:/general/general_open.png + + + + + + + + + @@ -235,17 +393,29 @@ p, li { white-space: pre-wrap; } Define the font and display characteristics for the Display text + + 8 + - 6 + 8 - 12 + 20 + + + 103 + 0 + + Font: + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + @@ -261,10 +431,14 @@ p, li { white-space: pre-wrap; } - 12 + 24 - + + + + + @@ -291,8 +465,26 @@ p, li { white-space: pre-wrap; } + + 8 + + + 0 + + + + 0 + 0 + + + + + 70 + 0 + + pt @@ -343,7 +535,14 @@ p, li { white-space: pre-wrap; } - + + + true + + + + + @@ -375,6 +574,9 @@ p, li { white-space: pre-wrap; } true + + + @@ -403,17 +605,32 @@ p, li { white-space: pre-wrap; } Define the font and display characteristics for the Footer text + + QFormLayout::ExpandingFieldsGrow + + + 8 + - 6 + 8 - 12 + 20 + + + 103 + 0 + + Font: + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + @@ -427,7 +644,11 @@ p, li { white-space: pre-wrap; } - + + + + + @@ -438,6 +659,18 @@ p, li { white-space: pre-wrap; } + + + 0 + 0 + + + + + 70 + 0 + + pt @@ -459,21 +692,36 @@ p, li { white-space: pre-wrap; } Allows additional display formatting information to be defined + + 8 + - 6 + 8 - 12 + 20 + + + 103 + 0 + + Horizontal Align: + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + false + Left @@ -535,16 +783,31 @@ p, li { white-space: pre-wrap; } - 12 + 20 + + + 8 + + + 248 + 0 + + &Main Area + + 8 + - 6 + 8 + + + 8 @@ -554,10 +817,13 @@ p, li { white-space: pre-wrap; } true + + false + - + X position: @@ -574,6 +840,12 @@ p, li { white-space: pre-wrap; } 0 + + + 78 + 0 + + px @@ -596,6 +868,12 @@ p, li { white-space: pre-wrap; } 0 + + + 78 + 0 + + px @@ -622,6 +900,12 @@ p, li { white-space: pre-wrap; } 0 + + + 78 + 0 + + px @@ -642,6 +926,18 @@ p, li { white-space: pre-wrap; } false + + + 0 + 0 + + + + + 78 + 0 + + px @@ -662,12 +958,24 @@ p, li { white-space: pre-wrap; } + + + 248 + 0 + + - &Footer Area + Footer Area + + 8 + - 6 + 8 + + + 8 @@ -681,6 +989,18 @@ p, li { white-space: pre-wrap; } false + + + 0 + 0 + + + + + 78 + 0 + + px @@ -704,6 +1024,18 @@ p, li { white-space: pre-wrap; } false + + + 0 + 0 + + + + + 78 + 0 + + px @@ -727,6 +1059,12 @@ p, li { white-space: pre-wrap; } false + + + 78 + 0 + + px @@ -747,6 +1085,12 @@ p, li { white-space: pre-wrap; } false + + + 78 + 0 + + px @@ -779,18 +1123,33 @@ p, li { white-space: pre-wrap; } - 6 + 8 - 12 + 20 + + 8 + + + + 103 + 0 + + Theme name: + + Qt::PlainText + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + themeNameEdit @@ -803,6 +1162,9 @@ p, li { white-space: pre-wrap; } + + 0 + @@ -810,7 +1172,7 @@ p, li { white-space: pre-wrap; } - 40 + 58 20 @@ -839,6 +1201,9 @@ p, li { white-space: pre-wrap; } 1 + + + true @@ -851,7 +1216,7 @@ p, li { white-space: pre-wrap; } - 40 + 78 20 @@ -882,5 +1247,21 @@ p, li { white-space: pre-wrap; } + + backgroundTypeComboBox + currentIndexChanged(int) + backgroundStackedWidget + setCurrentIndex(int) + + + 178 + 78 + + + 249 + 199 + + + From 7c68265f4b525593337d93a1daff6028bf2bc756 Mon Sep 17 00:00:00 2001 From: M2j Date: Mon, 27 Dec 2010 23:57:35 +0100 Subject: [PATCH 06/13] remove two consecutive spaces from python code of the whole OpenLP sources replaced double quotes for string in python code of the whole OpenLP sources --- openlp/core/lib/settingstab.py | 4 ++-- openlp/core/ui/exceptionform.py | 4 ++-- openlp/core/ui/generaltab.py | 6 +++--- openlp/core/ui/maindisplay.py | 10 +++++----- openlp/core/ui/shortcutlistform.py | 2 +- openlp/core/ui/slidecontroller.py | 8 ++++---- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 10 +++++----- openlp/core/ui/themewizard.py | 6 +++--- .../plugins/bibles/forms/bibleimportwizard.py | 8 ++++---- openlp/plugins/bibles/lib/__init__.py | 18 +++++++++--------- openlp/plugins/bibles/lib/csvbible.py | 5 +++-- openlp/plugins/media/lib/mediaitem.py | 4 ++-- openlp/plugins/media/mediaplugin.py | 4 ++-- .../presentations/lib/messagelistener.py | 6 +++--- openlp/plugins/songs/lib/cclifileimport.py | 8 ++++---- openlp/plugins/songs/lib/songbeamerimport.py | 6 +++--- openlp/plugins/songs/lib/wowimport.py | 6 +++--- 18 files changed, 59 insertions(+), 58 deletions(-) diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index 518080368..6586a50f2 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -31,7 +31,7 @@ class SettingsTab(QtGui.QWidget): SettingsTab is a helper widget for plugins to define Tabs for the settings dialog. """ - def __init__(self, title, visible_title=None): + def __init__(self, title, visible_title=None): """ Constructor to create the Settings tab item. @@ -95,4 +95,4 @@ class SettingsTab(QtGui.QWidget): Indicates if called before or after updates. """ - pass \ No newline at end of file + pass diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 90a54e12e..fde514d1a 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -84,7 +84,7 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): u'lxml: %s\n' % etree.__version__ + \ u'Chardet: %s\n' % chardet_version + \ u'PyEnchant: %s\n' % enchant_version + \ - u'PySQLite: %s\n' % sqlite_version + u'PySQLite: %s\n' % sqlite_version if platform.system() == u'Linux': if os.environ.get(u'KDE_FULL_SESSION') == u'true': system = system + u'Desktop: KDE SC\n' @@ -144,4 +144,4 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): exception = line.split(u'\n')[-1].split(u':')[0] subject = u'Bug report: %s in %s' % (exception, source) mailto(address=u'bugs@openlp.org', subject=subject, - body=body % content) \ No newline at end of file + body=body % content) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 8c56648c8..1dd6607ed 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -141,10 +141,10 @@ class GeneralTab(SettingsTab): self.settingsLayout.addWidget(self.autoPreviewCheckBox, 1, 0, 1, 2) # Moved here from image tab self.timeoutLabel = QtGui.QLabel(self.settingsGroupBox) - self.timeoutLabel.setObjectName("timeoutLabel") + self.timeoutLabel.setObjectName(u'timeoutLabel') self.settingsLayout.addWidget(self.timeoutLabel, 2, 0, 1, 1) self.timeoutSpinBox = QtGui.QSpinBox(self.settingsGroupBox) - self.timeoutSpinBox.setObjectName("timeoutSpinBox") + self.timeoutSpinBox.setObjectName(u'timeoutSpinBox') self.settingsLayout.addWidget(self.timeoutSpinBox, 2, 1, 1, 1) self.generalLeftLayout.addWidget(self.settingsGroupBox) self.generalLeftSpacer = QtGui.QSpacerItem(20, 40, @@ -530,4 +530,4 @@ class GeneralTab(SettingsTab): """ Called when the width, height, x position or y position has changed. """ - self.overrideChanged = True \ No newline at end of file + self.overrideChanged = True diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 2028e7f30..dd24f172d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -209,7 +209,7 @@ class MainDisplay(DisplayWidget): shrink = True else: shrink = False - js = u'show_alert("%s", "%s")' % ( + js = u'show_alert("%s", "%s")' % ( text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'), u'top' if shrink else u'') height = self.frame.evaluateJavaScript(js) @@ -235,8 +235,8 @@ class MainDisplay(DisplayWidget): def image(self, name): """ - Add an image as the background. The image is converted to a - bytestream on route. + Add an image as the background. The image is converted to a bytestream + on route. `Image` The Image to be displayed can be QImage or QPixmap @@ -421,8 +421,8 @@ class MainDisplay(DisplayWidget): Display the Footer """ log.debug(u'footer') - js = "show_footer('" + \ - text.replace("\\", "\\\\").replace("\'", "\\\'") + "')" + js = u'show_footer(\'' + \ + text.replace(u'\\', u'\\\\').replace(u'\'', u'\\\'') + u'\')' self.frame.evaluateJavaScript(js) def hideDisplay(self, mode=HideMode.Screen): diff --git a/openlp/core/ui/shortcutlistform.py b/openlp/core/ui/shortcutlistform.py index 0d9a4bab3..053f2347f 100644 --- a/openlp/core/ui/shortcutlistform.py +++ b/openlp/core/ui/shortcutlistform.py @@ -71,7 +71,7 @@ class ShortcutListForm(QtGui.QDialog, Ui_ShortcutListDialog): if event.modifiers() & Qt.ShiftModifier == Qt.ShiftModifier: key_string = u'Shift+' + key_string key_sequence = QtGui.QKeySequence(key_string) - existing_key = QtGui.QKeySequence("Ctrl+Shift+F8") + existing_key = QtGui.QKeySequence(u'Ctrl+Shift+F8') if key_sequence == existing_key: QtGui.QMessageBox.warning( self, diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index be1fcd44a..8f699d152 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -184,14 +184,14 @@ class SlideController(QtGui.QWidget): 'Blank Screen'), self.HideMenu) self.BlankScreen.setCheckable(True) QtCore.QObject.connect(self.BlankScreen, - QtCore.SIGNAL("triggered(bool)"), self.onBlankDisplay) + QtCore.SIGNAL(u'triggered(bool)'), self.onBlankDisplay) self.ThemeScreen = QtGui.QAction(QtGui.QIcon( u':/slides/slide_theme.png'), translate('OpenLP.SlideController', 'Blank to Theme'), self.HideMenu) self.ThemeScreen.setCheckable(True) QtCore.QObject.connect(self.ThemeScreen, - QtCore.SIGNAL("triggered(bool)"), self.onThemeDisplay) + QtCore.SIGNAL(u'triggered(bool)'), self.onThemeDisplay) if self.screens.display_count > 1: self.DesktopScreen = QtGui.QAction(QtGui.QIcon( u':/slides/slide_desktop.png'), @@ -199,7 +199,7 @@ class SlideController(QtGui.QWidget): 'Show Desktop'), self.HideMenu) self.DesktopScreen.setCheckable(True) QtCore.QObject.connect(self.DesktopScreen, - QtCore.SIGNAL("triggered(bool)"), self.onHideDisplay) + QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay) self.HideMenu.setDefaultAction(self.BlankScreen) self.HideMenu.menu().addAction(self.BlankScreen) self.HideMenu.menu().addAction(self.ThemeScreen) @@ -1033,4 +1033,4 @@ class SlideController(QtGui.QWidget): self.mediaObject.clearQueue() self.video.hide() self.SlidePreview.clear() - self.SlidePreview.show() \ No newline at end of file + self.SlidePreview.show() diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 21e6d0cac..acedefdb1 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -159,7 +159,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.mainAreaPage.registerField( u'outlineCheckBox', self.outlineCheckBox) self.mainAreaPage.registerField( - u'outlineColorPushButton', self.outlineColorButton) + u'outlineColorButton', self.outlineColorButton) self.mainAreaPage.registerField( u'outlineSizeSpinBox', self.outlineSizeSpinBox) self.mainAreaPage.registerField( diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 82d7c4b0e..e340042a5 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.theme import Theme from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ - build_icon, Receiver, SettingsManager, translate, check_item_selected, \ + build_icon, Receiver, SettingsManager, translate, check_item_selected, \ BackgroundType, BackgroundGradientType from openlp.core.utils import AppLocation, get_filesystem_encoding @@ -230,7 +230,7 @@ class ThemeManager(QtGui.QWidget): self.fileRenameForm.fileNameEdit.setText(oldThemeName) self.saveThemeName = oldThemeName if self.fileRenameForm.exec_(): - newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) + newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) oldThemeData = self.getThemeData(oldThemeName) self.deleteTheme(oldThemeName) self.cloneThemeData(oldThemeData, newThemeName) @@ -244,7 +244,7 @@ class ThemeManager(QtGui.QWidget): self.fileRenameForm.fileNameEdit.setText(oldThemeName) self.saveThemeName = u'' if self.fileRenameForm.exec_(True): - newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) + newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) themeData = self.getThemeData(oldThemeName) self.cloneThemeData(themeData, newThemeName) self.loadThemes() @@ -331,7 +331,7 @@ class ThemeManager(QtGui.QWidget): theme = unicode(item.data(QtCore.Qt.UserRole).toString()) path = QtGui.QFileDialog.getExistingDirectory(self, unicode(translate('OpenLP.ThemeManager', - 'Save Theme - (%s)')) % theme, + 'Save Theme - (%s)')) % theme, SettingsManager.get_last_dir(self.settingsSection, 1)) path = unicode(path) if path: @@ -795,4 +795,4 @@ class ThemeManager(QtGui.QWidget): unicode(translate('OpenLP.ThemeManager', 'Theme %s is used by the service manager.')) % theme) return False - return True \ No newline at end of file + return True diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index a088bfd22..31d04ca03 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -67,7 +67,7 @@ class Ui_ThemeWizard(object): self.backgroundComboBox.setObjectName(u'BackgroundComboBox') self.backgroundTypeLayout.addRow(self.backgroundLabel, self.backgroundComboBox) - self.backgroundTypeSpacer = QtGui.QSpacerItem(10, 0, + self.backgroundTypeSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.backgroundTypeLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.backgroundTypeSpacer) @@ -113,7 +113,7 @@ class Ui_ThemeWizard(object): self.gradientComboBox.addItems([u'', u'', u'', u'', u'']) self.gradientLayout.addRow(self.gradientTypeLabel, self.gradientComboBox) - self.gradientSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + self.gradientSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.gradientLayout.setItem(3, QtGui.QFormLayout.LabelRole, self.gradientSpacer) @@ -136,7 +136,7 @@ class Ui_ThemeWizard(object): build_icon(u':/general/general_open.png')) self.imageFileLayout.addWidget(self.imageBrowseButton) self.imageLayout.addRow(self.imageLabel, self.imageFileLayout) - self.imageSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + self.imageSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.imageLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.imageSpacer) diff --git a/openlp/plugins/bibles/forms/bibleimportwizard.py b/openlp/plugins/bibles/forms/bibleimportwizard.py index a8d324cf1..a85e430a1 100644 --- a/openlp/plugins/bibles/forms/bibleimportwizard.py +++ b/openlp/plugins/bibles/forms/bibleimportwizard.py @@ -91,7 +91,7 @@ class Ui_BibleImportWizard(object): self.osisBrowseButton.setObjectName(u'OsisBrowseButton') self.osisFileLayout.addWidget(self.osisBrowseButton) self.osisLayout.addRow(self.osisFileLabel, self.osisFileLayout) - self.osisSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + self.osisSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.osisLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.osisSpacer) self.selectStack.addWidget(self.osisWidget) @@ -124,7 +124,7 @@ class Ui_BibleImportWizard(object): self.csvVersesButton.setObjectName(u'CsvVersesButton') self.csvVersesLayout.addWidget(self.csvVersesButton) self.csvLayout.addRow(self.csvVersesLabel, self.csvVersesLayout) - self.csvSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + self.csvSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.csvLayout.setItem(2, QtGui.QFormLayout.LabelRole, self.csvSpacer) self.selectStack.addWidget(self.csvWidget) @@ -147,7 +147,7 @@ class Ui_BibleImportWizard(object): self.openSongFileLayout.addWidget(self.openSongBrowseButton) self.openSongLayout.addRow(self.openSongFileLabel, self.openSongFileLayout) - self.openSongSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + self.openSongSpacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.openSongLayout.setItem(1, QtGui.QFormLayout.LabelRole, self.openSongSpacer) @@ -230,7 +230,7 @@ class Ui_BibleImportWizard(object): self.openlp1DisabledLabel.setWordWrap(True) self.openlp1DisabledLabel.setObjectName(u'Openlp1DisabledLabel') self.openlp1Layout.addRow(self.openlp1DisabledLabel) - self.openlp1Spacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, + self.openlp1Spacer = QtGui.QSpacerItem(10, 0, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum) self.openlp1Layout.setItem(1, QtGui.QFormLayout.LabelRole, self.openlp1Spacer) diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 31c7e4f3f..9f0b6243d 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -77,9 +77,9 @@ def parse_reference(reference): - After a verse reference all further single values are treat as verse in the last selected chapter. ``John 3:16-18`` refers to John chapter 3 verses 16 to 18 - - After a list separator it is possible to refer to additional verses. They - are build analog to the first ones. This way it is possible to define each - number of verse references. It is not possible to refer to verses in + - After a list separator it is possible to refer to additional verses. They + are build analog to the first ones. This way it is possible to define + each number of verse references. It is not possible to refer to verses in additional books. ``John 3:16,18`` refers to John chapter 3 verses 16 and 18 ``John 3:16-18,20`` refers to John chapter 3 verses 16 to 18 and 20 @@ -96,7 +96,7 @@ def parse_reference(reference): a verse separator. 2. ``(?P[0-9]+)`` The verse reference ``from_verse`` is manditory - 3. ``(?P%(sep_r)s(?:`` ... ``|%(sep_e)s)?)?`` + 3. ``(?P%(sep_r)s(?:`` ... ``|%(sep_e)s)?)?`` A ``range_to`` declaration is optional. It starts with a range separator and contains optional a chapter and verse declaration or a end separator. @@ -105,15 +105,15 @@ def parse_reference(reference): 5. ``(?P[0-9]+)`` The ``to_verse`` reference is equivalent to group 2. - The full reference is matched against get_reference_match(u'full'). This + The full reference is matched against get_reference_match(u'full'). This regular expression looks like this: 1. ``^\s*(?!\s)(?P[\d]*[^\d]+)(?(?:`` + range_string + ``(?:%(sep_l)s|(?=\s*$)))+)\s*$`` - The second group contains all ``ranges``. This can be multiple + The second group contains all ``ranges``. This can be multiple declarations of a range_string separated by a list separator. The reference list is a list of tuples, with each tuple structured like @@ -194,7 +194,7 @@ def parse_reference(reference): class SearchResults(object): """ - Encapsulate a set of search results. This is Bible-type independent. + Encapsulate a set of search results. This is Bible-type independent. """ def __init__(self, book, chapter, verselist): """ @@ -222,4 +222,4 @@ class SearchResults(object): from manager import BibleManager from biblestab import BiblesTab -from mediaitem import BibleMediaItem \ No newline at end of file +from mediaitem import BibleMediaItem diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index d9144a34e..8ba13f773 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -86,7 +86,8 @@ class CSVBible(BibleDB): verse_file.seek(0) verse_reader = csv.reader(verse_file, dialect) for line in verse_reader: - if self.stop_import_flag: # cancel pressed + if self.stop_import_flag: + # cancel pressed break details = chardet.detect(line[3]) if book_ptr != line[0]: @@ -109,4 +110,4 @@ class CSVBible(BibleDB): if self.stop_import_flag: return False else: - return success \ No newline at end of file + return success diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index e2309ea76..56a7f4189 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -30,7 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - ItemCapabilities, SettingsManager, translate, check_item_selected, \ + ItemCapabilities, SettingsManager, translate, check_item_selected, \ context_menu_action log = logging.getLogger(__name__) @@ -159,4 +159,4 @@ class MediaMediaItem(MediaManagerItem): img = QtGui.QPixmap(u':/media/media_video.png').toImage() item_name.setIcon(build_icon(img)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) - self.listView.addItem(item_name) \ No newline at end of file + self.listView.addItem(item_name) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 2f5b78b8e..56da8e8d0 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -65,7 +65,7 @@ class MediaPlugin(Plugin): def _addToList(self, list, value, mimetype): # Is it a media type if len(value) == 2: - extensions = mimetypes.guess_all_extensions(unicode(mimetype)) + extensions = mimetypes.guess_all_extensions(unicode(mimetype)) # we have an extension if extensions: for extension in extensions: @@ -142,4 +142,4 @@ class MediaPlugin(Plugin): u'title': translate('MediaPlugin', 'Service'), u'tooltip': translate('MediaPlugin', 'Add the selected Media to the service') - } \ No newline at end of file + } diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index 566fc5706..19abadf0d 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -90,7 +90,7 @@ class Controller(object): """ Go to a specific slide """ - log.debug(u'Live = %s, slide' % self.is_live) + log.debug(u'Live = %s, slide' % self.is_live) if not self.is_live: return if self.doc.is_blank(): @@ -249,7 +249,7 @@ class MessageListener(object): self.timer = QtCore.QTimer() self.timer.setInterval(500) QtCore.QObject.connect( - self.timer, QtCore.SIGNAL("timeout()"), self.timeout) + self.timer, QtCore.SIGNAL(u'timeout()'), self.timeout) def startup(self, message): """ @@ -367,4 +367,4 @@ class MessageListener(object): to check which slide is currently displayed so the slidecontroller view can be updated """ - self.live_handler.poll() \ No newline at end of file + self.live_handler.poll() diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 79a7260bb..a30f8b4eb 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -124,7 +124,7 @@ class CCLIFileImport(SongImport): ``Title=`` Contains the song title (e.g. *Title=Above All*) ``Author=`` - Contains a | delimited list of the song authors + Contains a | delimited list of the song authors e.g. *Author=LeBlanc, Lenny | Baloche, Paul* ``Copyright=`` Contains a | delimited list of the song copyrights @@ -184,8 +184,8 @@ class CCLIFileImport(SongImport): verse_type = u'O' check_first_verse_line = True verse_text = unicode(words_list[counter]) - verse_text = verse_text.replace("/n", "\n") - verse_lines = verse_text.split(u'\n', 1) + verse_text = verse_text.replace(u'/n', u'\n') + verse_lines = verse_text.split(u'\n', 1) if check_first_verse_line: if verse_lines[0].startswith(u'(PRE-CHORUS'): verse_type = u'P' @@ -337,4 +337,4 @@ class CCLIFileImport(SongImport): self.copyright = song_copyright self.ccli_number = song_ccli self.comments = song_comments - self.finish() \ No newline at end of file + self.finish() diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 29884b80c..9fb0f5eb5 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -85,7 +85,7 @@ class SongBeamerImport(SongImport): """ Recieve a single file, or a list of files to import. """ - if isinstance(self.import_source, list): + if isinstance(self.import_source, list): self.import_wizard.importProgressBar.setMaximum( len(self.import_source)) for file in self.import_source: @@ -96,7 +96,7 @@ class SongBeamerImport(SongImport): read_verses = False self.file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - "Importing %s" % (self.file_name), 0) + "Importing %s" % (self.file_name), 0) if os.path.isfile(file): detect_file = open(file, u'r') details = chardet.detect(detect_file.read(2048)) @@ -292,4 +292,4 @@ class SongBeamerImport(SongImport): self.current_verse_type += marks[1] return True else: - return False \ No newline at end of file + return False diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 42b66ccb7..3d4885661 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -32,7 +32,7 @@ import logging from openlp.plugins.songs.lib.songimport import SongImport -BLOCK_TYPES = (u'V', u'C', u'B') +BLOCK_TYPES = (u'V', u'C', u'B') log = logging.getLogger(__name__) @@ -111,7 +111,7 @@ class WowImport(SongImport): Recieve a single file, or a list of files to import. """ - if isinstance(self.import_source, list): + if isinstance(self.import_source, list): self.import_wizard.importProgressBar.setMaximum( len(self.import_source)) for file in self.import_source: @@ -119,7 +119,7 @@ class WowImport(SongImport): self.copyright = u'' self.file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - "Importing %s" % (self.file_name), 0) + "Importing %s" % (self.file_name), 0) # Get the song title self.title = self.file_name.rpartition(u'.')[0] self.songData = open(file, 'rb') From 1a31bf2047524392b9505c875e128eaec5a3312b Mon Sep 17 00:00:00 2001 From: M2j Date: Tue, 28 Dec 2010 10:22:29 +0100 Subject: [PATCH 07/13] reverted changes in slidecontroller.py to avoid interference with merge request 44744 of googol-hush --- openlp/core/theme/theme.py | 12 ++++++------ openlp/core/ui/slidecontroller.py | 8 ++++---- openlp/core/utils/languagemanager.py | 4 ++-- openlp/plugins/songs/lib/cclifileimport.py | 6 +++--- openlp/plugins/songs/lib/songbeamerimport.py | 2 +- openlp/plugins/songs/lib/wowimport.py | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/openlp/core/theme/theme.py b/openlp/core/theme/theme.py index f3dabca5e..e506fc2c2 100644 --- a/openlp/core/theme/theme.py +++ b/openlp/core/theme/theme.py @@ -33,11 +33,11 @@ processing version 1 themes in OpenLP version 2. from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtGui -DELPHI_COLORS = {"clRed":0xFF0000, - "clBlue":0x0000FF, - "clYellow":0xFFFF00, - "clBlack":0x000000, - "clWhite":0xFFFFFF} +DELPHI_COLORS = {u'clRed': 0xFF0000, + u'clBlue': 0x0000FF, + u'clYellow': 0xFFFF00, + u'clBlack': 0x000000, + u'clWhite': 0xFFFFFF} BLANK_STYLE_XML = \ ''' @@ -222,4 +222,4 @@ class Theme(object): for key in dir(self): if key[0:1] != u'_': theme_strings.append(u'%30s : %s' % (key, getattr(self, key))) - return u'\n'.join(theme_strings) \ No newline at end of file + return u'\n'.join(theme_strings) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 8f699d152..be1fcd44a 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -184,14 +184,14 @@ class SlideController(QtGui.QWidget): 'Blank Screen'), self.HideMenu) self.BlankScreen.setCheckable(True) QtCore.QObject.connect(self.BlankScreen, - QtCore.SIGNAL(u'triggered(bool)'), self.onBlankDisplay) + QtCore.SIGNAL("triggered(bool)"), self.onBlankDisplay) self.ThemeScreen = QtGui.QAction(QtGui.QIcon( u':/slides/slide_theme.png'), translate('OpenLP.SlideController', 'Blank to Theme'), self.HideMenu) self.ThemeScreen.setCheckable(True) QtCore.QObject.connect(self.ThemeScreen, - QtCore.SIGNAL(u'triggered(bool)'), self.onThemeDisplay) + QtCore.SIGNAL("triggered(bool)"), self.onThemeDisplay) if self.screens.display_count > 1: self.DesktopScreen = QtGui.QAction(QtGui.QIcon( u':/slides/slide_desktop.png'), @@ -199,7 +199,7 @@ class SlideController(QtGui.QWidget): 'Show Desktop'), self.HideMenu) self.DesktopScreen.setCheckable(True) QtCore.QObject.connect(self.DesktopScreen, - QtCore.SIGNAL(u'triggered(bool)'), self.onHideDisplay) + QtCore.SIGNAL("triggered(bool)"), self.onHideDisplay) self.HideMenu.setDefaultAction(self.BlankScreen) self.HideMenu.menu().addAction(self.BlankScreen) self.HideMenu.menu().addAction(self.ThemeScreen) @@ -1033,4 +1033,4 @@ class SlideController(QtGui.QWidget): self.mediaObject.clearQueue() self.video.hide() self.SlidePreview.clear() - self.SlidePreview.show() + self.SlidePreview.show() \ No newline at end of file diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 76c584bb3..454d14fa2 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -65,7 +65,7 @@ class LanguageManager(object): """ trans_dir = QtCore.QDir(AppLocation.get_directory( AppLocation.LanguageDir)) - file_names = trans_dir.entryList(QtCore.QStringList("*.qm"), + file_names = trans_dir.entryList(QtCore.QStringList(u'*.qm'), QtCore.QDir.Files, QtCore.QDir.Name) for name in file_names: file_names.replaceInStrings(name, trans_dir.filePath(name)) @@ -143,4 +143,4 @@ class LanguageManager(object): """ if not LanguageManager.__qm_list__: LanguageManager.init_qm_list() - return LanguageManager.__qm_list__ \ No newline at end of file + return LanguageManager.__qm_list__ diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index a30f8b4eb..e4bec1a3c 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -86,11 +86,11 @@ class CCLIFileImport(SongImport): infile = codecs.open(filename, u'r', details['encoding']) lines = infile.readlines() ext = os.path.splitext(filename)[1] - if ext.lower() == ".usr": + if ext.lower() == u'.usr': log.info(u'SongSelect .usr format file found %s: ', filename) self.do_import_usr_file(lines) - elif ext.lower() == ".txt": + elif ext.lower() == u'.txt': log.info(u'SongSelect .txt format file found %s: ', filename) self.do_import_txt_file(lines) @@ -207,7 +207,7 @@ class CCLIFileImport(SongImport): author_list = song_author.split(u'|') for author in author_list: seperated = author.split(u',') - self.add_author(seperated[1].strip() + " " + seperated[0].strip()) + self.add_author(seperated[1].strip() + u' ' + seperated[0].strip()) self.title = song_name self.copyright = song_copyright self.ccli_number = song_ccli diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 9fb0f5eb5..285c8c603 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -96,7 +96,7 @@ class SongBeamerImport(SongImport): read_verses = False self.file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - "Importing %s" % (self.file_name), 0) + u'Importing %s' % (self.file_name), 0) if os.path.isfile(file): detect_file = open(file, u'r') details = chardet.detect(detect_file.read(2048)) diff --git a/openlp/plugins/songs/lib/wowimport.py b/openlp/plugins/songs/lib/wowimport.py index 3d4885661..1d5470f9b 100644 --- a/openlp/plugins/songs/lib/wowimport.py +++ b/openlp/plugins/songs/lib/wowimport.py @@ -119,7 +119,7 @@ class WowImport(SongImport): self.copyright = u'' self.file_name = os.path.split(file)[1] self.import_wizard.incrementProgressBar( - "Importing %s" % (self.file_name), 0) + u'Importing %s' % (self.file_name), 0) # Get the song title self.title = self.file_name.rpartition(u'.')[0] self.songData = open(file, 'rb') @@ -167,5 +167,5 @@ class WowImport(SongImport): self.songData.close() self.finish() self.import_wizard.incrementProgressBar( - "Importing %s" % (self.file_name)) + u'Importing %s' % (self.file_name)) return True From 557a66db9d2190f26579277bcea37aa48a0bdf7e Mon Sep 17 00:00:00 2001 From: M2j Date: Tue, 28 Dec 2010 12:18:56 +0100 Subject: [PATCH 08/13] ThemeWizard: Show theme name in title and hide themeNameEdit if wizard is in editing mode. ThemeWizard: Changed transitionsComboBox to align with the FormLayout. (change some log.debug() arguments to avoid UnicodeError exceptions) --- openlp/core/lib/mediamanageritem.py | 10 +-- openlp/core/ui/pluginform.py | 4 +- openlp/core/ui/themeform.py | 76 ++++++++++--------- openlp/core/ui/themewizard.py | 9 ++- .../plugins/bibles/forms/bibleimportform.py | 2 +- openlp/plugins/bibles/lib/__init__.py | 2 +- openlp/plugins/bibles/lib/db.py | 6 +- openlp/plugins/bibles/lib/http.py | 4 +- openlp/plugins/bibles/lib/osis.py | 4 +- openlp/plugins/songs/forms/songimportform.py | 2 +- openlp/plugins/songs/lib/opensongimport.py | 6 +- 11 files changed, 68 insertions(+), 57 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 50e43afd0..7c91d6f40 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -445,7 +445,7 @@ class MediaManagerItem(QtGui.QWidget): translate('OpenLP.MediaManagerItem', 'You must select one or more items to preview.')) else: - log.debug(self.plugin.name + u' Preview requested') + log.debug(u'%s Preview requested', self.plugin.name) serviceItem = self.buildServiceItem() if serviceItem: serviceItem.from_plugin = True @@ -462,7 +462,7 @@ class MediaManagerItem(QtGui.QWidget): translate('OpenLP.MediaManagerItem', 'You must select one or more items to send live.')) else: - log.debug(self.plugin.name + u' Live requested') + log.debug(u'%s Live requested', self.plugin.name) serviceItem = self.buildServiceItem() if serviceItem: serviceItem.from_plugin = True @@ -481,7 +481,7 @@ class MediaManagerItem(QtGui.QWidget): # Is it posssible to process multiple list items to generate # multiple service items? if self.singleServiceItem or self.remoteTriggered: - log.debug(self.plugin.name + u' Add requested') + log.debug(u'%s Add requested', self.plugin.name) serviceItem = self.buildServiceItem(None, True) if serviceItem: serviceItem.from_plugin = False @@ -505,7 +505,7 @@ class MediaManagerItem(QtGui.QWidget): translate('OpenLP.MediaManagerItem', 'You must select one or more items')) else: - log.debug(self.plugin.name + u' Add requested') + log.debug(u'%s Add requested', self.plugin.name) serviceItem = self.parent.serviceManager.getServiceItem() if not serviceItem: QtGui.QMessageBox.information(self, @@ -544,4 +544,4 @@ class MediaManagerItem(QtGui.QWidget): Method to add processing when a service has been loaded and individual service items need to be processed by the plugins """ - pass \ No newline at end of file + pass diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index dfefef476..4d3177ef3 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -92,7 +92,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): self.statusComboBox.setEnabled(False) def _setDetails(self): - log.debug('PluginStatus: %s', str(self.activePlugin.status)) + log.debug(u'PluginStatus: %s', str(self.activePlugin.status)) self.versionNumberLabel.setText(self.activePlugin.version) self.aboutTextBrowser.setHtml(self.activePlugin.about()) self.programaticChange = True @@ -142,4 +142,4 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): translate('OpenLP.PluginForm', '%s (Disabled)')) name_string = self.activePlugin.getString(StringContent.Name) self.pluginListWidget.currentItem().setText( - status_text % name_string[u'singular']) \ No newline at end of file + status_text % name_string[u'singular']) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index acedefdb1..1eeae8dbe 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -127,12 +127,12 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.restart() self.accepted = False - self.setBackgroundTabValues() - self.setMainAreaTabValues() - self.setFooterAreaTabValues() - self.setAlignmentTabValues() - self.setPositionTabValues() - self.setPreviewTabValues() + self.setBackgroundPageValues() + self.setMainAreaPageValues() + self.setFooterAreaPageValues() + self.setAlignmentPageValues() + self.setPositionPageValues() + self.setPreviewPageValues() def registerFields(self): """ @@ -268,8 +268,15 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.updateThemeAllowed = False self.setDefaults() self.updateThemeAllowed = True + self.themeNameLabel.setVisible(not edit) + self.themeNameEdit.setVisible(not edit) if edit: + self.setWindowTitle(unicode(translate('OpenLP.ThemeWizard', + 'Edit Theme %s - OpenLP')) % self.theme.theme_name) self.next() + else: + self.setWindowTitle(translate('OpenLP.ThemeWizard', + 'New Theme - OpenLP')) return QtGui.QWizard.exec_(self) def initializePage(self, id): @@ -279,19 +286,19 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): log.debug(u'initializePage %s' % id) wizardPage = self.page(id) if wizardPage == self.backgroundPage: - self.setBackgroundTabValues() + self.setBackgroundPageValues() elif wizardPage == self.mainAreaPage: - self.setMainAreaTabValues() + self.setMainAreaPageValues() elif wizardPage == self.footerAreaPage: - self.setFooterAreaTabValues() + self.setFooterAreaPageValues() elif wizardPage == self.alignmentPage: - self.setAlignmentTabValues() + self.setAlignmentPageValues() elif wizardPage == self.areaPositionPage: - self.setPositionTabValues() + self.setPositionPageValues() - def setBackgroundTabValues(self): + def setBackgroundPageValues(self): """ - Handle the display and State of the background display tab. + Handle the display and state of the Background page. """ if self.theme.background_type == \ BackgroundType.to_string(BackgroundType.Solid): @@ -323,9 +330,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): else: self.setField(u'gradient', QtCore.QVariant(4)) - def setMainAreaTabValues(self): + def setMainAreaPageValues(self): """ - Handle the display and State of the Main Area tab. + Handle the display and state of the Main Area page. """ self.mainFontComboBox.setCurrentFont( QtGui.QFont(self.theme.font_main_name)) @@ -352,9 +359,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.setField(u'mainItalicsCheckBox', QtCore.QVariant(self.theme.font_main_italics)) - def setFooterAreaTabValues(self): + def setFooterAreaPageValues(self): """ - Handle the display and State of the Footer Area tab. + Handle the display and state of the Footer Area page. """ self.footerFontComboBox.setCurrentFont( QtGui.QFont(self.theme.font_main_name)) @@ -363,9 +370,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.setField(u'footerSizeSpinBox', QtCore.QVariant(self.theme.font_footer_size)) - def setPositionTabValues(self): + def setPositionPageValues(self): """ - Handle the display and State of the Position tab. + Handle the display and state of the Position page. """ # Main Area self.mainPositionCheckBox.setChecked(not self.theme.font_main_override) @@ -387,9 +394,9 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.setField(u'footerPositionWidth', QtCore.QVariant(self.theme.font_footer_width)) - def setAlignmentTabValues(self): + def setAlignmentPageValues(self): """ - Define the Tab Alignments Page + Handle the display and state of the Alignments page. """ self.setField(u'horizontal', QtCore.QVariant(self.theme.display_horizontal_align)) @@ -398,17 +405,18 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.setField(u'slideTransition', QtCore.QVariant(self.theme.display_slide_transition)) - def setPreviewTabValues(self): + def setPreviewPageValues(self): + """ + Handle the display and state of the Preview page. + """ self.setField(u'name', QtCore.QVariant(self.theme.theme_name)) - self.themeNameEdit.setReadOnly(len(self.theme.theme_name) != 0) - self.themeNameEdit.setFrame(len(self.theme.theme_name) == 0) def onBackgroundComboBoxCurrentIndexChanged(self, index): """ Background style Combo box has changed. """ self.theme.background_type = BackgroundType.to_string(index) - self.setBackgroundTabValues() + self.setBackgroundPageValues() def onGradientComboBoxCurrentIndexChanged(self, index): """ @@ -416,7 +424,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.theme.background_direction = \ BackgroundGradientType.to_string(index) - self.setBackgroundTabValues() + self.setBackgroundPageValues() def onColorButtonClicked(self): """ @@ -424,7 +432,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.theme.background_color = \ self._colorButton(self.theme.background_color) - self.setBackgroundTabValues() + self.setBackgroundPageValues() def onGradientStartButtonClicked(self): """ @@ -432,7 +440,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.theme.background_start_color = \ self._colorButton(self.theme.background_start_color) - self.setBackgroundTabValues() + self.setBackgroundPageValues() def onGradientEndButtonClicked(self): """ @@ -440,7 +448,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): """ self.theme.background_end_color = \ self._colorButton(self.theme.background_end_color) - self.setBackgroundTabValues() + self.setBackgroundPageValues() def onImageBrowseButtonClicked(self): """ @@ -454,27 +462,27 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): images_filter) if filename: self.theme.background_filename = unicode(filename) - self.setBackgroundTabValues() + self.setBackgroundPageValues() def onMainColorButtonClicked(self): self.theme.font_main_color = \ self._colorButton(self.theme.font_main_color) - self.setMainAreaTabValues() + self.setMainAreaPageValues() def onOutlineColorButtonClicked(self): self.theme.font_main_outline_color = \ self._colorButton(self.theme.font_main_outline_color) - self.setMainAreaTabValues() + self.setMainAreaPageValues() def onShadowColorButtonClicked(self): self.theme.font_main_shadow_color = \ self._colorButton(self.theme.font_main_shadow_color) - self.setMainAreaTabValues() + self.setMainAreaPageValues() def onFooterColorButtonClicked(self): self.theme.font_footer_color = \ self._colorButton(self.theme.font_footer_color) - self.setFooterAreaTabValues() + self.setFooterAreaPageValues() def updateTheme(self): """ diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 31d04ca03..9aa27b709 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -269,9 +269,12 @@ class Ui_ThemeWizard(object): self.verticalComboBox.addItems([u'', u'', u'']) 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.transitionsCheckBox) + self.alignmentLayout.addRow(self.transitionsLabel, + self.transitionsCheckBox) ThemeWizard.addPage(self.alignmentPage) # Area Position Page self.areaPositionPage = QtGui.QWizardPage() @@ -517,8 +520,8 @@ class Ui_ThemeWizard(object): translate('OpenLP.ThemeWizard', 'Middle')) self.verticalComboBox.setItemText(2, translate('OpenLP.ThemeWizard', 'Bottom')) - self.transitionsCheckBox.setText( - translate('OpenLP.ThemeWizard', 'Transitions')) + self.transitionsLabel.setText( + translate('OpenLP.ThemeWizard', 'Transitions:')) self.areaPositionPage.setTitle( translate('OpenLP.ThemeWizard', 'Output Area Locations')) self.areaPositionPage.setSubTitle( diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 7d8071faa..4590ea739 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -127,7 +127,7 @@ class BibleImportForm(QtGui.QWizard, Ui_BibleImportWizard): """ Stop the import on cancel button, close button or ESC key. """ - log.debug('Import canceled by user.') + log.debug(u'Import canceled by user.') if self.currentPage() == self.importPage: Receiver.send_message(u'bibles_stop_import') self.done(QtGui.QDialog.Rejected) diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index 9f0b6243d..f2797e16d 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -126,7 +126,7 @@ def parse_reference(reference): Returns None or a reference list. """ - log.debug('parse_reference("%s")', reference) + log.debug(u'parse_reference("%s")', reference) match = get_reference_match(u'full').match(reference) if match: log.debug(u'Matched reference %s' % reference) diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 0ff2d999e..5f37f3c73 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -166,7 +166,7 @@ class BibleDB(QtCore.QObject, Manager): """ Stops the import of the Bible. """ - log.debug('Stopping import') + log.debug(u'Stopping import') self.stop_import_flag = True def get_name(self): @@ -430,9 +430,9 @@ class BibleDB(QtCore.QObject, Manager): Utility debugging method to dump the contents of a bible. """ log.debug(u'.........Dumping Bible Database') - log.debug('...............................Books ') + log.debug(u'...............................Books ') books = self.session.query(Book).all() log.debug(books) log.debug(u'...............................Verses ') verses = self.session.query(Verse).all() - log.debug(verses) \ No newline at end of file + log.debug(verses) diff --git a/openlp/plugins/bibles/lib/http.py b/openlp/plugins/bibles/lib/http.py index 07416b965..e0aeafa48 100644 --- a/openlp/plugins/bibles/lib/http.py +++ b/openlp/plugins/bibles/lib/http.py @@ -447,7 +447,7 @@ class HTTPBible(BibleDB): [(u'Genesis', 1, 1, 1), (u'Genesis', 2, 2, 3)] """ for reference in reference_list: - log.debug('Reference: %s', reference) + log.debug(u'Reference: %s', reference) book = reference[0] db_book = self.get_book(book) if not db_book: @@ -522,4 +522,4 @@ class HTTPBible(BibleDB): ``chapter`` The chapter whose verses are being counted. """ - return HTTPBooks.get_verse_count(book, chapter) \ No newline at end of file + return HTTPBooks.get_verse_count(book, chapter) diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 5b359240f..b8ef22b91 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -125,7 +125,7 @@ class OSISBible(BibleDB): verse = int(match.group(3)) verse_text = match.group(4) if not db_book or db_book.name != self.books[book][0]: - log.debug('New book: "%s"', self.books[book][0]) + log.debug(u'New book: "%s"', self.books[book][0]) if book == u'Matt': testament += 1 db_book = self.create_book( @@ -180,4 +180,4 @@ class OSISBible(BibleDB): if self.stop_import_flag: return False else: - return success \ No newline at end of file + return success diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index ecb4fd3e1..672164253 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -133,7 +133,7 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): """ Stop the import on cancel button, close button or ESC key. """ - log.debug('Import canceled by user.') + log.debug(u'Import canceled by user.') if self.currentPage() == self.importPage: Receiver.send_message(u'songs_stop_import') self.done(QtGui.QDialog.Rejected) diff --git a/openlp/plugins/songs/lib/opensongimport.py b/openlp/plugins/songs/lib/opensongimport.py index 3341754c2..6a60fcc6c 100644 --- a/openlp/plugins/songs/lib/opensongimport.py +++ b/openlp/plugins/songs/lib/opensongimport.py @@ -128,7 +128,7 @@ class OpenSongImport(SongImport): numfiles += len(z.infolist()) else: numfiles += 1 - log.debug("Total number of files: %d", numfiles) + log.debug(u'Total number of files: %d', numfiles) self.import_wizard.importProgressBar.setMaximum(numfiles) for filename in self.filenames: if self.stop_import_flag: @@ -159,7 +159,7 @@ class OpenSongImport(SongImport): break else: # not a zipfile - log.info('Direct import %s', filename) + log.info(u'Direct import %s', filename) self.import_wizard.incrementProgressBar( unicode(translate('SongsPlugin.ImportWizardForm', 'Importing %s...')) % os.path.split(filename)[-1]) @@ -306,4 +306,4 @@ class OpenSongImport(SongImport): log.info(u'Got order %s but not in versetags, dropping this' u'item from presentation order', tag) else: - self.verse_order_list.append(tag) \ No newline at end of file + self.verse_order_list.append(tag) From 31721c51d65102139b3e9122a8969fd81a86aec5 Mon Sep 17 00:00:00 2001 From: M2j Date: Tue, 28 Dec 2010 22:24:21 +0100 Subject: [PATCH 09/13] Theme preview resizing for the ThemeWizard --- openlp/core/ui/themeform.py | 21 ++++++++++++++++ openlp/core/ui/themewizard.py | 25 +++++++++----------- openlp/plugins/songs/forms/songimportform.py | 2 +- 3 files changed, 33 insertions(+), 15 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 1eeae8dbe..76e2d240b 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -215,6 +215,25 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.mainLineCountLabel.setText(unicode(translate('OpenLP.ThemeForm', \ '(%d lines per slide)' % int(lines)))) + def resizeEvent(self, event=None): + """ + Rescale the theme preview thumbnail on resize events. + """ + if not event: + event = QtGui.QResizeEvent(self.size(), self.size()) + QtGui.QWizard.resizeEvent(self, event) + if self.currentPage() == self.previewPage: + frameWidth = self.previewBoxLabel.lineWidth() + pixmapWidth = self.previewArea.width() - 2 * frameWidth + pixmapHeight = self.previewArea.height() - 2 * frameWidth + aspectRatio = float(pixmapWidth) / pixmapHeight + if aspectRatio < self.displayAspectRatio: + pixmapHeight = int(pixmapWidth / self.displayAspectRatio + 0.5) + else: + pixmapWidth = int(pixmapHeight * self.displayAspectRatio + 0.5) + self.previewBoxLabel.setFixedSize(pixmapWidth + 2 * frameWidth, + pixmapHeight + 2 * frameWidth) + def onCurrentIdChanged(self, pageId): """ Detects Page changes and updates as approprate. @@ -223,6 +242,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.updateTheme() frame = self.thememanager.generateImage(self.theme) self.previewBoxLabel.setPixmap(QtGui.QPixmap.fromImage(frame)) + self.displayAspectRatio = float(frame.width()) / frame.height() + self.resizeEvent() def onOutlineCheckCheckBoxStateChanged(self, state): """ diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index 9aa27b709..691b5e568 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -363,22 +363,19 @@ class Ui_ThemeWizard(object): self.themeNameEdit.setObjectName(u'ThemeNameEdit') self.themeNameLayout.addRow(self.themeNameLabel, self.themeNameEdit) self.previewLayout.addLayout(self.themeNameLayout) - self.previewPaneLayout = QtGui.QHBoxLayout() - self.previewPaneLayout.setObjectName(u'PreviewPaneLayout') - self.previewPaneLayout.addStretch() - self.previewBoxLabel = QtGui.QLabel(self.previewPage) - sizePolicy = QtGui.QSizePolicy( - QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) - self.previewBoxLabel.setSizePolicy(sizePolicy) - self.previewBoxLabel.setMinimumSize(QtCore.QSize(100, 150)) - self.previewBoxLabel.setFrameShape(QtGui.QFrame.WinPanel) - self.previewBoxLabel.setFrameShadow(QtGui.QFrame.Sunken) - self.previewBoxLabel.setLineWidth(1) + 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.previewPaneLayout.addWidget(self.previewBoxLabel) - self.previewPaneLayout.addStretch() - self.previewLayout.addLayout(self.previewPaneLayout) + self.previewAreaLayout.addWidget(self.previewBoxLabel) + self.previewLayout.addWidget(self.previewArea) ThemeWizard.addPage(self.previewPage) self.retranslateUi(ThemeWizard) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 672164253..1ea7d14ab 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -144,7 +144,7 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): """ if self.currentPage() == self.welcomePage: return True - elif self.currentId() == self.sourcePage: + elif self.currentPage() == self.sourcePage: source_format = self.formatComboBox.currentIndex() if source_format == SongFormat.OpenLP2: if self.openLP2FilenameEdit.text().isEmpty(): From 3ef0098c07653fd0f6c08511f580ada48e18e4cd Mon Sep 17 00:00:00 2001 From: M2j Date: Wed, 29 Dec 2010 17:35:10 +0100 Subject: [PATCH 10/13] fix bug #695136 --- openlp/plugins/songs/forms/songimportform.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 1ea7d14ab..5ec7f45e1 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -272,8 +272,8 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm', 'All Files') filename = QtGui.QFileDialog.getOpenFileName(self, title, - os.path.dirname(SettingsManager.get_last_dir( - self.plugin.settingsSection, 1)), filters) + SettingsManager.get_last_dir(self.plugin.settingsSection, 1), + filters) if filename: editbox.setText(filename) SettingsManager.set_last_dir(self.plugin.settingsSection, @@ -300,8 +300,8 @@ class SongImportForm(QtGui.QWizard, Ui_SongImportWizard): filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm', 'All Files') filenames = QtGui.QFileDialog.getOpenFileNames(self, title, - os.path.dirname(SettingsManager.get_last_dir( - self.plugin.settingsSection, 1)), filters) + SettingsManager.get_last_dir(self.plugin.settingsSection, 1), + filters) if filenames: listbox.addItems(filenames) SettingsManager.set_last_dir( From 74bfde72dc065fda97912795450d554be1f218da Mon Sep 17 00:00:00 2001 From: M2j Date: Thu, 30 Dec 2010 13:02:36 +0100 Subject: [PATCH 11/13] removed '- OpenLP' in ThemeWizard title --- openlp/core/ui/themeform.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 76e2d240b..160914802 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -293,11 +293,10 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): self.themeNameEdit.setVisible(not edit) if edit: self.setWindowTitle(unicode(translate('OpenLP.ThemeWizard', - 'Edit Theme %s - OpenLP')) % self.theme.theme_name) + 'Edit Theme %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(translate('OpenLP.ThemeWizard', - 'New Theme - OpenLP')) + self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) return QtGui.QWizard.exec_(self) def initializePage(self, id): From 599ee1f7fa75feef878e4507445f91ade4df14d0 Mon Sep 17 00:00:00 2001 From: M2j Date: Fri, 31 Dec 2010 03:17:41 +0100 Subject: [PATCH 12/13] Lots of i18n fixes and some others. In detail: translate() expanded for numbered strings MediaManager context menus are using the plugins strings instead of own string manipulations Removed string manipulations from ThemeManager and fixed the delete validation Added disambiguation for some plugin strings to distinguish between name plural and container title Added or repaired translate() calls at several positions. --- openlp/core/lib/__init__.py | 7 +-- openlp/core/lib/mediamanageritem.py | 16 +++---- openlp/core/ui/exceptionform.py | 6 ++- openlp/core/ui/generaltab.py | 10 ++--- openlp/core/ui/themeform.py | 8 ++-- openlp/core/ui/thememanager.py | 36 ++++++++------- openlp/plugins/alerts/alertsplugin.py | 8 ++-- openlp/plugins/bibles/bibleplugin.py | 45 +++++++++---------- openlp/plugins/bibles/lib/csvbible.py | 9 ++-- openlp/plugins/bibles/lib/mediaitem.py | 4 +- openlp/plugins/bibles/lib/openlp1.py | 6 +-- openlp/plugins/bibles/lib/opensong.py | 9 ++-- openlp/plugins/bibles/lib/osis.py | 9 ++-- openlp/plugins/custom/customplugin.py | 24 +++++----- openlp/plugins/images/imageplugin.py | 8 ++-- openlp/plugins/images/lib/mediaitem.py | 4 +- openlp/plugins/media/lib/mediaitem.py | 9 ++-- openlp/plugins/media/mediaplugin.py | 22 ++++----- openlp/plugins/presentations/lib/mediaitem.py | 6 +-- .../presentations/presentationplugin.py | 21 +++++---- openlp/plugins/remotes/remoteplugin.py | 8 ++-- .../songs/forms/songmaintenanceform.py | 41 ++++++++--------- openlp/plugins/songs/lib/cclifileimport.py | 8 ++-- openlp/plugins/songs/lib/mediaitem.py | 15 +++---- openlp/plugins/songs/lib/olpimport.py | 8 ++-- openlp/plugins/songs/lib/songbeamerimport.py | 14 +++--- openlp/plugins/songs/songsplugin.py | 20 ++++----- .../songusage/forms/songusagedetailform.py | 5 ++- openlp/plugins/songusage/songusageplugin.py | 11 +++-- 29 files changed, 201 insertions(+), 196 deletions(-) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 99255c6ee..ebbe31597 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -84,7 +84,8 @@ html_expands.append({u'desc': u'Underline', u'start tag': u'{u}', u'start html': u'', u'end tag': u'{/u}', u'end html': u'', u'protected': True}) -def translate(context, text, comment=None): +def translate(context, text, comment=None, + encoding=QtCore.QCoreApplication.CodecForTr, n=-1): """ A special shortcut method to wrap around the Qt4 translation functions. This abstracts the translation procedure so that we can change it if at a @@ -101,7 +102,7 @@ def translate(context, text, comment=None): An identifying string for when the same text is used in different roles within the same context. """ - return QtCore.QCoreApplication.translate(context, text, comment) + return QtCore.QCoreApplication.translate(context, text, comment, encoding, n) def get_text_file_string(text_file): """ @@ -325,4 +326,4 @@ from dockwidget import OpenLPDockWidget from renderer import Renderer from rendermanager import RenderManager from mediamanageritem import MediaManagerItem -from baselistwithdnd import BaseListWithDnD \ No newline at end of file +from baselistwithdnd import BaseListWithDnD diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 50e43afd0..7991135f7 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -284,34 +284,30 @@ class MediaManagerItem(QtGui.QWidget): self.listView.addAction( context_menu_action( self.listView, u':/general/general_edit.png', - unicode(translate('OpenLP.MediaManagerItem', '&Edit %s')) % - name_string[u'singular'], + self.plugin.getString(StringContent.Edit)[u'title'], self.onEditClick)) self.listView.addAction(context_menu_separator(self.listView)) if self.hasDeleteIcon: self.listView.addAction( context_menu_action( self.listView, u':/general/general_delete.png', - unicode(translate('OpenLP.MediaManagerItem', - '&Delete %s')) % - name_string[u'singular'], + self.plugin.getString(StringContent.Delete)[u'title'], self.onDeleteClick)) self.listView.addAction(context_menu_separator(self.listView)) self.listView.addAction( context_menu_action( self.listView, u':/general/general_preview.png', - unicode(translate('OpenLP.MediaManagerItem', '&Preview %s')) % - name_string[u'singular'], + self.plugin.getString(StringContent.Preview)[u'title'], self.onPreviewClick)) self.listView.addAction( context_menu_action( self.listView, u':/general/general_live.png', - translate('OpenLP.MediaManagerItem', '&Show Live'), + self.plugin.getString(StringContent.Live)[u'title'], self.onLiveClick)) self.listView.addAction( context_menu_action( self.listView, u':/general/general_add.png', - translate('OpenLP.MediaManagerItem', '&Add to Service'), + self.plugin.getString(StringContent.Service)[u'title'], self.onAddClick)) if self.addToServiceItem: self.listView.addAction( @@ -544,4 +540,4 @@ class MediaManagerItem(QtGui.QWidget): Method to add processing when a service has been loaded and individual service items need to be processed by the plugins """ - pass \ No newline at end of file + pass diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 90a54e12e..3272c7af9 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -135,7 +135,9 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): '--- Please enter the report below this line. ---\n\n\n' '--- Exception Traceback ---\n%s\n' '--- System information ---\n%s\n' - '--- Library Versions ---\n%s\n')) + '--- Library Versions ---\n%s\n', + 'Please add the information that bug reports are favoured written ' + 'in English.')) content = self._createReport() for line in content[1].split(u'\n'): if re.search(r'[/\\]openlp[/\\]', line): @@ -144,4 +146,4 @@ class ExceptionForm(QtGui.QDialog, Ui_ExceptionDialog): exception = line.split(u'\n')[-1].split(u':')[0] subject = u'Bug report: %s in %s' % (exception, source) mailto(address=u'bugs@openlp.org', subject=subject, - body=body % content) \ No newline at end of file + body=body % content) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 8c56648c8..6d98d0858 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -389,11 +389,11 @@ class GeneralTab(SettingsTab): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) for screen in self.screens.screen_list: - screen_name = u'%s %d' % (translate('OpenLP.GeneralTab', 'Screen'), - screen[u'number'] + 1) + screen_name = unicode(translate('OpenLP.GeneralTab', 'Screen %d')) \ + % (screen[u'number'] + 1) if screen[u'primary']: - screen_name = u'%s (%s)' % (screen_name, - translate('OpenLP.GeneralTab', 'primary')) + screen_name = unicode(translate('OpenLP.GeneralTab', + '%s (primary)')) % screen_name self.monitorComboBox.addItem(screen_name) self.numberEdit.setText(unicode(settings.value( u'ccli number', QtCore.QVariant(u'')).toString())) @@ -530,4 +530,4 @@ class GeneralTab(SettingsTab): """ Called when the width, height, x position or y position has changed. """ - self.overrideChanged = True \ No newline at end of file + self.overrideChanged = True diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index c7854e187..44720cbcc 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -586,8 +586,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): QtGui.QMessageBox.critical(self, translate('OpenLP.ThemeForm', 'Theme Name Missing'), translate('OpenLP.ThemeForm', - 'There is no name for this theme. ' - 'Please enter one.'), + 'There is no name for this theme. Please enter one.'), (QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) return @@ -595,8 +594,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): QtGui.QMessageBox.critical(self, translate('OpenLP.ThemeForm', 'Theme Name Invalid'), translate('OpenLP.ThemeForm', - 'Invalid theme name. ' - 'Please enter one.'), + 'Invalid theme name. Please enter one.'), (QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) return @@ -620,4 +618,4 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): QtGui.QColor(field), self) if new_color.isValid(): field = new_color.name() - return field \ No newline at end of file + return field diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 82d7c4b0e..584edf909 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -223,8 +223,11 @@ class ThemeManager(QtGui.QWidget): """ Renames an existing theme to a new name """ - action = unicode(translate('OpenLP.ThemeManager', 'Rename')) - if self._validate_theme_action(action, False): + if self._validate_theme_action(unicode(translate('OpenLP.ThemeManager', + 'You must select a theme to rename.')), + unicode(translate('OpenLP.ThemeManager', 'Rename Confirmation')), + unicode(translate('OpenLP.ThemeManager', 'Rename %s theme?')), + False): item = self.themeListWidget.currentItem() oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) self.fileRenameForm.fileNameEdit.setText(oldThemeName) @@ -288,8 +291,10 @@ class ThemeManager(QtGui.QWidget): """ Delete a theme """ - action = unicode(translate('OpenLP.ThemeManager', 'Delete')) - if self._validate_theme_action(action): + if self._validate_theme_action(unicode(translate('OpenLP.ThemeManager', + 'You must select a theme to delete.')), + unicode(translate('OpenLP.ThemeManager', 'Delete Confirmation')), + unicode(translate('OpenLP.ThemeManager', 'Delete %s theme?'))): item = self.themeListWidget.currentItem() theme = unicode(item.text()) row = self.themeListWidget.row(item) @@ -750,7 +755,8 @@ class ThemeManager(QtGui.QWidget): theme.extend_image_filename(path) return theme - def _validate_theme_action(self, action, testPlugin=True): + def _validate_theme_action(self, select_text, confirm_title, confirm_text, + testPlugin=True): """ Check to see if theme has been selected and the destructive action is allowed. @@ -758,19 +764,14 @@ class ThemeManager(QtGui.QWidget): self.global_theme = unicode(QtCore.QSettings().value( self.settingsSection + u'/global theme', QtCore.QVariant(u'')).toString()) - if check_item_selected(self.themeListWidget, - unicode(translate('OpenLP.ThemeManager', - 'You must select a theme to %s.')) % action): + if check_item_selected(self.themeListWidget, select_text): item = self.themeListWidget.currentItem() theme = unicode(item.text()) # confirm deletion - answer = QtGui.QMessageBox.question(self, - unicode(translate('OpenLP.ThemeManager', '%s Confirmation')) - % action, - unicode(translate('OpenLP.ThemeManager', '%s %s theme?')) - % (action, theme), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes | - QtGui.QMessageBox.No), QtGui.QMessageBox.No) + answer = QtGui.QMessageBox.question(self, confirm_title, + confirm_text % theme, QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), + QtGui.QMessageBox.No) if answer == QtGui.QMessageBox.No: return False # should be the same unless default @@ -779,6 +780,7 @@ class ThemeManager(QtGui.QWidget): translate('OpenLP.ThemeManager', 'Error'), translate('OpenLP.ThemeManager', 'You are unable to delete the default theme.')) + return False else: if testPlugin: for plugin in self.parent.pluginManager.plugins: @@ -795,4 +797,6 @@ class ThemeManager(QtGui.QWidget): unicode(translate('OpenLP.ThemeManager', 'Theme %s is used by the service manager.')) % theme) return False - return True \ No newline at end of file + else: + return False + return True diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 277a3903a..4a7e18cef 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -114,10 +114,10 @@ class AlertsPlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('AlertsPlugin', 'Alert'), - u'plural': translate('AlertsPlugin', 'Alerts') + u'singular': translate('AlertsPlugin', 'Alert', 'name singular'), + u'plural': translate('AlertsPlugin', 'Alerts', 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('AlertsPlugin', 'Alerts') - } \ No newline at end of file + u'title': translate('AlertsPlugin', 'Alerts', 'container title') + } diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 3e8dc82ee..15181e871 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -126,53 +126,48 @@ class BiblePlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('BiblesPlugin', 'Bible'), - u'plural': translate('BiblesPlugin', 'Bibles') + u'singular': translate('BiblesPlugin', 'Bible', 'name singular'), + u'plural': translate('BiblesPlugin', 'Bibles', 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('BiblesPlugin', 'Bibles') + u'title': translate('BiblesPlugin', 'Bibles', 'container title') } # Middle Header Bar - ## Import Button ## + ## Import Action ## self.textStrings[StringContent.Import] = { - u'title': translate('BiblesPlugin', 'Import'), - u'tooltip': translate('BiblesPlugin', - 'Import a Bible') + u'title': translate('BiblesPlugin', '&Import'), + u'tooltip': translate('BiblesPlugin', 'Import a Bible') } - ## New Button ## + ## New Action ## self.textStrings[StringContent.New] = { - u'title': translate('BiblesPlugin', 'Add'), - u'tooltip': translate('BiblesPlugin', - 'Add a new Bible') + u'title': translate('BiblesPlugin', '&Add'), + u'tooltip': translate('BiblesPlugin', 'Add a new Bible') } - ## Edit Button ## + ## Edit Action ## self.textStrings[StringContent.Edit] = { - u'title': translate('BiblesPlugin', 'Edit'), - u'tooltip': translate('BiblesPlugin', - 'Edit the selected Bible') + u'title': translate('BiblesPlugin', '&Edit'), + u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible') } - ## Delete Button ## + ## Delete Action ## self.textStrings[StringContent.Delete] = { - u'title': translate('BiblesPlugin', 'Delete'), - u'tooltip': translate('BiblesPlugin', - 'Delete the selected Bible') + u'title': translate('BiblesPlugin', '&Delete'), + u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible') } - ## Preview ## + ## Preview Action ## self.textStrings[StringContent.Preview] = { u'title': translate('BiblesPlugin', 'Preview'), - u'tooltip': translate('BiblesPlugin', - 'Preview the selected Bible') + u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible') } - ## Live Button ## + ## Send Live Action ## self.textStrings[StringContent.Live] = { u'title': translate('BiblesPlugin', 'Live'), u'tooltip': translate('BiblesPlugin', 'Send the selected Bible live') } - ## Add to service Button ## + ## Add to Service Action ## self.textStrings[StringContent.Service] = { u'title': translate('BiblesPlugin', 'Service'), u'tooltip': translate('BiblesPlugin', 'Add the selected Bible to the service') - } \ No newline at end of file + } diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index b6cd81bf5..143b427fb 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -92,9 +92,10 @@ class CSVBible(BibleDB): if book_ptr != line[0]: book = self.get_book(line[0]) book_ptr = book.name - self.wizard.incrementProgressBar(u'%s %s %s...' % ( - translate('BiblesPlugin.CSVImport', 'Importing'), - book.name, line[1])) + self.wizard.incrementProgressBar(unicode(translate( + 'BiblesPlugin.CSVImport', 'Importing %s %s...', + 'Importing ...')) % + (book.name, int(line[1]))) self.session.commit() self.create_verse(book.id, line[1], line[2], unicode(line[3], details['encoding'])) @@ -109,4 +110,4 @@ class CSVBible(BibleDB): if self.stop_import_flag: return False else: - return success \ No newline at end of file + return success diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 20fa9e1f6..3f5ed41e4 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -912,7 +912,7 @@ class BibleMediaItem(MediaManagerItem): old_chapter != chapter: verse_text = unicode(chapter) + verse_separator + unicode(verse) else: - verse_text = u'%s' % verse + verse_text = unicode(verse) if self.parent.settings_tab.display_style == 1: verse_text = u'{su}(' + verse_text + u'){/su}' elif self.parent.settings_tab.display_style == 2: @@ -921,4 +921,4 @@ class BibleMediaItem(MediaManagerItem): verse_text = u'{su}[' + verse_text + u']{/su}' else: verse_text = u'{su}' + verse_text + u'{/su}' - return verse_text \ No newline at end of file + return verse_text diff --git a/openlp/plugins/bibles/lib/openlp1.py b/openlp/plugins/bibles/lib/openlp1.py index 41f4a2836..866652e5b 100644 --- a/openlp/plugins/bibles/lib/openlp1.py +++ b/openlp/plugins/bibles/lib/openlp1.py @@ -73,8 +73,8 @@ class OpenLP1Bible(BibleDB): abbreviation = unicode(book[3], u'cp1252') self.create_book(name, abbreviation, testament_id) # Update the progess bar. - self.wizard.incrementProgressBar(u'%s %s...' % (translate( - 'BiblesPlugin.OpenLP1Import', 'Importing'), name)) + self.wizard.incrementProgressBar(unicode(translate( + 'BiblesPlugin.OpenLP1Import', 'Importing %s...')) % name) # Import the verses for this book. cursor.execute(u'SELECT chapter, verse, text || \'\' AS text FROM ' 'verse WHERE book_id=%s' % book_id) @@ -90,4 +90,4 @@ class OpenLP1Bible(BibleDB): Receiver.send_message(u'openlp_process_events') self.session.commit() connection.close() - return True \ No newline at end of file + return True diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 241efbc0e..0d02cf11f 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -84,9 +84,10 @@ class OpenSongBible(BibleDB): unicode(verse.text) ) Receiver.send_message(u'openlp_process_events') - self.wizard.incrementProgressBar(u'%s %s %s...' % ( - translate('BiblesPlugin.Opensong', 'Importing'), - db_book.name, chapter.attrib[u'n'])) + self.wizard.incrementProgressBar(unicode(translate( + 'BiblesPlugin.Opensong', 'Importing %s %s...', + 'Importing ...')) % + (db_book.name, int(chapter.attrib[u'n']))) self.session.commit() except IOError: log.exception(u'Loading bible from OpenSong file failed') @@ -97,4 +98,4 @@ class OpenSongBible(BibleDB): if self.stop_import_flag: return False else: - return success \ No newline at end of file + return success diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index 5b359240f..8bf2462ac 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -140,9 +140,10 @@ class OSISBible(BibleDB): if last_chapter != chapter: if last_chapter != 0: self.session.commit() - self.wizard.incrementProgressBar(u'%s %s %s...' % ( - translate('BiblesPlugin.OsisImport', 'Importing'), - self.books[match.group(1)][0], chapter)) + self.wizard.incrementProgressBar(unicode(translate( + 'BiblesPlugin.OsisImport', 'Importing %s %s...', + 'Importing ...')) % + (self.books[match.group(1)][0], chapter)) last_chapter = chapter # All of this rigmarol below is because the mod2osis # tool from the Sword library embeds XML in the OSIS @@ -180,4 +181,4 @@ class OSISBible(BibleDB): if self.stop_import_flag: return False else: - return success \ No newline at end of file + return success diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index 9580077a8..54cb38501 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -104,57 +104,57 @@ class CustomPlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('CustomsPlugin', 'Custom'), - u'plural': translate('CustomsPlugin', 'Customs') + u'singular': translate('CustomsPlugin', 'Custom', 'name singular'), + u'plural': translate('CustomsPlugin', 'Customs', 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('CustomsPlugin', 'Custom') + u'title': translate('CustomsPlugin', 'Custom', 'container title') } # Middle Header Bar - ## Import Button ## + ## Import Action ## self.textStrings[StringContent.Import] = { u'title': translate('CustomsPlugin', 'Import'), u'tooltip': translate('CustomsPlugin', 'Import a Custom') } - ## Load Button ## + ## Load Action ## self.textStrings[StringContent.Load] = { u'title': translate('CustomsPlugin', 'Load'), u'tooltip': translate('CustomsPlugin', 'Load a new Custom') } - ## New Button ## + ## New Action ## self.textStrings[StringContent.New] = { u'title': translate('CustomsPlugin', 'Add'), u'tooltip': translate('CustomsPlugin', 'Add a new Custom') } - ## Edit Button ## + ## Edit Action ## self.textStrings[StringContent.Edit] = { u'title': translate('CustomsPlugin', 'Edit'), u'tooltip': translate('CustomsPlugin', 'Edit the selected Custom') } - ## Delete Button ## + ## Delete Action ## self.textStrings[StringContent.Delete] = { u'title': translate('CustomsPlugin', 'Delete'), u'tooltip': translate('CustomsPlugin', 'Delete the selected Custom') } - ## Preview ## + ## Preview Action ## self.textStrings[StringContent.Preview] = { u'title': translate('CustomsPlugin', 'Preview'), u'tooltip': translate('CustomsPlugin', 'Preview the selected Custom') } - ## Live Button ## + ## Send Live Action ## self.textStrings[StringContent.Live] = { u'title': translate('CustomsPlugin', 'Live'), u'tooltip': translate('CustomsPlugin', 'Send the selected Custom live') } - ## Add to service Button ## + ## Add to Service Action ## self.textStrings[StringContent.Service] = { u'title': translate('CustomsPlugin', 'Service'), u'tooltip': translate('CustomsPlugin', @@ -167,4 +167,4 @@ class CustomPlugin(Plugin): """ log.info(u'Custom Finalising') self.manager.finalise() - Plugin.finalise(self) \ No newline at end of file + Plugin.finalise(self) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 4bd7783ee..79b08eb8c 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -64,12 +64,12 @@ class ImagePlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('ImagePlugin', 'Image'), - u'plural': translate('ImagePlugin', 'Images') + u'singular': translate('ImagePlugin', 'Image', 'name singular'), + u'plural': translate('ImagePlugin', 'Images', 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('ImagePlugin', 'Images') + u'title': translate('ImagePlugin', 'Images', 'container title') } # Middle Header Bar ## Load Button ## @@ -113,4 +113,4 @@ class ImagePlugin(Plugin): u'title': translate('ImagePlugin', 'Service'), u'tooltip': translate('ImagePlugin', 'Add the selected Image to the service') - } \ No newline at end of file + } diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index fabad8e8c..9be08df4b 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -109,7 +109,7 @@ class ImageMediaItem(MediaManagerItem): translate('ImagePlugin.MediaItem', 'Replace Live Background'), self.onReplaceClick, False) self.resetButton = self.toolbar.addToolbarButton( - translate('ImagePlugin.MediaItem', u'Reset Background'), + translate('ImagePlugin.MediaItem', 'Reset Background'), u':/system/system_close.png', translate('ImagePlugin.MediaItem', 'Reset Live Background'), self.onResetClick, False) @@ -195,4 +195,4 @@ class ImageMediaItem(MediaManagerItem): self.resetButton.setVisible(True) def onPreviewClick(self): - MediaManagerItem.onPreviewClick(self) \ No newline at end of file + MediaManagerItem.onPreviewClick(self) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index e2309ea76..bf4aac918 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -60,10 +60,9 @@ class MediaMediaItem(MediaManagerItem): def retranslateUi(self): self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media') - self.OnNewFileMasks = translate('MediaPlugin.MediaItem', - u'Videos (%s);;' - u'Audio (%s);;' - u'All files (*)' % (self.parent.video_list, self.parent.audio_list)) + self.OnNewFileMasks = unicode(translate('MediaPlugin.MediaItem', + 'Videos (%s);;Audio (%s);;All files (*)')) % \ + (self.parent.video_list, self.parent.audio_list) def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -159,4 +158,4 @@ class MediaMediaItem(MediaManagerItem): img = QtGui.QPixmap(u':/media/media_video.png').toImage() item_name.setIcon(build_icon(img)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) - self.listView.addItem(item_name) \ No newline at end of file + self.listView.addItem(item_name) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 2f5b78b8e..920f703f2 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -93,53 +93,53 @@ class MediaPlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('MediaPlugin', 'Media'), - u'plural': translate('MediaPlugin', 'Media') + u'singular': translate('MediaPlugin', 'Media', 'name singular'), + u'plural': translate('MediaPlugin', 'Media', 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('MediaPlugin', 'Media') + u'title': translate('MediaPlugin', 'Media', 'container title') } # Middle Header Bar - ## Load Button ## + ## Load Action ## self.textStrings[StringContent.Load] = { u'title': translate('MediaPlugin', 'Load'), u'tooltip': translate('MediaPlugin', 'Load a new Media') } - ## New Button ## + ## New Action ## self.textStrings[StringContent.New] = { u'title': translate('MediaPlugin', 'Add'), u'tooltip': translate('MediaPlugin', 'Add a new Media') } - ## Edit Button ## + ## Edit Action ## self.textStrings[StringContent.Edit] = { u'title': translate('MediaPlugin', 'Edit'), u'tooltip': translate('MediaPlugin', 'Edit the selected Media') } - ## Delete Button ## + ## Delete Action ## self.textStrings[StringContent.Delete] = { u'title': translate('MediaPlugin', 'Delete'), u'tooltip': translate('MediaPlugin', 'Delete the selected Media') } - ## Preview ## + ## Preview Action ## self.textStrings[StringContent.Preview] = { u'title': translate('MediaPlugin', 'Preview'), u'tooltip': translate('MediaPlugin', 'Preview the selected Media') } - ## Live Button ## + ## Send Live Action ## self.textStrings[StringContent.Live] = { u'title': translate('MediaPlugin', 'Live'), u'tooltip': translate('MediaPlugin', 'Send the selected Media live') } - ## Add to service Button ## + ## Add to Service Action ## self.textStrings[StringContent.Service] = { u'title': translate('MediaPlugin', 'Service'), u'tooltip': translate('MediaPlugin', 'Add the selected Media to the service') - } \ No newline at end of file + } diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 4b1067e8e..a7739fa55 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -90,8 +90,8 @@ class PresentationMediaItem(MediaManagerItem): if fileType.find(type) == -1: fileType += u'*.%s ' % type self.parent.serviceManager.supportedSuffixes(type) - self.OnNewFileMasks = translate('PresentationPlugin.MediaItem', - 'Presentations (%s)' % fileType) + self.OnNewFileMasks = unicode(translate('PresentationPlugin.MediaItem', + 'Presentations (%s)')) % fileType def requiredIcons(self): """ @@ -293,4 +293,4 @@ class PresentationMediaItem(MediaManagerItem): if self.controllers[controller].enabled(): if filetype in self.controllers[controller].alsosupports: return controller - return None \ No newline at end of file + return None diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 9c4a64866..8afed6022 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -152,41 +152,44 @@ class PresentationPlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('PresentationPlugin', 'Presentation'), - u'plural': translate('PresentationPlugin', 'Presentations') + u'singular': translate('PresentationPlugin', 'Presentation', + 'name singular'), + u'plural': translate('PresentationPlugin', 'Presentations', + 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('PresentationPlugin', 'Presentations') + u'title': translate('PresentationPlugin', 'Presentations', + 'container title') } # Middle Header Bar - ## Load Button ## + ## Load Action ## self.textStrings[StringContent.Load] = { u'title': translate('PresentationPlugin', 'Load'), u'tooltip': translate('PresentationPlugin', 'Load a new Presentation') } - ## Delete Button ## + ## Delete Action ## self.textStrings[StringContent.Delete] = { u'title': translate('PresentationPlugin', 'Delete'), u'tooltip': translate('PresentationPlugin', 'Delete the selected Presentation') } - ## Preview ## + ## Preview Action ## self.textStrings[StringContent.Preview] = { u'title': translate('PresentationPlugin', 'Preview'), u'tooltip': translate('PresentationPlugin', 'Preview the selected Presentation') } - ## Live Button ## + ## Send Live Action ## self.textStrings[StringContent.Live] = { u'title': translate('PresentationPlugin', 'Live'), u'tooltip': translate('PresentationPlugin', 'Send the selected Presentation live') } - ## Add to service Button ## + ## Add to Service Action ## self.textStrings[StringContent.Service] = { u'title': translate('PresentationPlugin', 'Service'), u'tooltip': translate('PresentationPlugin', 'Add the selected Presentation to the service') - } \ No newline at end of file + } diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 419a51a72..dbc56a61c 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -84,10 +84,10 @@ class RemotesPlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('RemotePlugin', 'Remote'), - u'plural': translate('RemotePlugin', 'Remotes') + u'singular': translate('RemotePlugin', 'Remote', 'name singular'), + u'plural': translate('RemotePlugin', 'Remotes', 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('RemotePlugin', 'Remote') - } \ No newline at end of file + u'title': translate('RemotePlugin', 'Remote', 'container title') + } diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 0fcdc6ab1..0364a4df4 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -109,7 +109,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): author_name = QtGui.QListWidgetItem(author.display_name) else: author_name = QtGui.QListWidgetItem( - u'%s %s' % (author.first_name, author.last_name)) + u' '.join(author.first_name, author.last_name)) author_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(author.id)) self.AuthorsListWidget.addItem(author_name) if self.AuthorsListWidget.count() == 0: @@ -305,12 +305,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): 'Could not save your changes.')) elif QtGui.QMessageBox.critical(self, translate('SongsPlugin.SongMaintenanceForm', 'Error'), - translate('SongsPlugin.SongMaintenanceForm', 'The author %s' - ' already exists. Would you like to make songs with author ' - '%s use the existing author %s?' % (author.display_name, - temp_display_name, author.display_name)), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | - QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes: + unicode(translate('SongsPlugin.SongMaintenanceForm', + 'The author %s already exists. Would you like to make songs' + ' with author %s use the existing author %s?')) % + (author.display_name, temp_display_name, + author.display_name), QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)) == \ + QtGui.QMessageBox.Yes: self.mergeAuthors(author) self.resetAuthors() Receiver.send_message(u'songs_load_list') @@ -346,12 +347,12 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): 'Could not save your changes.')) elif QtGui.QMessageBox.critical(self, translate('SongsPlugin.SongMaintenanceForm', 'Error'), - translate('SongsPlugin.SongMaintenanceForm', 'The topic %s ' - 'already exists. Would you like to make songs with topic %s' - ' use the existing topic %s?' % (topic.name, temp_name, - topic.name)), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | - QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes: + unicode(translate('SongsPlugin.SongMaintenanceForm', + 'The topic %s already exists. Would you like to make songs ' + 'with topic %s use the existing topic %s?')) % (topic.name, + temp_name, topic.name), QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)) == \ + QtGui.QMessageBox.Yes: self.mergeTopics(topic) self.resetTopics() else: @@ -389,12 +390,12 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): 'Could not save your changes.')) elif QtGui.QMessageBox.critical(self, translate('SongsPlugin.SongMaintenanceForm', 'Error'), - translate('SongsPlugin.SongMaintenanceForm', 'The book %s ' - 'already exists. Would you like to make songs with book %s ' - 'use the existing book %s?' % (book.name, temp_name, - book.name)), - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | - QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes: + unicode(translate('SongsPlugin.SongMaintenanceForm', + 'The book %s already exists. Would you like to make songs ' + 'with book %s use the existing book %s?')) % (book.name, + temp_name, book.name), QtGui.QMessageBox.StandardButtons( + QtGui.QMessageBox.No | QtGui.QMessageBox.Yes)) == \ + QtGui.QMessageBox.Yes: self.mergeBooks(book) self.resetBooks() else: @@ -498,4 +499,4 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): translate('SongsPlugin.SongMaintenanceForm', 'This book cannot be deleted, it is currently ' 'assigned to at least one song.'), - translate('SongsPlugin.SongMaintenanceForm', 'No book selected!')) \ No newline at end of file + translate('SongsPlugin.SongMaintenanceForm', 'No book selected!')) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 79a7260bb..98e4be51e 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -29,6 +29,7 @@ import os import chardet import codecs +from openlp.core.lib import translate from songimport import SongImport log = logging.getLogger(__name__) @@ -69,8 +70,9 @@ class CCLIFileImport(SongImport): self.import_wizard.importProgressBar.setMaximum(song_total) song_count = 1 for filename in self.filenames: - self.import_wizard.incrementProgressBar( - u'Importing song %s of %s' % (song_count, song_total)) + self.import_wizard.incrementProgressBar(unicode(translate( + 'SongsPlugin.CCLIFileImport', 'Importing song %d of %d')) % + (song_count, song_total)) filename = unicode(filename) log.debug(u'Importing CCLI File: %s', filename) lines = [] @@ -337,4 +339,4 @@ class CCLIFileImport(SongImport): self.copyright = song_copyright self.ccli_number = song_ccli self.comments = song_comments - self.finish() \ No newline at end of file + self.finish() diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 3be60dec4..6521aa5cd 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -235,7 +235,7 @@ class SongMediaItem(MediaManagerItem): self.listView.clear() for author in searchresults: for song in author.songs: - song_detail = '%s (%s)' % (author.display_name, song.title) + song_detail = u'%s (%s)' % (author.display_name, song.title) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) self.listView.addItem(song_name) @@ -315,16 +315,11 @@ class SongMediaItem(MediaManagerItem): translate('SongsPlugin.MediaItem', 'You must select an item to delete.')): items = self.listView.selectedIndexes() - if len(items) == 1: - del_message = translate('SongsPlugin.MediaItem', - 'Are you sure you want to delete the selected song?') - else: - del_message = unicode(translate('SongsPlugin.MediaItem', - 'Are you sure you want to delete the %d selected ' - 'songs?')) % len(items) ans = QtGui.QMessageBox.question(self, translate('SongsPlugin.MediaItem', 'Delete Song(s)?'), - del_message, + translate('SongsPlugin.MediaItem', + 'Are you sure you want to delete the %n selected song(s)?', '', + QtCore.QCoreApplication.CodecForTr, len(items)), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok| QtGui.QMessageBox.Cancel), QtGui.QMessageBox.Ok) @@ -457,4 +452,4 @@ class SongMediaItem(MediaManagerItem): """ Locale aware collation of song titles """ - return locale.strcoll(unicode(song_1.title), unicode(song_2.title)) \ No newline at end of file + return locale.strcoll(unicode(song_1.title), unicode(song_2.title)) diff --git a/openlp/plugins/songs/lib/olpimport.py b/openlp/plugins/songs/lib/olpimport.py index b0175d45f..e366ddf4b 100644 --- a/openlp/plugins/songs/lib/olpimport.py +++ b/openlp/plugins/songs/lib/olpimport.py @@ -34,6 +34,7 @@ from sqlalchemy.orm import class_mapper, mapper, relation, scoped_session, \ sessionmaker from sqlalchemy.orm.exc import UnmappedClassError +from openlp.core.lib import translate from openlp.core.lib.db import BaseModel from openlp.plugins.songs.lib.db import Author, Book, Song, Topic #, MediaFile from songimport import SongImport @@ -148,8 +149,9 @@ class OpenLPSongImport(SongImport): self.import_wizard.importProgressBar.setMaximum(song_total) song_count = 1 for song in source_songs: - self.import_wizard.incrementProgressBar( - u'Importing song %s of %s' % (song_count, song_total)) + self.import_wizard.incrementProgressBar(unicode(translate( + 'SongsPlugin.OpenLPSongImport', 'Importing song %d of %d.')) % + (song_count, song_total)) new_song = Song() new_song.title = song.title if has_media_files and hasattr(song, 'alternate_title'): @@ -220,4 +222,4 @@ class OpenLPSongImport(SongImport): if self.stop_import_flag: return False engine.dispose() - return True \ No newline at end of file + return True diff --git a/openlp/plugins/songs/lib/songbeamerimport.py b/openlp/plugins/songs/lib/songbeamerimport.py index 29884b80c..a69aa0bc1 100644 --- a/openlp/plugins/songs/lib/songbeamerimport.py +++ b/openlp/plugins/songs/lib/songbeamerimport.py @@ -126,17 +126,17 @@ class SongBeamerImport(SongImport): if verse_start: verse_start = False if not self.check_verse_marks(line): - self.current_verse = u'%s\n' % line + self.current_verse = line + u'\n' else: - self.current_verse += u'%s\n' % line + self.current_verse += line + u'\n' if self.current_verse: self.replace_html_tags() self.add_verse(self.current_verse, self.current_verse_type) if self.check_complete(): self.finish() - self.import_wizard.incrementProgressBar(u'%s %s...' % - (translate('SongsPlugin.SongBeamerImport', 'Importing'), - self.file_name)) + self.import_wizard.incrementProgressBar(unicode(translate( + 'SongsPlugin.SongBeamerImport', 'Importing %s...')) % + self.file_name) return True def replace_html_tags(self): @@ -252,7 +252,7 @@ class SongBeamerImport(SongImport): elif tag_val[0] == u'#TextAlign': pass elif tag_val[0] == u'#Title': - self.title = u'%s' % tag_val[1] + self.title = unicode(tag_val[1]) elif tag_val[0] == u'#TitleAlign': pass elif tag_val[0] == u'#TitleFontSize': @@ -292,4 +292,4 @@ class SongBeamerImport(SongImport): self.current_verse_type += marks[1] return True else: - return False \ No newline at end of file + return False diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index a44188c87..545497acb 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -213,45 +213,45 @@ class SongsPlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('SongsPlugin', 'Song'), - u'plural': translate('SongsPlugin', 'Songs') + u'singular': translate('SongsPlugin', 'Song', 'name singular'), + u'plural': translate('SongsPlugin', 'Songs', 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('SongsPlugin', 'Songs') + u'title': translate('SongsPlugin', 'Songs', 'container title') } # Middle Header Bar - ## New Button ## + ## New Action ## self.textStrings[StringContent.New] = { u'title': translate('SongsPlugin', 'Add'), u'tooltip': translate('SongsPlugin', 'Add a new Song') } - ## Edit Button ## + ## Edit Action ## self.textStrings[StringContent.Edit] = { u'title': translate('SongsPlugin', 'Edit'), u'tooltip': translate('SongsPlugin', 'Edit the selected Song') } - ## Delete Button ## + ## Delete Action ## self.textStrings[StringContent.Delete] = { u'title': translate('SongsPlugin', 'Delete'), u'tooltip': translate('SongsPlugin', 'Delete the selected Song') } - ## Preview ## + ## Preview Action ## self.textStrings[StringContent.Preview] = { u'title': translate('SongsPlugin', 'Preview'), u'tooltip': translate('SongsPlugin', 'Preview the selected Song') } - ## Live Button ## + ## Send Live Action ## self.textStrings[StringContent.Live] = { u'title': translate('SongsPlugin', 'Live'), u'tooltip': translate('SongsPlugin', 'Send the selected Song live') } - ## Add to service Button ## + ## Add to Service Action ## self.textStrings[StringContent.Service] = { u'title': translate('SongsPlugin', 'Service'), u'tooltip': translate('SongsPlugin', @@ -265,4 +265,4 @@ class SongsPlugin(Plugin): log.info(u'Songs Finalising') self.manager.finalise() self.toolsReindexItem.setVisible(False) - Plugin.finalise(self) \ No newline at end of file + Plugin.finalise(self) diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index c9c357a84..8588ddcff 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -73,7 +73,8 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): def accept(self): log.debug(u'Detailed report generated') - filename = u'usage_detail_%s_%s.txt' % ( + filename = unicode(translate('SongUsagePlugin.SongUsageDetailForm', + 'usage_detail_%s_%s.txt')) % ( self.fromDate.selectedDate().toString(u'ddMMyyyy'), self.toDate.selectedDate().toString(u'ddMMyyyy')) usage = self.plugin.manager.get_all_objects( @@ -95,4 +96,4 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): finally: if file: file.close() - self.close() \ No newline at end of file + self.close() diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 4a95b00f7..ec37dc65e 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -175,10 +175,13 @@ class SongUsagePlugin(Plugin): """ ## Name PluginList ## self.textStrings[StringContent.Name] = { - u'singular': translate('SongUsagePlugin', 'SongUsage'), - u'plural': translate('SongUsagePlugin', 'SongUsage') + u'singular': translate('SongUsagePlugin', 'SongUsage', + 'name singular'), + u'plural': translate('SongUsagePlugin', 'SongUsage', + 'name plural') } ## Name for MediaDockManager, SettingsManager ## self.textStrings[StringContent.VisibleName] = { - u'title': translate('SongUsagePlugin', 'SongUsage') - } \ No newline at end of file + u'title': translate('SongUsagePlugin', 'SongUsage', + 'container title') + } From a83df7ce045a90365c21a005ea54c50fc82c0142 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Fri, 31 Dec 2010 17:13:23 +0000 Subject: [PATCH 13/13] Fix https://bugs.launchpad.net/openlp/+bug/672164/comments/9 --- openlp/core/ui/slidecontroller.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index dd7853216..6a5e313f0 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1042,7 +1042,8 @@ class SlideController(QtGui.QWidget): if self.ThemeScreen.isChecked: self.ThemeScreen.setChecked(False) self.HideMenu.setDefaultAction(self.ThemeScreen) - if self.DesktopScreen.isChecked: - self.DesktopScreen.setChecked(False) - self.HideMenu.setDefaultAction(self.DesktopScreen) + if self.screens.display_count > 1: + if self.DesktopScreen.isChecked: + self.DesktopScreen.setChecked(False) + self.HideMenu.setDefaultAction(self.DesktopScreen)