More Theme Changes

State corrections 
XML boolean fixes
This commit is contained in:
Tim Bentley 2009-04-21 20:45:50 +01:00
parent c8094b717f
commit 852e24ab35
5 changed files with 591 additions and 516 deletions

View File

@ -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 :

View File

@ -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))

View File

@ -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)

View File

@ -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:

File diff suppressed because it is too large Load Diff