Fix theme editor losing options

This commit is contained in:
Tim Bentley 2011-01-23 08:25:21 +00:00
parent 632570b29d
commit a0746c0865
2 changed files with 21 additions and 17 deletions

View File

@ -67,6 +67,7 @@ class MainDisplay(DisplayWidget):
self.isLive = live self.isLive = live
self.alertTab = None self.alertTab = None
self.hideMode = None self.hideMode = None
self.override_image = None
mainIcon = build_icon(u':/icon/openlp-logo-16x16.png') mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
self.setWindowIcon(mainIcon) self.setWindowIcon(mainIcon)
self.retranslateUi() self.retranslateUi()
@ -205,14 +206,15 @@ class MainDisplay(DisplayWidget):
""" """
self.imageManager.add_image(name, path) self.imageManager.add_image(name, path)
self.image(name) self.image(name)
self.override_image = name
def image(self, name): def image(self, name):
""" """
Add an image as the background. The image is converted to a bytestream Add an image as the background. The image has already been added
on route. to the cache.
`Image` `Image`
The Image to be displayed can be QImage or QPixmap The name of the image to be displayed
""" """
log.debug(u'image to display') log.debug(u'image to display')
image = self.imageManager.get_image_bytes(name) image = self.imageManager.get_image_bytes(name)

View File

@ -250,25 +250,27 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
""" """
Change state as Outline check box changed Change state as Outline check box changed
""" """
if state == QtCore.Qt.Checked: if self.updateThemeAllowed:
self.theme.font_main_outline = True if state == QtCore.Qt.Checked:
else: self.theme.font_main_outline = True
self.theme.font_main_outline = False else:
self.outlineColorButton.setEnabled(self.theme.font_main_outline) self.theme.font_main_outline = False
self.outlineSizeSpinBox.setEnabled(self.theme.font_main_outline) self.outlineColorButton.setEnabled(self.theme.font_main_outline)
self.calculateLines() self.outlineSizeSpinBox.setEnabled(self.theme.font_main_outline)
self.calculateLines()
def onShadowCheckCheckBoxStateChanged(self, state): def onShadowCheckCheckBoxStateChanged(self, state):
""" """
Change state as Shadow check box changed Change state as Shadow check box changed
""" """
if state == QtCore.Qt.Checked: if self.updateThemeAllowed:
self.theme.font_main_shadow = True if state == QtCore.Qt.Checked:
else: self.theme.font_main_shadow = True
self.theme.font_main_shadow = False else:
self.shadowColorButton.setEnabled(self.theme.font_main_shadow) self.theme.font_main_shadow = False
self.shadowSizeSpinBox.setEnabled(self.theme.font_main_shadow) self.shadowColorButton.setEnabled(self.theme.font_main_shadow)
self.calculateLines() self.shadowSizeSpinBox.setEnabled(self.theme.font_main_shadow)
self.calculateLines()
def onMainPositionCheckBoxStateChanged(self, value): def onMainPositionCheckBoxStateChanged(self, value):
""" """