diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 6ce51ab60..e35c78559 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -234,10 +234,10 @@ class Renderer(object): serviceItem = ServiceItem() if self.force_page: # make big page for theme edit dialog to get line count - serviceItem.add_from_text(u'', VERSE_FOR_LINE_COUNT) + serviceItem.add_from_text(VERSE_FOR_LINE_COUNT) else: self.image_manager.deleteImage(theme_data.theme_name) - serviceItem.add_from_text(u'', VERSE) + serviceItem.add_from_text(VERSE) serviceItem.renderer = self serviceItem.raw_footer = FOOTER # if No file do not update cache diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 5ee8e6167..1e9555eb9 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -220,20 +220,17 @@ class ServiceItem(object): self.image_border) self._new_item() - def add_from_text(self, title, raw_slide, verse_tag=None): + def add_from_text(self, raw_slide, verse_tag=None): """ Add a text slide to the service item. - ``frame_title`` - The title of the slide in the service item. - ``raw_slide`` The raw text of the slide. """ if verse_tag: verse_tag = verse_tag.upper() self.service_item_type = ServiceItemType.Text - title = title.split(u'\n')[0] + title = raw_slide[:30].split(u'\n')[0] self._raw_frames.append( {u'title': title, u'raw_slide': raw_slide, u'verseTag': verse_tag}) self._new_item() diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index e1209514c..422e2deff 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -63,8 +63,7 @@ class BiblePlugin(Plugin): # unicode(UiStrings().Export)) # Set to invisible until we can export bibles self.exportBibleItem.setVisible(False) - if self.manager.old_bible_databases: - self.toolsUpgradeItem.setVisible(True) + self.toolsUpgradeItem.setVisible(bool(self.manager.old_bible_databases)) def finalise(self): """ diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 84a9f81e2..11edd4228 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -63,6 +63,7 @@ class Verse(BaseModel): """ pass + def init_schema(url): """ Setup a bible database connection and initialise the database schema. diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 6ff622e9d..dcabe360e 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -418,7 +418,7 @@ class BibleMediaItem(MediaManagerItem): ``bible`` The bible to initialise (unicode). - + ``last_book_id`` The "book reference id" of the book which is choosen at the moment. (int) @@ -976,7 +976,7 @@ class BibleMediaItem(MediaManagerItem): else: service_item.theme = self.settings.bible_theme for slide in raw_slides: - service_item.add_from_text(slide[:30], slide) + service_item.add_from_text(slide) return True def formatTitle(self, start_bitem, old_bitem): diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index d2002deb5..3e25fb6c5 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -210,12 +210,12 @@ class CustomMediaItem(MediaManagerItem): theme = customSlide.theme_name if theme: service_item.theme = theme - customXML = CustomXMLParser(customSlide.text) - verseList = customXML.get_verses() - raw_slides = [verse[1] for verse in verseList] + custom_xml = CustomXMLParser(customSlide.text) + verse_list = custom_xml.get_verses() + raw_slides = [verse[1] for verse in verse_list] service_item.title = title for slide in raw_slides: - service_item.add_from_text(slide[:30], slide) + service_item.add_from_text(slide) if Settings().value(self.settingsSection + u'/display footer', QtCore.QVariant(True)).toBool() or credit: service_item.raw_footer.append(u' '.join([title, credit])) diff --git a/openlp/plugins/remotes/html/openlp.js b/openlp/plugins/remotes/html/openlp.js index e1a425860..470185a44 100644 --- a/openlp/plugins/remotes/html/openlp.js +++ b/openlp/plugins/remotes/html/openlp.js @@ -245,6 +245,9 @@ window.OpenLP = { } else { $.each(data.results.items, function (idx, value) { + if (typeof value[0] !== "number"){ + value[0] = OpenLP.escapeString(value[0]) + } ul.append($("