Theme Editing now previews and RenderManager Cleanups

This commit is contained in:
Tim Bentley 2010-08-07 14:37:10 +01:00
parent 45b12cf462
commit 6c3f21dfb0
3 changed files with 10 additions and 4 deletions

View File

@ -146,6 +146,9 @@ class RenderManager(object):
if self.theme != self.renderer.theme_name or self.themedata is None \
or overrideLevels:
log.debug(u'theme is now %s', self.theme)
if overrideLevels:
self.themedata = theme
else:
self.themedata = self.theme_manager.getThemeData(self.theme)
self.calculate_default(self.screens.current[u'size'])
self.renderer.set_theme(self.themedata)
@ -198,6 +201,8 @@ class RenderManager(object):
footer.append(u'Amazing Grace (John Newton)' )
footer.append(u'Public Domain')
footer.append(u'CCLI 123456')
# Previews do not need the transition switched on!
themedata.display_slideTransition = False
# build a service item to generate preview
serviceItem = ServiceItem()
serviceItem.theme = themedata

View File

@ -147,7 +147,7 @@ class ServiceItem(object):
if self.service_item_type == ServiceItemType.Text:
log.debug(u'Formatting slides')
theme = None
if not self.theme:
if self.theme:
theme = self.theme
self.main, self.footer = \
self.render_manager.set_override_theme(theme, useOverride)

View File

@ -279,6 +279,7 @@ class MainDisplay(DisplayWidget):
log.debug(u'preview')
# Wait for the fade to finish before geting the preview.
# Important otherwise preview will have incorrect text if at all !
if self.serviceItem.themedata.display_slideTransition:
while self.frame.evaluateJavaScript("fadeFinished()").toString() == u'false':
Receiver.send_message(u'openlp_process_events')
# Wait for the webview to update before geting the preview.