mediaitem¶
-
class
openlp.plugins.bibles.lib.mediaitem.
BibleMediaItem
(*args, **kwargs)[source]¶ Bases:
openlp.core.lib.mediamanageritem.MediaManagerItem
This is the custom media manager item for Bibles.
-
adjust_combo_box
(range_from, range_to, combo, restore=False)[source]¶ Adjusts the given como box to the given values.
Parameters: - range_from – The first number of the range (int).
- range_to – The last number of the range (int).
- combo – The combo box itself (QComboBox).
- restore – If True, then the combo’s currentText will be restored after adjusting (if possible).
-
bibles_add_to_service
¶
-
bibles_go_live
¶
-
build_display_results
(bible, second_bible, search_results)[source]¶ Displays the search results in the media manager. All data needed for further action is saved for/in each row.
-
format_verse
(old_chapter, chapter, verse)[source]¶ Formats and returns the text, each verse starts with, for the given chapter and verse. The text is either surrounded by round, square, curly brackets or no brackets at all. For example:
'{su}1:1{/su}'
Parameters: - old_chapter – The previous verse’s chapter number (int).
- chapter – The chapter number (int).
- verse – The verse number (int).
Returns: An empty or formatted string
-
generate_slide_data
(service_item, item=None, xml_version=False, remote=False, context=2)[source]¶ Generate the slide data. Needs to be implemented by the plugin.
Parameters: - service_item – The service item to be built on
- item – The Song item to be used
- xml_version – The xml version (not used)
- remote – Triggered from remote
- context – Why is it being generated
-
get_common_books
(first_bible, second_bible=None)[source]¶ Return a list of common books between two bibles.
Parameters: - first_bible – The first bible (BibleDB)
- second_bible – The second bible. (Optional, BibleDB
Returns: A list of common books between the two bibles. Or if only one bible is supplied a list of that bibles books (list of Book objects)
-
initialise
()[source]¶ Called to complete initialisation that could not be completed in the constructor.
Returns: None
-
initialise_advanced_bible
(last_book=None)[source]¶ This initialises the given bible, which means that its book names and their chapter numbers is added to the combo boxes on the ‘Select’ Tab. This is not of any importance of the ‘Search’ Tab.
Parameters: last_book_id – The “book reference id” of the book which is chosen at the moment. (int) Returns: None
Change the sort order of the book names
Parameters: checked – Indicates if the button is checked or not (Bool) Returns: None
Clear the list_view and the search_edit
Returns: None
-
on_edit_click
()[source]¶ Load the EditBibleForm and reload the bibles if the user accepts it
Returns: None
-
on_focus
()[source]¶ Set focus on the appropriate widget when BibleMediaItem receives focus
Reimplements MediaManagerItem.on_focus()
Returns: None
Toggle the lock button, if Search tab is used, set focus to search field.
Parameters: checked – The state of the toggle button. (bool) Returns: None
Call the correct search function depending on which tab the user is using
Returns: None
-
on_search_edit_text_changed
()[source]¶ If ‘search_as_you_type’ is enabled, start a timer when the search_edit emits a textChanged signal. This is to prevent overloading the system by submitting too many search requests in a short space of time.
Returns: None
-
on_search_tab_bar_current_changed
(index)[source]¶ Show the selected tab and set focus to it
Parameters: index – The tab selected (int) Returns: None
-
on_search_timer_timeout
()[source]¶ Perform a search when the search timer timeouts. The search timer is used for ‘search_as_you_type’ so that we don’t overload the system buy submitting too many search requests in a short space of time.
Returns: None
-
on_second_combo_box_index_changed
(selection)[source]¶ Update the second bible. If changing from single to dual bible modes as if the user wants to clear the search results, if not revert to the previously selected bible
Returns: None
-
on_style_combo_box_index_changed
(index)[source]¶ Change the layout style and save the setting
Parameters: index – The index of the current item in the combobox (int) Returns: None
-
on_text_search
(text, search_while_type=False)[source]¶ We are doing a ‘Text Search’. This search is called on def text_search by ‘Search’ Text and Combined Searches.
-
on_version_combo_box_index_changed
()[source]¶ Update the main bible and save it to settings
Returns: None
-
populate_bible_combo_boxes
()[source]¶ Populate the bible combo boxes with the list of bibles that have been loaded
Returns: None
-
text_reference_search
(search_text)[source]¶ We are doing a ‘Reference Search’. This search is called on def text_search by Reference and Combined Searches.
Returns: None
-