forked from openlp/openlp
Bible Plugin visual change and shorten delay
This commit is contained in:
parent
9c4e5ae137
commit
e3998431fc
@ -322,8 +322,7 @@ c
|
||||
Rest can be guessed at !
|
||||
"""
|
||||
text = []
|
||||
self.media.setQuickMsg1(u'')
|
||||
self.media.setQuickMsg2(u'')
|
||||
self.media.setQuickMessage(u'')
|
||||
log.debug(u'get_verse_text %s,%s,%s,%s,%s,%s',
|
||||
bible, bookname, schapter, echapter, sverse, everse)
|
||||
# check to see if book/chapter exists fow HTTP bibles and load cache
|
||||
@ -331,10 +330,10 @@ c
|
||||
if self.bible_http_cache[bible] is not None:
|
||||
book = self.bible_db_cache[bible].get_bible_book(bookname)
|
||||
if book is None:
|
||||
self.media.setQuickMsg1(u'Downloading')
|
||||
log.debug(u'get_verse_text : new book')
|
||||
for chapter in range(schapter, echapter + 1):
|
||||
self.media.setQuickMsg2(u'%s: %s'% (bookname, chapter))
|
||||
self.media.setQuickMessage \
|
||||
(u'Downloading %s: %s'% (bookname, chapter))
|
||||
search_results = \
|
||||
self.bible_http_cache[bible].get_bible_chapter(
|
||||
bible, 0, bookname, chapter)
|
||||
@ -374,9 +373,8 @@ c
|
||||
book.id, chapter)
|
||||
if v is None:
|
||||
try:
|
||||
self.media.setQuickMsg1(u'Downloading')
|
||||
self.media.setQuickMsg2(u'%s: %s'% \
|
||||
(bookname, chapter))
|
||||
self.media.setQuickMessage \
|
||||
(u'Downloading %s: %s'% (bookname, chapter))
|
||||
search_results = \
|
||||
self.bible_http_cache[bible].get_bible_chapter(
|
||||
bible, book.id, bookname, chapter)
|
||||
|
@ -76,7 +76,9 @@ class BibleMediaItem(MediaManagerItem):
|
||||
# Add the Quick Search tab
|
||||
self.QuickTab = QtGui.QWidget()
|
||||
self.QuickTab.setObjectName(u'QuickTab')
|
||||
self.QuickLayout = QtGui.QGridLayout(self.QuickTab)
|
||||
self.QuickVerticalLayout = QtGui.QVBoxLayout(self.QuickTab)
|
||||
self.QuickVerticalLayout.setObjectName("verticalLayout")
|
||||
self.QuickLayout = QtGui.QGridLayout()
|
||||
self.QuickLayout.setMargin(5)
|
||||
self.QuickLayout.setSpacing(4)
|
||||
self.QuickLayout.setObjectName(u'QuickLayout')
|
||||
@ -107,12 +109,10 @@ class BibleMediaItem(MediaManagerItem):
|
||||
self.ClearQuickSearchComboBox = QtGui.QComboBox(self.QuickTab)
|
||||
self.ClearQuickSearchComboBox.setObjectName(u'ClearQuickSearchComboBox')
|
||||
self.QuickLayout.addWidget(self.ClearQuickSearchComboBox, 3, 1, 1, 1)
|
||||
self.QuickMsg1 = QtGui.QLabel(self.QuickTab)
|
||||
self.QuickMsg1.setObjectName(u'QuickSearchLabel')
|
||||
self.QuickLayout.addWidget(self.QuickMsg1, 4, 0, 1, 1)
|
||||
self.QuickMsg2 = QtGui.QLabel(self.QuickTab)
|
||||
self.QuickMsg2.setObjectName(u'QuickSearchLabel')
|
||||
self.QuickLayout.addWidget(self.QuickMsg2, 4, 1, 1, 1)
|
||||
self.QuickVerticalLayout.addLayout(self.QuickLayout)
|
||||
self.QuickMessage = QtGui.QLabel(self.QuickTab)
|
||||
self.QuickMessage.setObjectName(u'QuickMessage')
|
||||
self.QuickVerticalLayout.addWidget(self.QuickMessage)
|
||||
self.SearchTabWidget.addTab(self.QuickTab, 'Quick')
|
||||
QuickSpacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum,
|
||||
QtGui.QSizePolicy.Expanding)
|
||||
@ -230,14 +230,11 @@ class BibleMediaItem(MediaManagerItem):
|
||||
self.loadBibles()
|
||||
self.parent.biblemanager.set_media_manager(self)
|
||||
|
||||
def setQuickMsg1(self, text):
|
||||
self.QuickMsg1.setText(translate(u'BibleMediaItem', unicode(text)))
|
||||
|
||||
def setQuickMsg2(self, text):
|
||||
self.QuickMsg2.setText(translate(u'BibleMediaItem', unicode(text)))
|
||||
def setQuickMessage(self, text):
|
||||
self.QuickMessage.setText(translate(u'BibleMediaItem', unicode(text)))
|
||||
Receiver().send_message(u'process_events')
|
||||
#minor delay to get the events processed
|
||||
time.sleep(0.5)
|
||||
time.sleep(0.1)
|
||||
|
||||
def loadBibles(self):
|
||||
log.debug(u'Loading Bibles')
|
||||
|
Loading…
Reference in New Issue
Block a user