forked from openlp/openlp
Bible reference error message
This commit is contained in:
parent
fc849398a9
commit
7729ba3ced
@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore, QtGui
|
||||||
|
|
||||||
from openlp.core.lib import SettingsManager
|
from openlp.core.lib import SettingsManager, translate
|
||||||
from openlp.core.utils import AppLocation
|
from openlp.core.utils import AppLocation
|
||||||
from openlp.plugins.bibles.lib import parse_reference
|
from openlp.plugins.bibles.lib import parse_reference
|
||||||
from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
|
from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
|
||||||
@ -229,13 +229,33 @@ class BibleManager(object):
|
|||||||
``versetext``
|
``versetext``
|
||||||
Unicode. The scripture reference. Valid scripture references are:
|
Unicode. The scripture reference. Valid scripture references are:
|
||||||
|
|
||||||
|
- Genesis 1
|
||||||
|
- Genesis 1-2
|
||||||
- Genesis 1:1
|
- Genesis 1:1
|
||||||
- Genesis 1:1-10
|
- Genesis 1:1-10
|
||||||
|
- Genesis 1:1-10,15-20
|
||||||
- Genesis 1:1-2:10
|
- Genesis 1:1-2:10
|
||||||
|
- Genesis 1:1-10,2:1-10
|
||||||
"""
|
"""
|
||||||
log.debug(u'BibleManager.get_verses("%s", "%s")', bible, versetext)
|
log.debug(u'BibleManager.get_verses("%s", "%s")', bible, versetext)
|
||||||
reflist = parse_reference(versetext)
|
reflist = parse_reference(versetext)
|
||||||
return self.db_cache[bible].get_verses(reflist)
|
if reflist:
|
||||||
|
return self.db_cache[bible].get_verses(reflist)
|
||||||
|
else:
|
||||||
|
QtGui.QMessageBox.information(self.parent.mediaitem,
|
||||||
|
translate('BiblesPlugin.BibleManager',
|
||||||
|
'Scripture Reference Error'),
|
||||||
|
translate('BiblesPlugin.BibleManager', 'Your scripture '
|
||||||
|
'reference is either not supported by OpenLP or invalid. '
|
||||||
|
'Please make sure your reference conforms to one of the '
|
||||||
|
'following patterns:\n\n'
|
||||||
|
'Book Chapter\n'
|
||||||
|
'Book Chapter-Chapter\n'
|
||||||
|
'Book Chapter:Verse-Verse\n'
|
||||||
|
'Book Chapter:Verse-Verse,Verse-Verse\n'
|
||||||
|
'Book Chapter:Verse-Verse,Chapter:Verse-Verse\n'
|
||||||
|
'Book Chapter:Verse-Chapter:Verse\n'))
|
||||||
|
return None
|
||||||
|
|
||||||
def save_meta_data(self, bible, version, copyright, permissions):
|
def save_meta_data(self, bible, version, copyright, permissions):
|
||||||
"""
|
"""
|
||||||
|
@ -431,8 +431,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
chapter_to = int(self.AdvancedToChapter.currentText())
|
chapter_to = int(self.AdvancedToChapter.currentText())
|
||||||
verse_from = int(self.AdvancedFromVerse.currentText())
|
verse_from = int(self.AdvancedFromVerse.currentText())
|
||||||
verse_to = int(self.AdvancedToVerse.currentText())
|
verse_to = int(self.AdvancedToVerse.currentText())
|
||||||
versetext = u'%s %s:%s-%s:%s' % (book, chapter_from, verse_from, \
|
versetext = u'%s %s:%s-%s:%s' % (book, chapter_from, verse_from,
|
||||||
chapter_to, verse_to)
|
chapter_to, verse_to)
|
||||||
self.search_results = self.parent.manager.get_verses(bible, versetext)
|
self.search_results = self.parent.manager.get_verses(bible, versetext)
|
||||||
if self.ClearAdvancedSearchComboBox.currentIndex() == 0:
|
if self.ClearAdvancedSearchComboBox.currentIndex() == 0:
|
||||||
self.listView.clear()
|
self.listView.clear()
|
||||||
@ -656,7 +656,3 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
row = self.listView.setCurrentRow(count)
|
row = self.listView.setCurrentRow(count)
|
||||||
if row:
|
if row:
|
||||||
row.setSelected(True)
|
row.setSelected(True)
|
||||||
|
|
||||||
def searchByReference(self, bible, search):
|
|
||||||
log.debug(u'searchByReference %s, %s', bible, search)
|
|
||||||
self.search_results = self.parent.manager.get_verses(bible, search)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user