forked from openlp/openlp
short lines
This commit is contained in:
parent
deff310f53
commit
87587ab8e8
@ -360,8 +360,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
combo boxes on the 'Advanced Search' Tab. This is not of any importance of the 'Quick Search' Tab.
|
combo boxes on the 'Advanced Search' Tab. This is not of any importance of the 'Quick Search' Tab.
|
||||||
|
|
||||||
:param bible: The bible to initialise (unicode).
|
:param bible: The bible to initialise (unicode).
|
||||||
:param last_book_id: The "book reference id" of the book which is chosen at the moment.
|
:param last_book_id: The "book reference id" of the book which is chosen at the moment. (int)
|
||||||
(int)
|
|
||||||
"""
|
"""
|
||||||
log.debug('initialise_advanced_bible %s, %s', bible, last_book_id)
|
log.debug('initialise_advanced_bible %s, %s', bible, last_book_id)
|
||||||
book_data = self.plugin.manager.get_books(bible)
|
book_data = self.plugin.manager.get_books(bible)
|
||||||
@ -421,9 +420,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def update_auto_completer(self):
|
def update_auto_completer(self):
|
||||||
"""
|
"""
|
||||||
This updates the bible book completion list for the search field. The
|
This updates the bible book completion list for the search field. The completion depends on the bible. It is
|
||||||
completion depends on the bible. It is only updated when we are doing a
|
only updated when we are doing a reference search, otherwise the auto completion list is removed.
|
||||||
reference search, otherwise the auto completion list is removed.
|
|
||||||
"""
|
"""
|
||||||
log.debug('update_auto_completer')
|
log.debug('update_auto_completer')
|
||||||
# Save the current search type to the configuration.
|
# Save the current search type to the configuration.
|
||||||
@ -593,8 +591,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
:param range_from: The first number of the range (int).
|
:param range_from: The first number of the range (int).
|
||||||
:param range_to: The last number of the range (int).
|
:param range_to: The last number of the range (int).
|
||||||
:param combo: The combo box itself (QComboBox).
|
:param combo: The combo box itself (QComboBox).
|
||||||
:param restore: If True, then the combo's currentText will be restored after
|
:param restore: If True, then the combo's currentText will be restored after adjusting (if possible).
|
||||||
adjusting (if possible).
|
|
||||||
"""
|
"""
|
||||||
log.debug('adjust_combo_box %s, %s, %s', combo, range_from, range_to)
|
log.debug('adjust_combo_box %s, %s, %s', combo, range_from, range_to)
|
||||||
if restore:
|
if restore:
|
||||||
@ -640,8 +637,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def on_quick_search_button(self):
|
def on_quick_search_button(self):
|
||||||
"""
|
"""
|
||||||
Does a quick search and saves the search results. Quick search can
|
Does a quick search and saves the search results. Quick search can either be "Reference Search" or
|
||||||
either be "Reference Search" or "Text Search".
|
"Text Search".
|
||||||
"""
|
"""
|
||||||
log.debug('Quick Search Button clicked')
|
log.debug('Quick Search Button clicked')
|
||||||
self.quickSearchButton.setEnabled(False)
|
self.quickSearchButton.setEnabled(False)
|
||||||
@ -696,8 +693,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def display_results(self, bible, second_bible=''):
|
def display_results(self, bible, second_bible=''):
|
||||||
"""
|
"""
|
||||||
Displays the search results in the media manager. All data needed for
|
Displays the search results in the media manager. All data needed for further action is saved for/in each row.
|
||||||
further action is saved for/in each row.
|
|
||||||
"""
|
"""
|
||||||
items = self.build_display_results(bible, second_bible, self.search_results)
|
items = self.build_display_results(bible, second_bible, self.search_results)
|
||||||
for bible_verse in items:
|
for bible_verse in items:
|
||||||
@ -708,8 +704,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def build_display_results(self, bible, second_bible, search_results):
|
def build_display_results(self, bible, second_bible, search_results):
|
||||||
"""
|
"""
|
||||||
Displays the search results in the media manager. All data needed for
|
Displays the search results in the media manager. All data needed for further action is saved for/in each row.
|
||||||
further action is saved for/in each row.
|
|
||||||
"""
|
"""
|
||||||
verse_separator = get_reference_separator('sep_v_display')
|
verse_separator = get_reference_separator('sep_v_display')
|
||||||
version = self.plugin.manager.get_meta_data(bible, 'name').value
|
version = self.plugin.manager.get_meta_data(bible, 'name').value
|
||||||
@ -858,9 +853,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def format_title(self, start_bitem, old_bitem):
|
def format_title(self, start_bitem, old_bitem):
|
||||||
"""
|
"""
|
||||||
This method is called, when we have to change the title, because
|
This method is called, when we have to change the title, because we are at the end of a verse range. E. g. if we
|
||||||
we are at the end of a verse range. E. g. if we want to add
|
want to add Genesis 1:1-6 as well as Daniel 2:14.
|
||||||
Genesis 1:1-6 as well as Daniel 2:14.
|
|
||||||
|
|
||||||
:param start_bitem: The first item of a range.
|
:param start_bitem: The first item of a range.
|
||||||
:param old_bitem: The last item of a range.
|
:param old_bitem: The last item of a range.
|
||||||
@ -890,10 +884,8 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def check_title(self, bitem, old_bitem):
|
def check_title(self, bitem, old_bitem):
|
||||||
"""
|
"""
|
||||||
This method checks if we are at the end of an verse range. If that is
|
This method checks if we are at the end of an verse range. If that is the case, we return True, otherwise False.
|
||||||
the case, we return True, otherwise False. E. g. if we added
|
E. g. if we added Genesis 1:1-6, but the next verse is Daniel 2:14, we return True.
|
||||||
|
|
||||||
Genesis 1:1-6, but the next verse is Daniel 2:14, we return True.
|
|
||||||
|
|
||||||
:param bitem: The item we are dealing with at the moment.
|
:param bitem: The item we are dealing with at the moment.
|
||||||
:param old_bitem: The item we were previously dealing with.
|
:param old_bitem: The item we were previously dealing with.
|
||||||
@ -917,18 +909,15 @@ class BibleMediaItem(MediaManagerItem):
|
|||||||
return True
|
return True
|
||||||
elif old_chapter + 1 == chapter and (verse != 1 or old_verse !=
|
elif old_chapter + 1 == chapter and (verse != 1 or old_verse !=
|
||||||
self.plugin.manager.get_verse_count(old_bible, old_book, old_chapter)):
|
self.plugin.manager.get_verse_count(old_bible, old_book, old_chapter)):
|
||||||
# We are in the following chapter, but the last verse was not the
|
# We are in the following chapter, but the last verse was not the last verse of the chapter or the current
|
||||||
# last verse of the chapter or the current verse is not the
|
# verse is not the first one of the chapter.
|
||||||
# first one of the chapter.
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def format_verse(self, old_chapter, chapter, verse):
|
def format_verse(self, old_chapter, chapter, verse):
|
||||||
"""
|
"""
|
||||||
Formats and returns the text, each verse starts with, for the given
|
Formats and returns the text, each verse starts with, for the given chapter and verse. The text is either
|
||||||
chapter and verse. The text is either surrounded by round, square,
|
surrounded by round, square, curly brackets or no brackets at all. For example::
|
||||||
|
|
||||||
curly brackets or no brackets at all. For example::
|
|
||||||
|
|
||||||
'{su}1:1{/su}'
|
'{su}1:1{/su}'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user