Fix Bible Search and start OOS selection

bzr-revno: 311
This commit is contained in:
Tim Bentley 2009-02-13 05:43:10 +00:00
parent 5019c7296e
commit 3202f28c1f

View File

@ -251,7 +251,15 @@ class BiblePlugin(Plugin, PluginUtils):
pass pass
def onBiblePreviewClick(self): def onBiblePreviewClick(self):
pass items = self.BibleListView.selectedItems()
for item in items:
print item.text()
print item.isSelected()
text = str(item.text())
verse = text[:text.find("(")]
bible = text[text.find("(")+1:text.find(")")]
self.translate(bible, verse)
print self.searchresults
def onBibleLiveClick(self): def onBibleLiveClick(self):
pass pass
@ -367,15 +375,14 @@ class BiblePlugin(Plugin, PluginUtils):
self._search_text(bible, text) self._search_text(bible, text)
else: else:
self.translate(bible, text) self.translate(bible, text)
if not self.searchresults == None:
self._display_results(bible)
def _search_text(self, bible, text): def _search_text(self, bible, text):
self.log.debug("_search Text %s,%s", bible, text) self.log.debug("_search Text %s,%s", bible, text)
self.searchresults = self.biblemanager.get_verse_from_text(bible,text) self.searchresults = self.biblemanager.get_verse_from_text(bible,text)
self._display_results(bible) self._display_results(bible)
# def _verse_search(self):
# self._display_results()
def _display_results(self, bible): def _display_results(self, bible):
for book, chap, vse , txt in self.searchresults: for book, chap, vse , txt in self.searchresults:
c = self.BibleListView.rowCount() c = self.BibleListView.rowCount()
@ -437,7 +444,10 @@ class BiblePlugin(Plugin, PluginUtils):
if echapter == "": if echapter == "":
echapter = schapter echapter = schapter
if sverse == "": if sverse == "":
if everse == "":
sverse = 1 sverse = 1
else:
sverse = everse
if everse == "": if everse == "":
everse = 99 everse = 99
if schapter == "": if schapter == "":
@ -448,8 +458,8 @@ class BiblePlugin(Plugin, PluginUtils):
# print "verse s =" + str(sverse) # print "verse s =" + str(sverse)
# print "verse e =" + str(everse) # print "verse e =" + str(everse)
if message == None: if message == None:
self.searchresults = 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)
else: else:
reply = QtGui.QMessageBox.information(self.MediaManagerItem,"Information",message) reply = QtGui.QMessageBox.information(self.MediaManagerItem,"Information",message)