diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index cab3f0f45..3ce3dbce8 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -231,7 +231,10 @@ class ThemeXML(): setattr(self, master + element.tag +u'_'+ e[0], e[1]) else: field = master + e[0] - setattr(self, field, e[1]) + e1 = e[1] + if e[1] == u'True' or e[1] == u'False': + e1 = convertStringToBoolean(e[1]) + setattr(self, field, e1) else: #print "c", element.tag, element.text if element.tag is not None : diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 0fe2dd27c..c126735a0 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'amendthemedialog.ui' # -# Created: Sun Apr 19 07:51:09 2009 +# Created: Tue Apr 21 06:06:56 2009 # by: PyQt4 UI code generator 4.4.4 # # WARNING! All changes made in this file will be lost! @@ -121,40 +121,40 @@ class Ui_AmendThemeDialog(object): self.MainLeftLayout.setSpacing(8) self.MainLeftLayout.setMargin(0) self.MainLeftLayout.setObjectName("MainLeftLayout") - self.MainFontGroupBox = QtGui.QGroupBox(self.MainLeftWidget) - self.MainFontGroupBox.setObjectName("MainFontGroupBox") - self.MainFontLayout = QtGui.QFormLayout(self.MainFontGroupBox) + self.FontMainGroupBox = QtGui.QGroupBox(self.MainLeftWidget) + self.FontMainGroupBox.setObjectName("FontMainGroupBox") + self.MainFontLayout = QtGui.QFormLayout(self.FontMainGroupBox) self.MainFontLayout.setFormAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter) self.MainFontLayout.setMargin(8) self.MainFontLayout.setSpacing(8) self.MainFontLayout.setObjectName("MainFontLayout") - self.MainFontlabel = QtGui.QLabel(self.MainFontGroupBox) - self.MainFontlabel.setObjectName("MainFontlabel") - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.MainFontlabel) - self.MainFontComboBox = QtGui.QFontComboBox(self.MainFontGroupBox) - self.MainFontComboBox.setObjectName("MainFontComboBox") - self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.MainFontComboBox) - self.MainFontColorLabel = QtGui.QLabel(self.MainFontGroupBox) - self.MainFontColorLabel.setObjectName("MainFontColorLabel") - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.MainFontColorLabel) - self.MainFontColorPushButton = QtGui.QPushButton(self.MainFontGroupBox) - self.MainFontColorPushButton.setObjectName("MainFontColorPushButton") - self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.MainFontColorPushButton) - self.MainFontSize = QtGui.QLabel(self.MainFontGroupBox) - self.MainFontSize.setObjectName("MainFontSize") - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.MainFontSize) - self.MainFontSizeSpinBox = QtGui.QSpinBox(self.MainFontGroupBox) + self.FontMainlabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainlabel.setObjectName("FontMainlabel") + self.MainFontLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.FontMainlabel) + self.FontMainComboBox = QtGui.QFontComboBox(self.FontMainGroupBox) + self.FontMainComboBox.setObjectName("FontMainComboBox") + self.MainFontLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainComboBox) + self.FontMainColorLabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainColorLabel.setObjectName("FontMainColorLabel") + self.MainFontLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainColorLabel) + self.FontMainColorPushButton = QtGui.QPushButton(self.FontMainGroupBox) + self.FontMainColorPushButton.setObjectName("FontMainColorPushButton") + self.MainFontLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainColorPushButton) + self.FontMainSize = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainSize.setObjectName("FontMainSize") + self.MainFontLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.FontMainSize) + self.FontMainSizeSpinBox = QtGui.QSpinBox(self.FontMainGroupBox) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.MainFontSizeSpinBox.sizePolicy().hasHeightForWidth()) - self.MainFontSizeSpinBox.setSizePolicy(sizePolicy) - self.MainFontSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) - self.MainFontSizeSpinBox.setMaximum(999) - self.MainFontSizeSpinBox.setProperty("value", QtCore.QVariant(16)) - self.MainFontSizeSpinBox.setObjectName("MainFontSizeSpinBox") - self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.MainFontSizeSpinBox) - self.MainLeftLayout.addWidget(self.MainFontGroupBox) + sizePolicy.setHeightForWidth(self.FontMainSizeSpinBox.sizePolicy().hasHeightForWidth()) + self.FontMainSizeSpinBox.setSizePolicy(sizePolicy) + self.FontMainSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) + self.FontMainSizeSpinBox.setProperty("value", QtCore.QVariant(16)) + self.FontMainSizeSpinBox.setMaximum(999) + self.FontMainSizeSpinBox.setObjectName("FontMainSizeSpinBox") + self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) + self.MainLeftLayout.addWidget(self.FontMainGroupBox) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.MainLeftLayout.addItem(spacerItem1) self.FontMainLayout.addWidget(self.MainLeftWidget) @@ -173,10 +173,10 @@ class Ui_AmendThemeDialog(object): self.DefaultLocationLabel = QtGui.QLabel(self.MainLocationGroupBox) self.DefaultLocationLabel.setObjectName("DefaultLocationLabel") self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.DefaultLocationLabel) - self.FontMainUseDefault = QtGui.QCheckBox(self.MainLocationGroupBox) - self.FontMainUseDefault.setTristate(False) - self.FontMainUseDefault.setObjectName("FontMainUseDefault") - self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainUseDefault) + self.FontMainDefaultCheckBox = QtGui.QCheckBox(self.MainLocationGroupBox) + self.FontMainDefaultCheckBox.setTristate(False) + self.FontMainDefaultCheckBox.setObjectName("FontMainDefaultCheckBox") + self.MainLocationLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.FontMainDefaultCheckBox) self.FontMainXLabel = QtGui.QLabel(self.MainLocationGroupBox) self.FontMainXLabel.setObjectName("FontMainXLabel") self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.FontMainXLabel) @@ -196,8 +196,8 @@ class Ui_AmendThemeDialog(object): sizePolicy.setHeightForWidth(self.FontMainXSpinBox.sizePolicy().hasHeightForWidth()) self.FontMainXSpinBox.setSizePolicy(sizePolicy) self.FontMainXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontMainXSpinBox.setMaximum(9999) self.FontMainXSpinBox.setProperty("value", QtCore.QVariant(0)) + self.FontMainXSpinBox.setMaximum(9999) self.FontMainXSpinBox.setObjectName("FontMainXSpinBox") self.MainLocationLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontMainXSpinBox) self.FontMainYSpinBox = QtGui.QSpinBox(self.MainLocationGroupBox) @@ -277,8 +277,8 @@ class Ui_AmendThemeDialog(object): sizePolicy.setHeightForWidth(self.FontFooterSizeSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterSizeSpinBox.setSizePolicy(sizePolicy) self.FontFooterSizeSpinBox.setMinimumSize(QtCore.QSize(70, 0)) - self.FontFooterSizeSpinBox.setMaximum(999) self.FontFooterSizeSpinBox.setProperty("value", QtCore.QVariant(10)) + self.FontFooterSizeSpinBox.setMaximum(999) self.FontFooterSizeSpinBox.setObjectName("FontFooterSizeSpinBox") self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) self.FooterLeftLayout.addWidget(self.FooterFontGroupBox) @@ -325,8 +325,8 @@ class Ui_AmendThemeDialog(object): sizePolicy.setHeightForWidth(self.FontFooterXSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterXSpinBox.setSizePolicy(sizePolicy) self.FontFooterXSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontFooterXSpinBox.setMaximum(9999) self.FontFooterXSpinBox.setProperty("value", QtCore.QVariant(0)) + self.FontFooterXSpinBox.setMaximum(9999) self.FontFooterXSpinBox.setObjectName("FontFooterXSpinBox") self.LocationFooterLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.FontFooterXSpinBox) self.FontFooterYSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) @@ -336,15 +336,15 @@ class Ui_AmendThemeDialog(object): sizePolicy.setHeightForWidth(self.FontFooterYSpinBox.sizePolicy().hasHeightForWidth()) self.FontFooterYSpinBox.setSizePolicy(sizePolicy) self.FontFooterYSpinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontFooterYSpinBox.setMaximum(9999) self.FontFooterYSpinBox.setProperty("value", QtCore.QVariant(0)) + self.FontFooterYSpinBox.setMaximum(9999) self.FontFooterYSpinBox.setObjectName("FontFooterYSpinBox") self.LocationFooterLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterYSpinBox) - self.FontFooterWidthspinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) - self.FontFooterWidthspinBox.setMinimumSize(QtCore.QSize(78, 0)) - self.FontFooterWidthspinBox.setMaximum(9999) - self.FontFooterWidthspinBox.setObjectName("FontFooterWidthspinBox") - self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthspinBox) + self.FontFooterWidthSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) + self.FontFooterWidthSpinBox.setMinimumSize(QtCore.QSize(78, 0)) + self.FontFooterWidthSpinBox.setMaximum(9999) + self.FontFooterWidthSpinBox.setObjectName("FontFooterWidthSpinBox") + self.LocationFooterLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWidthSpinBox) self.FontFooterHeightSpinBox = QtGui.QSpinBox(self.LocationFooterGroupBox) self.FontFooterHeightSpinBox.setMinimumSize(QtCore.QSize(78, 0)) self.FontFooterHeightSpinBox.setMaximum(9999) @@ -493,11 +493,11 @@ class Ui_AmendThemeDialog(object): AmendThemeDialog.setTabOrder(self.Color2PushButton, self.ImageLineEdit) AmendThemeDialog.setTabOrder(self.ImageLineEdit, self.ImageToolButton) AmendThemeDialog.setTabOrder(self.ImageToolButton, self.GradientComboBox) - AmendThemeDialog.setTabOrder(self.GradientComboBox, self.MainFontComboBox) - AmendThemeDialog.setTabOrder(self.MainFontComboBox, self.MainFontColorPushButton) - AmendThemeDialog.setTabOrder(self.MainFontColorPushButton, self.MainFontSizeSpinBox) - AmendThemeDialog.setTabOrder(self.MainFontSizeSpinBox, self.FontMainUseDefault) - AmendThemeDialog.setTabOrder(self.FontMainUseDefault, self.FontMainXSpinBox) + AmendThemeDialog.setTabOrder(self.GradientComboBox, self.FontMainComboBox) + AmendThemeDialog.setTabOrder(self.FontMainComboBox, self.FontMainColorPushButton) + AmendThemeDialog.setTabOrder(self.FontMainColorPushButton, self.FontMainSizeSpinBox) + AmendThemeDialog.setTabOrder(self.FontMainSizeSpinBox, self.FontMainDefaultCheckBox) + AmendThemeDialog.setTabOrder(self.FontMainDefaultCheckBox, self.FontMainXSpinBox) AmendThemeDialog.setTabOrder(self.FontMainXSpinBox, self.FontMainYSpinBox) AmendThemeDialog.setTabOrder(self.FontMainYSpinBox, self.FontMainWidthSpinBox) AmendThemeDialog.setTabOrder(self.FontMainWidthSpinBox, self.FontMainHeightSpinBox) @@ -507,8 +507,8 @@ class Ui_AmendThemeDialog(object): AmendThemeDialog.setTabOrder(self.FontFooterSizeSpinBox, self.FontFooterDefaultCheckBox) AmendThemeDialog.setTabOrder(self.FontFooterDefaultCheckBox, self.FontFooterXSpinBox) AmendThemeDialog.setTabOrder(self.FontFooterXSpinBox, self.FontFooterYSpinBox) - AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthspinBox) - AmendThemeDialog.setTabOrder(self.FontFooterWidthspinBox, self.FontFooterHeightSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterYSpinBox, self.FontFooterWidthSpinBox) + AmendThemeDialog.setTabOrder(self.FontFooterWidthSpinBox, self.FontFooterHeightSpinBox) AmendThemeDialog.setTabOrder(self.FontFooterHeightSpinBox, self.OutlineCheckBox) AmendThemeDialog.setTabOrder(self.OutlineCheckBox, self.OutlineColorPushButton) AmendThemeDialog.setTabOrder(self.OutlineColorPushButton, self.ShadowCheckBox) @@ -534,11 +534,11 @@ class Ui_AmendThemeDialog(object): self.GradientComboBox.setItemText(1, QtGui.QApplication.translate("AmendThemeDialog", "Vertical", None, QtGui.QApplication.UnicodeUTF8)) self.GradientComboBox.setItemText(2, QtGui.QApplication.translate("AmendThemeDialog", "Circular", None, QtGui.QApplication.UnicodeUTF8)) self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.BackgroundTab), QtGui.QApplication.translate("AmendThemeDialog", "Background", None, QtGui.QApplication.UnicodeUTF8)) - self.MainFontGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8)) - self.MainFontlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) - self.MainFontColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8)) - self.MainFontSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) - self.MainFontSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Main Font", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainlabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainColorLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Font Color:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainSize.setText(QtGui.QApplication.translate("AmendThemeDialog", "Size:", None, QtGui.QApplication.UnicodeUTF8)) + self.FontMainSizeSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "pt", None, QtGui.QApplication.UnicodeUTF8)) self.MainLocationGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Display Location", None, QtGui.QApplication.UnicodeUTF8)) self.DefaultLocationLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Use Default Location:", None, QtGui.QApplication.UnicodeUTF8)) self.FontMainXLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "X Position:", None, QtGui.QApplication.UnicodeUTF8)) @@ -563,7 +563,7 @@ class Ui_AmendThemeDialog(object): self.FontFooterHeightLabel.setText(QtGui.QApplication.translate("AmendThemeDialog", "Height:", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterXSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterYSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) - self.FontFooterWidthspinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) + self.FontFooterWidthSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) self.FontFooterHeightSpinBox.setSuffix(QtGui.QApplication.translate("AmendThemeDialog", "px", None, QtGui.QApplication.UnicodeUTF8)) self.ThemeTabWidget.setTabText(self.ThemeTabWidget.indexOf(self.FontFooterTab), QtGui.QApplication.translate("AmendThemeDialog", "Font Footer", None, QtGui.QApplication.UnicodeUTF8)) self.ShadowGroupBox.setTitle(QtGui.QApplication.translate("AmendThemeDialog", "Shadow && Outline", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index a5d283b8a..587198ce3 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -36,6 +36,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def __init__(self, thememanager, parent=None): QtGui.QDialog.__init__(self, parent) self.thememanager = thememanager + self.theme = ThemeXML() # Needed here as UI setup generates Events self.setupUi(self) #define signals @@ -44,8 +45,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): QtCore.SIGNAL("pressed()"), self.onColor1PushButtonClicked) QtCore.QObject.connect(self.Color2PushButton , QtCore.SIGNAL("pressed()"), self.onColor2PushButtonClicked) - QtCore.QObject.connect(self.MainFontColorPushButton, - QtCore.SIGNAL("pressed()"), self.onMainFontColorPushButtonClicked) + QtCore.QObject.connect(self.FontMainColorPushButton, + QtCore.SIGNAL("pressed()"), self.onFontMainColorPushButtonClicked) QtCore.QObject.connect(self.FontFooterColorPushButton, QtCore.SIGNAL("pressed()"), self.onFontFooterColorPushButtonClicked) #Combo boxes @@ -55,14 +56,35 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): QtCore.SIGNAL("activated(int)"), self.onBackgroundTypeComboBoxSelected) QtCore.QObject.connect(self.GradientComboBox, QtCore.SIGNAL("activated(int)"), self.onGradientComboBoxSelected) - QtCore.QObject.connect(self.MainFontComboBox, - QtCore.SIGNAL("activated(int)"), self.onMainFontComboBoxSelected) + QtCore.QObject.connect(self.FontMainComboBox, + QtCore.SIGNAL("activated(int)"), self.onFontMainComboBoxSelected) QtCore.QObject.connect(self.FontFooterComboBox, QtCore.SIGNAL("activated(int)"), self.onFontFooterComboBoxSelected) - QtCore.QObject.connect(self.MainFontSizeSpinBox, - QtCore.SIGNAL("valueChanged(int)"), self.onMainFontSizeSpinBoxChanged) + QtCore.QObject.connect(self.FontMainSizeSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontMainSizeSpinBoxChanged) QtCore.QObject.connect(self.FontFooterSizeSpinBox, QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterSizeSpinBoxChanged) + QtCore.QObject.connect(self.FontMainDefaultCheckBox, + QtCore.SIGNAL("stateChanged(int)"), self.onFontMainDefaultCheckBoxChanged) + QtCore.QObject.connect(self.FontMainXSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontMainXSpinBoxChanged) + QtCore.QObject.connect(self.FontMainYSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontMainYSpinBoxChanged) + QtCore.QObject.connect(self.FontMainWidthSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontMainWidthSpinBoxChanged) + QtCore.QObject.connect(self.FontMainHeightSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontMainHeightSpinBoxChanged) + QtCore.QObject.connect(self.FontFooterDefaultCheckBox, + QtCore.SIGNAL("stateChanged(int)"), self.onFontFooterDefaultCheckBoxChanged) + QtCore.QObject.connect(self.FontFooterXSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterXSpinBoxChanged) + QtCore.QObject.connect(self.FontFooterYSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterYSpinBoxChanged) + QtCore.QObject.connect(self.FontFooterWidthSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterWidthSpinBoxChanged) + QtCore.QObject.connect(self.FontFooterHeightSpinBox, + QtCore.SIGNAL("valueChanged(int)"), self.onFontFooterHeightSpinBoxChanged) + def accept(self): return QtGui.QDialog.accept(self) @@ -71,7 +93,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.path = path def loadTheme(self, theme): - self.theme = ThemeXML() if theme == None: self.theme.parse(self.baseTheme()) else: @@ -84,14 +105,39 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): # #Main Font Tab # - def onMainFontComboBoxSelected(self): - self.theme.font_main_name = self.MainFontComboBox.currentFont().family() + def onFontMainComboBoxSelected(self): + self.theme.font_main_name = self.FontMainComboBox.currentFont().family() self.previewTheme(self.theme) - def onMainFontSizeSpinBoxChanged(self, value): + def onFontMainSizeSpinBoxChanged(self, value): self.theme.font_main_proportion = value self.previewTheme(self.theme) + def onFontMainDefaultCheckBoxChanged(self, value): + if value == 2: # checked + self.theme.font_main_override = False + else: + self.theme.font_main_override = True + self.stateChanging(self.theme) + self.previewTheme(self.theme) + + def onFontMainXSpinBoxChanged(self, value): + self.theme.font_main_x = value + self.previewTheme(self.theme) + + def onFontMainYSpinBoxChanged(self, value): + self.theme.font_main_y = value + self.previewTheme(self.theme) + + def onFontMainWidthSpinBoxChanged(self, value): + self.theme.font_main_width = value + self.previewTheme(self.theme) + + def onFontMainHeightSpinBoxChanged(self, value): + self.theme.font_main_height = value + self.previewTheme(self.theme) + + # #Footer Font Tab # @@ -103,6 +149,34 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.font_footer_proportion = value self.previewTheme(self.theme) + def onFontFooterDefaultCheckBoxChanged(self): + self.stateChanging(self.theme) + self.previewTheme(self.theme) + + def onFontFooterDefaultCheckBoxChanged(self, value): + if value == 2: # checked + self.theme.font_footer_override = False + else: + self.theme.font_footer_override = True + self.stateChanging(self.theme) + self.previewTheme(self.theme) + + def onFontFooterXSpinBoxChanged(self, value): + self.theme.font_footer_x = value + self.previewTheme(self.theme) + + def onFontFooterYSpinBoxChanged(self, value): + self.theme.font_footer_y = value + self.previewTheme(self.theme) + + def onFontFooterWidthSpinBoxChanged(self, value): + self.theme.font_footer_width = value + self.previewTheme(self.theme) + + def onFontFooterHeightSpinBoxChanged(self, value): + self.theme.font_footer_height = value + self.previewTheme(self.theme) + # #Background Tab # @@ -164,11 +238,11 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.previewTheme(self.theme) - def onMainFontColorPushButtonClicked(self): + def onFontMainColorPushButtonClicked(self): self.theme.font_main_color = QtGui.QColorDialog.getColor( QColor(self.theme.font_main_color), self).name() - self.MainFontColorPushButton.setStyleSheet( + self.FontMainColorPushButton.setStyleSheet( 'background-color: %s' % str(self.theme.font_main_color)) self.previewTheme(self.theme) @@ -188,8 +262,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): newtheme = ThemeXML() newtheme.new_document(u'New Theme') newtheme.add_background_solid(str(u'#000000')) - newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False') - newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer') + newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), False) + newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), False, u'footer') newtheme.add_display(str(False), str(u'#FFFFFF'), str(False), str(u'#FFFFFF'), str(0), str(0), str(0)) @@ -215,7 +289,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): else: self.GradientComboBox.setCurrentIndex(2) - self.MainFontSizeSpinBox.setValue(int(self.theme.font_main_proportion)) + self.FontMainSizeSpinBox.setValue(int(self.theme.font_main_proportion)) self.FontMainXSpinBox.setValue(int(self.theme.font_main_x)) self.FontMainYSpinBox.setValue(int(self.theme.font_main_y)) self.FontMainWidthSpinBox.setValue(int(self.theme.font_main_width)) @@ -223,24 +297,22 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontFooterSizeSpinBox.setValue(int(self.theme.font_footer_proportion)) self.FontFooterXSpinBox.setValue(int(self.theme.font_footer_x)) self.FontFooterYSpinBox.setValue(int(self.theme.font_footer_y)) - self.FontFooterWidthspinBox.setValue(int(self.theme.font_footer_width)) + self.FontFooterWidthSpinBox.setValue(int(self.theme.font_footer_width)) self.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height)) - self.MainFontColorPushButton.setStyleSheet( + self.FontMainColorPushButton.setStyleSheet( 'background-color: %s' % str(theme.font_main_color)) self.FontFooterColorPushButton.setStyleSheet( 'background-color: %s' % str(theme.font_footer_color)) - if self.theme.font_main_override == u'True': - self.FontMainUseDefault.setChecked(True) + if self.theme.font_main_override == False: + self.FontMainDefaultCheckBox.setChecked(True) else: - self.FontMainUseDefault.setChecked(False) - if self.theme.font_footer_override == u'True': + self.FontMainDefaultCheckBox.setChecked(False) + if self.theme.font_footer_override == False: self.FontFooterDefaultCheckBox.setChecked(True) else: self.FontFooterDefaultCheckBox.setChecked(False) - - def stateChanging(self, theme): if theme.background_type == u'solid': self.Color1PushButton.setStyleSheet( @@ -282,7 +354,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.GradientLabel.setVisible(False) self.GradientComboBox.setVisible(False) - if theme.font_main_override == u'True': + if theme.font_main_override == False: self.FontMainXSpinBox.setEnabled(False) self.FontMainYSpinBox.setEnabled(False) self.FontMainWidthSpinBox.setEnabled(False) @@ -293,18 +365,17 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.FontMainWidthSpinBox.setEnabled(True) self.FontMainHeightSpinBox.setEnabled(True) - if theme.font_footer_override == u'True': + if theme.font_footer_override == False: self.FontFooterXSpinBox.setEnabled(False) self.FontFooterYSpinBox.setEnabled(False) - self.FontFooterWidthspinBox.setEnabled(False) + self.FontFooterWidthSpinBox.setEnabled(False) self.FontFooterHeightSpinBox.setEnabled(False) else: self.FontFooterXSpinBox.setEnabled(True) self.FontFooterYSpinBox.setEnabled(True) - self.FontFooterWidthspinBox.setEnabled(True) + self.FontFooterWidthSpinBox.setEnabled(True) self.FontFooterHeightSpinBox.setEnabled(True) - def previewTheme(self, theme): frame = self.thememanager.generateImage(theme) self.ThemePreview.setPixmap(frame) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 992d7b927..70b0bb2e5 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -307,8 +307,8 @@ class ThemeManager(QWidget): else: newtheme.add_background_image(str(t.BackgroundParameter1)) - newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(t.FontProportion * 2), u'True') - newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(12), u'True', u'footer') + newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(t.FontProportion * 2), u'False') + newtheme.add_font(str(t.FontName), str(t.FontColor.name()), str(12), u'False', u'footer') outline = False shadow = False if t.Shadow == 1: diff --git a/resources/forms/amendthemedialog.ui b/resources/forms/amendthemedialog.ui index febdd98bf..84fa8b7bd 100644 --- a/resources/forms/amendthemedialog.ui +++ b/resources/forms/amendthemedialog.ui @@ -1,10 +1,11 @@ - + + AmendThemeDialog - - + + Qt::ApplicationModal - + 0 0 @@ -12,200 +13,200 @@ 651 - + Theme Maintance - - + + :/icon/openlp.org-icon-32.bmp:/icon/openlp.org-icon-32.bmp - + true - - + + 8 - + 8 - - - + + + 8 - + 0 - - + + Theme Name: - + - - - + + + 8 - + 0 - - + + 0 - - + + Background - - + + 8 - + 8 - + 8 - - - + + + Background: - - + + - + Opaque - + Transparent - - - + + + Background Type: - - + + - + Solid Color - + Gradient - + Image - - - - <Color1> + + + + <Color1> - - - + + + - - - - <Color2> + + + + <Color2> - - - + + + - - - + + + Image: - - - + + + Gradient : - - + + - + Horizontal - + Vertical - + Circular - - - - + + + + 0 - + 0 - + - - + + - - + + :/images/image_load.png:/images/image_load.png @@ -213,12 +214,12 @@ - - - + + + Qt::Vertical - + 20 40 @@ -228,109 +229,109 @@ - - + + Font Main - - + + 8 - + 8 - - - + + + 8 - + 0 - - + + Main Font - - + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - + 8 - + 8 - + 8 - - - + + + Font: - - + + - - - + + + Font Color: - - - + + + - - - + + + Size: - - - - + + + + 0 0 - + 70 0 - - pt - - - 999 - - + 16 + + pt + + + 999 + - - + + Qt::Vertical - + 20 40 @@ -342,161 +343,161 @@ - - - + + + 8 - + 0 - - + + Display Location - - + + 8 - + 8 - + 8 - - - + + + Use Default Location: - - - + + + - + false - - - + + + X Position: - - - + + + Y Position: - - - + + + Width: - - - + + + Height: - - - - + + + + 0 0 - + 78 0 - - px - - - 9999 - - + 0 - - - - - - - 0 - 0 - - - - - 78 - 0 - - - + px - + 9999 - - - - + + + + 0 0 - + 78 0 - + px - + 9999 - - - - + + + + 0 0 - + 78 0 - + px - + + 9999 + + + + + + + + 0 + 0 + + + + + 78 + 0 + + + + px + + 9999 @@ -505,11 +506,11 @@ - - + + Qt::Vertical - + 20 40 @@ -522,112 +523,112 @@ - - + + Font Footer - - + + 8 - + 8 - - - + + + 8 - + 0 - - + + Footer Font - - + + QFormLayout::ExpandingFieldsGrow - + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - + 8 - + 8 - + 8 - - - + + + Font: - - + + - - - + + + Font Color: - - - + + + - - - + + + Size: - - - - + + + + 0 0 - + 70 0 - + + 10 + + pt - + 999 - - 10 - - - + + Qt::Vertical - + 20 40 @@ -639,158 +640,158 @@ - - - + + + 8 - + 0 - - + + Display Location - - + + QFormLayout::ExpandingFieldsGrow - + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - + 8 - + 8 - + 8 - - - + + + Use Default Location: - - - + + + - + false - - - + + + X Position: - - - + + + Y Position: - - - + + + Width: - - - + + + Height: - - - - + + + + 0 0 - + 78 0 - + + 0 + + px - + 9999 - - 0 - - - - - + + + + 0 0 - + 78 0 - - px - - - 9999 - - + 0 - - - - - - - 78 - 0 - - - + px - + 9999 - - - + + + 78 0 - + px - + + 9999 + + + + + + + + 78 + 0 + + + + px + + 9999 @@ -799,11 +800,11 @@ - - + + Qt::Vertical - + 20 40 @@ -816,74 +817,74 @@ - - + + Other Options - - + + 8 - + 8 - - - + + + 8 - + 0 - - + + Shadow && Outline - - + + 8 - + 8 - - - + + + 8 - + 8 - + 0 - - - + + + - - - + + + Outline Color: - - - + + + - - - + + + Show Outline: @@ -892,41 +893,41 @@ - - - + + + 8 - + 8 - + 0 - - - + + + - - - + + + Shadow Color: - - - + + + - - - + + + Show Shadow: @@ -938,11 +939,11 @@ - - + + Qt::Vertical - + 20 40 @@ -954,67 +955,67 @@ - - - + + + 8 - + 0 - - + + Alignment - - - - + + + + Horizontal Align: - - + + - + Left - + Right - + Center - - - + + + Vertical Align: - - + + - + Top - + Middle - + Bottom @@ -1024,11 +1025,11 @@ - - + + Qt::Vertical - + 20 40 @@ -1047,23 +1048,23 @@ - - + + Preview - - + + 8 - + 8 - - + + Qt::Horizontal - + 40 20 @@ -1072,42 +1073,42 @@ - - - + + + 0 0 - + 300 225 - + QFrame::WinPanel - + QFrame::Sunken - + 1 - + - + true - - + + Qt::Horizontal - + 40 20 @@ -1119,8 +1120,8 @@ - - + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok @@ -1138,10 +1139,10 @@ ImageLineEdit ImageToolButton GradientComboBox - MainFontComboBox - MainFontColorPushButton - MainFontSizeSpinBox - FontMainUseDefault + FontMainComboBox + FontMainColorPushButton + FontMainSizeSpinBox + FontMainDefaultCheckBox FontMainXSpinBox FontMainYSpinBox FontMainWidthSpinBox @@ -1152,7 +1153,7 @@ FontFooterDefaultCheckBox FontFooterXSpinBox FontFooterYSpinBox - FontFooterWidthspinBox + FontFooterWidthSpinBox FontFooterHeightSpinBox OutlineCheckBox OutlineColorPushButton @@ -1162,7 +1163,7 @@ VerticalComboBox - + @@ -1171,11 +1172,11 @@ AmendThemeDialog accept() - + 375 466 - + 375 241 @@ -1187,11 +1188,11 @@ AmendThemeDialog reject() - + 375 466 - + 375 241