forked from openlp/openlp
Add error messaging for missing search parameters
bzr-revno: 295
This commit is contained in:
parent
fdf66b3bd5
commit
ffeada555d
@ -381,6 +381,7 @@ class BiblePlugin(Plugin, PluginUtils):
|
|||||||
sverse=""
|
sverse=""
|
||||||
everse=""
|
everse=""
|
||||||
search.replace(" ", " ")
|
search.replace(" ", " ")
|
||||||
|
message = None
|
||||||
#search = search.replace("v", ":") # allow V or v for verse instead of :
|
#search = search.replace("v", ":") # allow V or v for verse instead of :
|
||||||
#search = search.replace("V", ":") # allow V or v for verse instead of :
|
#search = search.replace("V", ":") # allow V or v for verse instead of :
|
||||||
co = search.find(":")
|
co = search.find(":")
|
||||||
@ -423,16 +424,18 @@ class BiblePlugin(Plugin, PluginUtils):
|
|||||||
sverse = 1
|
sverse = 1
|
||||||
if everse == "":
|
if everse == "":
|
||||||
everse = 99
|
everse = 99
|
||||||
print "book = " + book
|
if schapter == "":
|
||||||
print "chapter s =" + str(schapter)
|
message = "No chapter found for search"
|
||||||
print "chapter e =" + str(echapter)
|
# print "book = " + book
|
||||||
print "verse s =" + str(sverse)
|
# print "chapter s =" + str(schapter)
|
||||||
print "verse e =" + str(everse)
|
# print "chapter e =" + str(echapter)
|
||||||
if not schapter == "":
|
# print "verse s =" + str(sverse)
|
||||||
|
# print "verse e =" + str(everse)
|
||||||
|
if message == None:
|
||||||
self.searchresults = self.biblemanager.get_verse_text(bible, book,int(schapter), int(echapter), int(sverse), int(everse))
|
self.searchresults = self.biblemanager.get_verse_text(bible, book,int(schapter), int(echapter), int(sverse), int(everse))
|
||||||
self._display_results(bible)
|
self._display_results(bible)
|
||||||
else:
|
else:
|
||||||
QMessageBox.information(self,"Information","A plain, informational message")
|
reply = QtGui.QMessageBox.information(self.MediaManagerItem,"Information",message)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@ class BibleDBImpl(BibleCommon):
|
|||||||
self.biblefile = os.path.join(biblepath, biblename+u'.sqlite')
|
self.biblefile = os.path.join(biblepath, biblename+u'.sqlite')
|
||||||
log.debug( "Load bible %s on path %s", biblename, self.biblefile)
|
log.debug( "Load bible %s on path %s", biblename, self.biblefile)
|
||||||
db_type = self.config.get_config(u'db type')
|
db_type = self.config.get_config(u'db type')
|
||||||
db_type = u'sqlite'
|
|
||||||
if db_type == u'sqlite':
|
if db_type == u'sqlite':
|
||||||
self.db = create_engine("sqlite:///"+self.biblefile)
|
self.db = create_engine("sqlite:///"+self.biblefile)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user