forked from openlp/openlp
Fix rendering problems and issues with CustomSlides
bzr-revno: 434
This commit is contained in:
commit
1868109190
@ -33,7 +33,7 @@ class Renderer:
|
|||||||
"""All the functions for rendering a set of words onto a Device Context
|
"""All the functions for rendering a set of words onto a Device Context
|
||||||
|
|
||||||
How to use:
|
How to use:
|
||||||
set the words to be displayed with a call to set_words_openlp() - this returns an array of screenfuls of data
|
set the words to be displayed with a call to format_slide() - this returns an array of screenfuls of data
|
||||||
set a theme (if you need) with set_theme
|
set a theme (if you need) with set_theme
|
||||||
tell it which DC to render to with set_DC()
|
tell it which DC to render to with set_DC()
|
||||||
set the borders of where you want the text (if not the whole DC) with set_text_rectangle()
|
set the borders of where you want the text (if not the whole DC) with set_text_rectangle()
|
||||||
@ -102,8 +102,7 @@ class Renderer:
|
|||||||
def format_slide(self, words, footer):
|
def format_slide(self, words, footer):
|
||||||
log.debug(u'format_slide %s', words)
|
log.debug(u'format_slide %s', words)
|
||||||
verses=[]
|
verses=[]
|
||||||
words=words.replace(u'\r\n', u'\n')
|
verses_text = words.splitlines()
|
||||||
verses_text = words.split(u'\n')
|
|
||||||
for v in verses_text:
|
for v in verses_text:
|
||||||
lines=v.split(u'\n')
|
lines=v.split(u'\n')
|
||||||
verses.append(self.split_set_of_lines(lines, footer)[0])
|
verses.append(self.split_set_of_lines(lines, footer)[0])
|
||||||
|
@ -43,32 +43,41 @@ class RenderManager:
|
|||||||
self.calculate_default(self.screen_list[self.current_display-1][1])
|
self.calculate_default(self.screen_list[self.current_display-1][1])
|
||||||
self.frame = None
|
self.frame = None
|
||||||
|
|
||||||
def set_default_theme(self, theme):
|
def set_override_theme(self, theme):
|
||||||
log.debug("default theme set to %s", theme)
|
log.debug("set override theme to %s", theme)
|
||||||
self.default_theme = self.theme_manager.getThemeData(theme)
|
if theme is not None:
|
||||||
self.renderer.set_theme(self.default_theme)
|
|
||||||
|
|
||||||
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
|
|
||||||
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
|
|
||||||
|
|
||||||
|
|
||||||
def set_theme(self, theme):
|
|
||||||
log.debug("theme set to %s", theme)
|
|
||||||
self.theme = theme
|
self.theme = theme
|
||||||
self.renderer.set_theme(self.theme)
|
else:
|
||||||
|
self.theme = self.default_theme
|
||||||
|
log.debug("theme is now %s", self.theme)
|
||||||
|
self.themedata = self.theme_manager.getThemeData(self.theme)
|
||||||
|
self.renderer.set_theme(self.themedata)
|
||||||
|
self.build_text_rectangle(self.themedata)
|
||||||
|
|
||||||
|
def build_text_rectangle(self, theme):
|
||||||
|
|
||||||
|
main_rect = None
|
||||||
|
footer_rect = None
|
||||||
|
|
||||||
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
|
|
||||||
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
|
|
||||||
if theme.font_main_override == False:
|
if theme.font_main_override == False:
|
||||||
pass
|
main_rect = QtCore.QRect(10,0, self.width-1, self.height-1)
|
||||||
|
else:
|
||||||
|
main_rect = QtCore.QRect(int(theme.font_main_x) , int(theme.font_main_y),
|
||||||
|
int(theme.font_main_width)-1, int(theme.font_main_height)-1)
|
||||||
|
|
||||||
if theme.font_footer_override == False:
|
if theme.font_footer_override == False:
|
||||||
pass
|
footer_rect = QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start)
|
||||||
|
else:
|
||||||
|
footer_rect = QtCore.QRect(int(theme.font_footer_x),int(theme.font_footer_y),
|
||||||
|
int(theme.font_footer_width)-1, int(theme.font_footer_height)-1)
|
||||||
|
|
||||||
def generate_preview(self):
|
self.renderer.set_text_rectangle(main_rect,footer_rect)
|
||||||
|
|
||||||
|
def generate_preview(self, themedata):
|
||||||
self.calculate_default(QtCore.QSize(800,600))
|
self.calculate_default(QtCore.QSize(800,600))
|
||||||
|
self.renderer.set_theme(themedata)
|
||||||
|
|
||||||
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
|
self.build_text_rectangle(themedata)
|
||||||
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
|
|
||||||
|
|
||||||
frame = QtGui.QPixmap(self.width, self.height)
|
frame = QtGui.QPixmap(self.width, self.height)
|
||||||
self.renderer.set_paint_dest(frame)
|
self.renderer.set_paint_dest(frame)
|
||||||
@ -87,22 +96,12 @@ class RenderManager:
|
|||||||
|
|
||||||
def format_slide(self, words, footer):
|
def format_slide(self, words, footer):
|
||||||
self.calculate_default(QtCore.QSize(800,600))
|
self.calculate_default(QtCore.QSize(800,600))
|
||||||
|
|
||||||
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
|
|
||||||
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
|
|
||||||
|
|
||||||
return self.renderer.format_slide(words, footer)
|
return self.renderer.format_slide(words, footer)
|
||||||
|
|
||||||
def generate_slide(self,main_text, footer_text, preview=True):
|
def generate_slide(self,main_text, footer_text, preview=True):
|
||||||
if preview == True:
|
if preview == True:
|
||||||
self.calculate_default(QtCore.QSize(800,600))
|
self.calculate_default(QtCore.QSize(800,600))
|
||||||
|
|
||||||
self.renderer.set_text_rectangle(QtCore.QRect(10,0, self.width-1, self.height-1),
|
|
||||||
QtCore.QRect(10,self.footer_start, self.width-1, self.height-self.footer_start))
|
|
||||||
|
|
||||||
#frame = QtGui.QPixmap(self.width, self.height)
|
|
||||||
#self.renderer.set_paint_dest(frame)
|
|
||||||
#print main_text
|
|
||||||
answer=self.renderer.render_lines(main_text, footer_text)
|
answer=self.renderer.render_lines(main_text, footer_text)
|
||||||
return self.frame
|
return self.frame
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ class SongXMLParser():
|
|||||||
iter=self.song_xml.getiterator()
|
iter=self.song_xml.getiterator()
|
||||||
verse_list = []
|
verse_list = []
|
||||||
for element in iter:
|
for element in iter:
|
||||||
|
#print element.tag, element.attrib, element.text
|
||||||
if element.tag == u'verse':
|
if element.tag == u'verse':
|
||||||
verse_list.append([element.attrib, element.text])
|
verse_list.append([element.attrib, element.text])
|
||||||
return verse_list
|
return verse_list
|
||||||
|
@ -151,11 +151,12 @@ class ThemeXML():
|
|||||||
|
|
||||||
element = self.theme_xml.createElement(u'location')
|
element = self.theme_xml.createElement(u'location')
|
||||||
element.setAttribute(u'override',override)
|
element.setAttribute(u'override',override)
|
||||||
if override == True:
|
|
||||||
element.setAttribute(u'x',str(xpos))
|
if override == u'True':
|
||||||
element.setAttribute(u'y',str(ypos))
|
element.setAttribute(u'x',xpos)
|
||||||
element.setAttribute(u'width',str(width))
|
element.setAttribute(u'y',ypos)
|
||||||
element.setAttribute(u'height',str(height))
|
element.setAttribute(u'width',width)
|
||||||
|
element.setAttribute(u'height',height)
|
||||||
background.appendChild(element)
|
background.appendChild(element)
|
||||||
|
|
||||||
def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap):
|
def add_display(self, shadow, shadowColor, outline, outlineColor, horizontal, vertical, wrap):
|
||||||
|
@ -111,12 +111,21 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
#else:
|
#else:
|
||||||
#newtheme.add_background_image(str(self.theme.))
|
#newtheme.add_background_image(str(self.theme.))
|
||||||
|
|
||||||
new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color), str(self.theme.font_main_proportion), u'False')
|
new_theme.add_font(str(self.theme.font_main_name), str(self.theme.font_main_color),
|
||||||
new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color), str(self.theme.font_footer_proportion), u'False', u'footer')
|
str(self.theme.font_main_proportion), str(self.theme.font_main_override),u'main',
|
||||||
new_theme.add_display(str(self.theme.display_shadow), str(self.theme.display_shadow_color), str(self.theme.display_outline), str(self.theme.display_outline_color),
|
str(self.theme.font_main_x), str(self.theme.font_main_y), str(self.theme.font_main_width),
|
||||||
str(self.theme.display_horizontalAlign), str(self.theme.display_verticalAlign), str(self.theme.display_wrapStyle))
|
str(self.theme.font_main_height))
|
||||||
|
new_theme.add_font(str(self.theme.font_footer_name), str(self.theme.font_footer_color),
|
||||||
|
str(self.theme.font_footer_proportion), str(self.theme.font_footer_override),u'footer',
|
||||||
|
str(self.theme.font_footer_x), str(self.theme.font_footer_y), str(self.theme.font_footer_width),
|
||||||
|
str(self.theme.font_footer_height) )
|
||||||
|
new_theme.add_display(str(self.theme.display_shadow), str(self.theme.display_shadow_color),
|
||||||
|
str(self.theme.display_outline), str(self.theme.display_outline_color),
|
||||||
|
str(self.theme.display_horizontalAlign), str(self.theme.display_verticalAlign),
|
||||||
|
str(self.theme.display_wrapStyle))
|
||||||
|
|
||||||
theme = new_theme.extract_xml()
|
theme = new_theme.extract_xml()
|
||||||
|
|
||||||
self.thememanager.saveTheme(theme_name, theme)
|
self.thememanager.saveTheme(theme_name, theme)
|
||||||
return QtGui.QDialog.accept(self)
|
return QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
@ -124,6 +133,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
self.path = path
|
self.path = path
|
||||||
|
|
||||||
def loadTheme(self, theme):
|
def loadTheme(self, theme):
|
||||||
|
log.debug(u'LoadTheme %s ', theme)
|
||||||
if theme == None:
|
if theme == None:
|
||||||
self.theme.parse(self.baseTheme())
|
self.theme.parse(self.baseTheme())
|
||||||
else:
|
else:
|
||||||
@ -207,15 +217,13 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
self.theme.font_footer_proportion = value
|
self.theme.font_footer_proportion = value
|
||||||
self.previewTheme(self.theme)
|
self.previewTheme(self.theme)
|
||||||
|
|
||||||
def onFontFooterDefaultCheckBoxChanged(self):
|
|
||||||
self.stateChanging(self.theme)
|
|
||||||
self.previewTheme(self.theme)
|
|
||||||
|
|
||||||
def onFontFooterDefaultCheckBoxChanged(self, value):
|
def onFontFooterDefaultCheckBoxChanged(self, value):
|
||||||
if value == 2: # checked
|
if value == 2: # checked
|
||||||
self.theme.font_footer_override = False
|
self.theme.font_footer_override = False
|
||||||
else:
|
else:
|
||||||
self.theme.font_footer_override = True
|
self.theme.font_footer_override = True
|
||||||
|
|
||||||
if int(self.theme.font_footer_x) == 0 and int(self.theme.font_footer_y) == 0 and \
|
if int(self.theme.font_footer_x) == 0 and int(self.theme.font_footer_y) == 0 and \
|
||||||
int(self.theme.font_footer_width) == 0 and int(self.theme.font_footer_height) == 0:
|
int(self.theme.font_footer_width) == 0 and int(self.theme.font_footer_height) == 0:
|
||||||
self.theme.font_footer_x = u'10'
|
self.theme.font_footer_x = u'10'
|
||||||
@ -228,7 +236,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
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.FontFooterHeightSpinBox.setValue(int(self.theme.font_footer_height))
|
||||||
|
|
||||||
|
|
||||||
self.stateChanging(self.theme)
|
self.stateChanging(self.theme)
|
||||||
self.previewTheme(self.theme)
|
self.previewTheme(self.theme)
|
||||||
|
|
||||||
@ -354,19 +361,18 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
|||||||
#Local Methods
|
#Local Methods
|
||||||
#
|
#
|
||||||
def baseTheme(self):
|
def baseTheme(self):
|
||||||
log.debug(u'base Theme')
|
log.debug(u'base theme created')
|
||||||
newtheme = ThemeXML()
|
newtheme = ThemeXML()
|
||||||
newtheme.new_document(u'New Theme')
|
newtheme.new_document(u'New Theme')
|
||||||
newtheme.add_background_solid(str(u'#000000'))
|
newtheme.add_background_solid(str(u'#000000'))
|
||||||
newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), False)
|
newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(30), u'False')
|
||||||
newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), False, u'footer')
|
newtheme.add_font(str(QFont().family()), str(u'#FFFFFF'), str(12), u'False', u'footer')
|
||||||
newtheme.add_display(str(False), str(u'#FFFFFF'), str(False), str(u'#FFFFFF'),
|
newtheme.add_display(u'False', str(u'#FFFFFF'), u'False', str(u'#FFFFFF'),
|
||||||
str(0), str(0), str(0))
|
str(0), str(0), str(0))
|
||||||
|
|
||||||
return newtheme.extract_xml()
|
return newtheme.extract_xml()
|
||||||
|
|
||||||
def paintUi(self, theme):
|
def paintUi(self, theme):
|
||||||
print theme # leave as helpful for initial development
|
|
||||||
self.stateChanging(theme)
|
self.stateChanging(theme)
|
||||||
self.ThemeNameEdit.setText(self.theme.theme_name)
|
self.ThemeNameEdit.setText(self.theme.theme_name)
|
||||||
if self.theme.background_mode == u'opaque':
|
if self.theme.background_mode == u'opaque':
|
||||||
|
@ -143,7 +143,7 @@ class ServiceManager(QWidget):
|
|||||||
QtCore.SIGNAL("activated(int)"), self.onThemeComboBoxSelected)
|
QtCore.SIGNAL("activated(int)"), self.onThemeComboBoxSelected)
|
||||||
|
|
||||||
def onThemeComboBoxSelected(self, currentIndex):
|
def onThemeComboBoxSelected(self, currentIndex):
|
||||||
self.renderManager.set_default_theme(self.ThemeComboBox.currentText())
|
self.renderManager.default_theme = self.ThemeComboBox.currentText()
|
||||||
|
|
||||||
def addServiceItem(self, item):
|
def addServiceItem(self, item):
|
||||||
"""Adds service item"""
|
"""Adds service item"""
|
||||||
@ -197,5 +197,5 @@ class ServiceManager(QWidget):
|
|||||||
self.ThemeComboBox.clear()
|
self.ThemeComboBox.clear()
|
||||||
for theme in theme_list:
|
for theme in theme_list:
|
||||||
self.ThemeComboBox.addItem(theme)
|
self.ThemeComboBox.addItem(theme)
|
||||||
self.renderManager.set_default_theme(self.ThemeComboBox.currentText())
|
self.renderManager.default_theme = self.ThemeComboBox.currentText()
|
||||||
|
|
||||||
|
@ -33,31 +33,35 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.PaneLayout.setSpacing(50)
|
self.PaneLayout.setSpacing(50)
|
||||||
self.PaneLayout.setMargin(0)
|
self.PaneLayout.setMargin(0)
|
||||||
|
|
||||||
# self.Controller = QtGui.QGraphicsView(self.Splitter)
|
#self.VerseListView = QtGui.QListWidget(customEditDialog)
|
||||||
|
#self.VerseListView.setObjectName("VerseListView")
|
||||||
|
#self.horizontalLayout_4.addWidget(self.VerseListView)
|
||||||
|
|
||||||
self.Controller = QtGui.QScrollArea(self.Splitter)
|
self.Controller = QtGui.QScrollArea(self.Splitter)
|
||||||
self.Controller.setWidgetResizable(True)
|
self.Controller.setWidgetResizable(True)
|
||||||
|
|
||||||
self.ControllerContents = QtGui.QWidget(self.Controller)
|
self.ControllerContents = QtGui.QWidget(self.Controller)
|
||||||
self.ControllerContents.setGeometry(QtCore.QRect(0, 0, 228, 536))
|
self.ControllerContents.setGeometry(QtCore.QRect(0, 0, 228, 536))
|
||||||
self.Controller.setGeometry(QtCore.QRect(0, 0, 828, 536))
|
self.Controller.setGeometry(QtCore.QRect(0, 0, 828, 536))
|
||||||
|
|
||||||
self.Controller.setWidget(self.ControllerContents)
|
self.Controller.setWidget(self.ControllerContents)
|
||||||
|
|
||||||
#self.Screen = QtGui.QGraphicsView(self.Splitter)
|
self.SlidePreview = QtGui.QLabel(self.Splitter)
|
||||||
#self.Screen.setMaximumSize(QtCore.QSize(16777215, 250))
|
|
||||||
|
|
||||||
|
|
||||||
self.ThemePreview = QtGui.QLabel(self.Splitter)
|
|
||||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||||
sizePolicy.setHorizontalStretch(0)
|
sizePolicy.setHorizontalStretch(0)
|
||||||
sizePolicy.setVerticalStretch(0)
|
sizePolicy.setVerticalStretch(0)
|
||||||
sizePolicy.setHeightForWidth(self.ThemePreview.sizePolicy().hasHeightForWidth())
|
sizePolicy.setHeightForWidth(self.SlidePreview.sizePolicy().hasHeightForWidth())
|
||||||
self.ThemePreview.setSizePolicy(sizePolicy)
|
self.SlidePreview.setSizePolicy(sizePolicy)
|
||||||
self.ThemePreview.setMinimumSize(QtCore.QSize(250, 190))
|
self.SlidePreview.setMinimumSize(QtCore.QSize(250, 190))
|
||||||
self.ThemePreview.setFrameShape(QtGui.QFrame.WinPanel)
|
self.SlidePreview.setFrameShape(QtGui.QFrame.WinPanel)
|
||||||
self.ThemePreview.setFrameShadow(QtGui.QFrame.Sunken)
|
self.SlidePreview.setFrameShadow(QtGui.QFrame.Sunken)
|
||||||
self.ThemePreview.setLineWidth(1)
|
self.SlidePreview.setLineWidth(1)
|
||||||
self.ThemePreview.setScaledContents(True)
|
self.SlidePreview.setScaledContents(True)
|
||||||
self.ThemePreview.setObjectName("ThemePreview")
|
self.SlidePreview.setObjectName("SlidePreview")
|
||||||
|
|
||||||
|
|
||||||
def previewFrame(self, frame):
|
def previewFrame(self, frame):
|
||||||
self.ThemePreview.setPixmap(frame)
|
self.SlidePreview.setPixmap(frame)
|
||||||
|
|
||||||
|
imageLabel = QtGui.QLabel()
|
||||||
|
imageLabel.setPixmap(frame)
|
||||||
|
self.Controller.setWidget(imageLabel)
|
||||||
|
@ -219,7 +219,6 @@ class ThemeManager(QWidget):
|
|||||||
|
|
||||||
def loadThemes(self):
|
def loadThemes(self):
|
||||||
log.debug(u'Load themes from dir')
|
log.debug(u'Load themes from dir')
|
||||||
# self.themelist = [u'African Sunset', u'Snowy Mountains', u'Wilderness', u'Wet and Windy London']
|
|
||||||
for root, dirs, files in os.walk(self.path):
|
for root, dirs, files in os.walk(self.path):
|
||||||
for name in files:
|
for name in files:
|
||||||
if name.endswith(u'.png'):
|
if name.endswith(u'.png'):
|
||||||
@ -232,6 +231,7 @@ class ThemeManager(QWidget):
|
|||||||
return self.Theme_data.getList()
|
return self.Theme_data.getList()
|
||||||
|
|
||||||
def getThemeData(self, themename):
|
def getThemeData(self, themename):
|
||||||
|
log.debug(u'getthemedata for theme %s', themename)
|
||||||
xml_file = os.path.join(self.path, str(themename), str(themename)+u'.xml')
|
xml_file = os.path.join(self.path, str(themename), str(themename)+u'.xml')
|
||||||
xml = fileToXML(xml_file)
|
xml = fileToXML(xml_file)
|
||||||
theme = ThemeXML()
|
theme = ThemeXML()
|
||||||
@ -344,9 +344,8 @@ class ThemeManager(QWidget):
|
|||||||
im.save(samplepathname, u'png')
|
im.save(samplepathname, u'png')
|
||||||
log.debug(u'Theme image written to %s',samplepathname)
|
log.debug(u'Theme image written to %s',samplepathname)
|
||||||
|
|
||||||
def generateImage(self, theme):
|
def generateImage(self, themedata):
|
||||||
log.debug(u'generateImage %s ', theme)
|
log.debug(u'generateImage %s ', themedata)
|
||||||
self.renderManager.set_theme(theme)
|
frame = self.renderManager.generate_preview(themedata)
|
||||||
frame = self.renderManager.generate_preview()
|
|
||||||
return frame
|
return frame
|
||||||
|
|
||||||
|
@ -355,6 +355,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
if len(footer_lines) <= 1:
|
if len(footer_lines) <= 1:
|
||||||
footer_lines.append(book)
|
footer_lines.append(book)
|
||||||
|
|
||||||
|
self.parent.render_manager.set_override_theme(None)
|
||||||
frame=self.parent.render_manager.generate_slide(main_lines, footer_lines)
|
frame=self.parent.render_manager.generate_slide(main_lines, footer_lines)
|
||||||
self.parent.preview_controller.previewFrame(frame)
|
self.parent.preview_controller.previewFrame(frame)
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
|||||||
if id != 0:
|
if id != 0:
|
||||||
self.customSlide = self.custommanager.get_custom(id)
|
self.customSlide = self.custommanager.get_custom(id)
|
||||||
self.TitleEdit.setText(self.customSlide.title)
|
self.TitleEdit.setText(self.customSlide.title)
|
||||||
self.CreditEdit.setText(self.customSlide.title)
|
self.CreditEdit.setText(self.customSlide.credits)
|
||||||
|
|
||||||
songXML=SongXMLParser(self.customSlide.text)
|
songXML=SongXMLParser(self.customSlide.text)
|
||||||
verseList = songXML.get_verses()
|
verseList = songXML.get_verses()
|
||||||
@ -170,5 +170,9 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
|||||||
self.TitleLabel.setStyleSheet('color: red')
|
self.TitleLabel.setStyleSheet('color: red')
|
||||||
else:
|
else:
|
||||||
self.TitleLabel.setStyleSheet('color: black')
|
self.TitleLabel.setStyleSheet('color: black')
|
||||||
|
|
||||||
|
if self.VerseListView.count() == 0: # must have 1 slide
|
||||||
|
invalid += 1
|
||||||
|
|
||||||
if invalid == 1:
|
if invalid == 1:
|
||||||
self.valid = False
|
self.valid = False
|
||||||
|
@ -189,20 +189,28 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
main_lines=[]
|
main_lines=[]
|
||||||
footer_lines = []
|
footer_lines = []
|
||||||
slide = None
|
slide = None
|
||||||
|
theme = None
|
||||||
for index in indexes:
|
for index in indexes:
|
||||||
id = self.CustomListData.getId(index)
|
id = self.CustomListData.getId(index)
|
||||||
customSlide = self.parent.custommanager.get_custom(id)
|
customSlide = self.parent.custommanager.get_custom(id)
|
||||||
title = customSlide.title
|
title = customSlide.title
|
||||||
credit = customSlide.title
|
credit = customSlide.credits
|
||||||
|
theme = customSlide.theme_name
|
||||||
|
if len(theme) == 0 or theme == None:
|
||||||
|
self.parent.render_manager.set_override_theme(None)
|
||||||
|
else:
|
||||||
|
self.parent.render_manager.set_override_theme(theme)
|
||||||
|
|
||||||
songXML=SongXMLParser(customSlide.text)
|
songXML=SongXMLParser(customSlide.text)
|
||||||
verseList = songXML.get_verses()
|
verseList = songXML.get_verses()
|
||||||
for verse in verseList:
|
for verse in verseList:
|
||||||
slide = self.parent.render_manager.format_slide(verse[1], False)
|
slide = self.parent.render_manager.format_slide(verse[1], False)
|
||||||
|
print verse
|
||||||
|
print slide
|
||||||
|
|
||||||
footer_lines.append(title + u' '+ credit)
|
footer_lines.append(title + u' '+ credit)
|
||||||
|
if slide is not None:
|
||||||
frame=self.parent.render_manager.generate_slide(slide, footer_lines)
|
frame=self.parent.render_manager.generate_slide(slide, footer_lines, False)
|
||||||
self.parent.preview_controller.previewFrame(frame)
|
self.parent.preview_controller.previewFrame(frame)
|
||||||
|
|
||||||
def onCustomLiveClick(self):
|
def onCustomLiveClick(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user