forked from openlp/openlp
Corrections to Renderer to handle slides not lines
Fixes to Bibleplugin to renderer multiple verses per slide Pass Bible Theme to RenderManager
This commit is contained in:
parent
df0fd5b618
commit
a5615fd4fe
@ -118,7 +118,7 @@ class Renderer:
|
||||
"""
|
||||
log.debug(u'format_slide %s', words)
|
||||
verses = []
|
||||
verses_text = words.splitlines()
|
||||
verses_text = words.split(u'\n\n')
|
||||
for verse in verses_text:
|
||||
lines = verse.split(u'\n')
|
||||
verses.append(self.split_set_of_lines(lines, footer)[0])
|
||||
|
@ -123,7 +123,7 @@ class RenderManager:
|
||||
self.calculate_default(self.screen_list[self.current_display]['size'])
|
||||
self.build_text_rectangle(self.themedata)
|
||||
self.renderer.set_frame_dest(self.width, self.height)
|
||||
return self.renderer.format_slide(words, footer)
|
||||
return self.renderer.format_slide(words, False)
|
||||
|
||||
def generate_slide(self,main_text, footer_text):
|
||||
log.debug(u'generate slide')
|
||||
|
@ -198,6 +198,7 @@ class BiblesTab(SettingsTab):
|
||||
self.BibleThemeComboBox.setCurrentIndex(self.bible_theme)
|
||||
else:
|
||||
pass # TODO need to code
|
||||
self.bible_theme = None
|
||||
|
||||
def save(self):
|
||||
self.config.set_config("paragraph style", str(self.paragraph_style))
|
||||
|
@ -369,13 +369,14 @@ class BibleMediaItem(MediaManagerItem):
|
||||
def generateSlideData(self, service_item):
|
||||
log.debug(u'Bible Preview Button pressed')
|
||||
items = self.BibleListView.selectedIndexes()
|
||||
old_chapter = ''
|
||||
old_chapter = u''
|
||||
raw_slides=[]
|
||||
raw_footer = []
|
||||
bible_text = u''
|
||||
for item in items:
|
||||
text = self.BibleListData.getValue(item)
|
||||
verse = text[:text.find("(")]
|
||||
bible = text[text.find("(") + 1:text.find(")")]
|
||||
verse = text[:text.find(u'(')]
|
||||
bible = text[text.find(u'(') + 1:text.find(u')')]
|
||||
self.searchByReference(bible, verse)
|
||||
book = self.search_results[0][0]
|
||||
chapter = str(self.search_results[0][1])
|
||||
@ -392,13 +393,13 @@ class BibleMediaItem(MediaManagerItem):
|
||||
else:
|
||||
loc = self.formatVerse(old_chapter, chapter, verse, u'', u'')
|
||||
old_chapter = chapter
|
||||
raw_slides.append(loc + u' '+text)
|
||||
bible_text = bible_text + u' '+ loc + u' '+ text
|
||||
service_item.title = book + u' ' + loc
|
||||
if len(raw_footer) <= 1:
|
||||
raw_footer.append(book)
|
||||
|
||||
if len(raw_slides) > 0:
|
||||
service_item.theme = None
|
||||
service_item.theme = self.parent.bibles_tab.bible_theme
|
||||
raw_slides.append(bible_text)
|
||||
service_item.raw_slides = raw_slides
|
||||
service_item.raw_footer = raw_footer
|
||||
|
||||
|
@ -1,3 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
|
||||
"""
|
||||
OpenLP - Open Source Lyrics Projection
|
||||
Copyright (c) 2008 Raoul Snyman
|
||||
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; version 2 of the License.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
"""
|
||||
import logging
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
@ -25,7 +44,7 @@ class TextListData(QAbstractListModel):
|
||||
|
||||
def insertRow(self, row, id, title):
|
||||
self.beginInsertRows(QModelIndex(),row,row)
|
||||
log.debug("insert row %d:%s for id %d"%(row,title, id))
|
||||
log.debug(u'insert row %d:%s for id %d'%(row,title, id))
|
||||
self.items.insert(row, (id, title))
|
||||
self.endInsertRows()
|
||||
|
||||
@ -43,11 +62,8 @@ class TextListData(QAbstractListModel):
|
||||
return QVariant()
|
||||
if role == Qt.DisplayRole:
|
||||
retval = self.items[row][1]
|
||||
# elif role == Qt.ToolTipRole: #not sure if need as it shows the database row number
|
||||
# retval= self.items[row][0]
|
||||
else:
|
||||
retval = QVariant()
|
||||
# log.info("Returning"+ str(retval))
|
||||
if type(retval) is not type(QVariant):
|
||||
return QVariant(retval)
|
||||
else:
|
||||
@ -64,6 +80,3 @@ class TextListData(QAbstractListModel):
|
||||
def deleteRow(self, index):
|
||||
row = index.row()
|
||||
self.removeRow(row)
|
||||
|
||||
if __name__=="__main__":
|
||||
sxml=TextListData()
|
||||
|
Loading…
Reference in New Issue
Block a user