lib¶
-
class
openlp.core.ui.lib.
ColorButton
(parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QPushButton
Subclasses QPushbutton to create a “Color Chooser” button
-
change_color
(color)[source]¶ Sets the _color variable and the background color.
Parameters: color – String representation of a hexidecimal color
-
color
¶ Property method to return the color variable
Returns: String representation of a hexidecimal color
-
colorChanged
¶
-
-
class
openlp.core.ui.lib.
ListPreviewWidget
(parent, screen_ratio)[source]¶ Bases:
PyQt5.QtWidgets.QTableWidget
,openlp.core.common.registryproperties.RegistryProperties
A special type of QTableWidget which lists the slides in the slide controller
Parameters: - parent –
- screen_ratio –
-
current_slide_number
()[source]¶ Returns the position of the currently active item. Will return -1 if the widget is empty.
-
replace_service_item
(service_item, width, slide_number)[source]¶ Replace the current preview items with the ones in service_item and display the given slide
Parameters: - service_item – The service item to insert
- width – The width of the column
- slide_number – The slide number to pre-select
-
class
openlp.core.ui.lib.
ListWidgetWithDnD
(parent=None, name='')[source]¶ Bases:
PyQt5.QtWidgets.QListWidget
Provide a list widget to store objects and handle drag and drop events
-
clear
(search_while_typing=False, override_lock=False)[source]¶ Re-implement clear, so that we can customise feedback when using ‘Search as you type’
Parameters: search_while_typing – True if we want to display the customised message Returns: None
-
dragEnterEvent
(event)[source]¶ When something is dragged into this object, check if you should be able to drop it in here.
-
dragMoveEvent
(event)[source]¶ Make an object droppable, and set it to copy the contents of the object, not move it.
-
dropEvent
(event)[source]¶ Receive drop event check if it is a file and process it if it is.
Parameters: event – Handle of the event pint passed
-
-
class
openlp.core.ui.lib.
MediaDockManager
(media_dock)[source]¶ Bases:
object
Provide a repository for MediaManagerItems
-
class
openlp.core.ui.lib.
OpenLPDockWidget
(parent=None, name=None, icon=None)[source]¶ Bases:
PyQt5.QtWidgets.QDockWidget
Custom DockWidget class to handle events
-
class
openlp.core.ui.lib.
OpenLPToolbar
(parent)[source]¶ Bases:
PyQt5.QtWidgets.QToolBar
Lots of toolbars around the place, so it makes sense to have a common way to manage them. This is the base toolbar class.
-
add_toolbar_action
(name, **kwargs)[source]¶ A method to help developers easily add a button to the toolbar. A new QAction is created by calling
create_action()
. The action is added to the toolbar and the toolbar is set as parent. For more details please look at openlp.core.lib.ui.create_action()
-
add_toolbar_widget
(widget)[source]¶ Add a widget and store it’s handle under the widgets object name.
-
-
class
openlp.core.ui.lib.
OpenLPWizard
(parent, plugin, name, image, add_progress_page=True)[source]¶ Bases:
PyQt5.QtWidgets.QWizard
,openlp.core.common.registryproperties.RegistryProperties
Generic OpenLP wizard to provide generic functionality and a unified look and feel.
parent
- The QWidget-derived parent of the wizard.
plugin
- Plugin this wizard is part of. The plugin will be saved in the “plugin” variable. The plugin will also be used as basis for the file dialog methods this class provides.
name
- The object name this wizard should have.
image
- The image to display on the “welcome” page of the wizard. Should be 163x350.
add_progress_page
- Whether to add a progress page with a progressbar at the end of the wizard.
-
add_progress_page
()[source]¶ Add the progress page for the wizard. This page informs the user how the wizard is progressing with its task.
-
custom_page_changed
(page_id)[source]¶ Called when changing to a page other than the progress page :param page_id: current page number
-
get_file_name
(title, editbox, setting_name, filters='')[source]¶ Opens a QFileDialog and saves the filename to the given editbox.
Parameters: - title – The title of the dialog (unicode).
- editbox – An editbox (QLineEdit).
- setting_name – The place where to save the last opened directory.
- filters –
The file extension filters. It should contain the file description as well as the file extension. For example:
'OpenLP 2 Databases (*.sqlite)'
-
get_folder
(title, editbox, setting_name)[source]¶ Opens a QFileDialog and saves the selected folder to the given editbox.
Parameters: - title – The title of the dialog (unicode).
- editbox – An editbox (QLineEdit).
- setting_name – The place where to save the last opened directory.
-
increment_progress_bar
(status_text, increment=1)[source]¶ Update the wizard progress page.
Parameters: - status_text – Current status information to display.
- increment – The value to increment the progress bar by.
-
on_current_id_changed
(page_id)[source]¶ Perform necessary functions depending on which wizard page is active. :param page_id: current page number
Called when the
error_copy_to_button
has been clicked.
Called when the
error_save_to_button
has been clicked.
-
class
openlp.core.ui.lib.
PathEdit
(parent=None, path_type=<PathType.Files: 1>, default_path=None, dialog_caption=None, show_revert=True)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
The
PathEdit
class subclasses QWidget to create a custom widget for use when a file or directory needs to be selected.A handler to handle a click on the browse button.
Show the QFileDialog and process the input from the user :return: None
-
on_line_edit_editing_finished
()[source]¶ A handler to handle when the line edit has finished being edited. :return: None
-
on_new_path
(path)[source]¶ A method called to validate and set a new path.
Emits the pathChanged Signal
Parameters: path (str) – The new path Returns: None
A handler to handle a click on the revert button.
Set the new path to the value of the default_path instance variable. :return: None
-
path
¶ A property getter method to return the selected path.
Returns: The selected path Return type: str
-
pathChanged
¶
-
path_type
¶ A property getter method to return the path_type. Path type allows you to sepecify if the user is restricted to selecting a file or directory.
Returns: The type selected Return type: Enum of PathEdit
Called to update the tooltips on the buttons. This is changing path types, and when the widget is initalised :return: None
-
class
openlp.core.ui.lib.
PathType
[source]¶ Bases:
enum.Enum
An enumeration.
-
Directories
= 2¶
-
Files
= 1¶
-
-
class
openlp.core.ui.lib.
SpellTextEdit
(parent=None, formatting_tags_allowed=True)[source]¶ Bases:
PyQt5.QtWidgets.QPlainTextEdit
Spell checking widget based on QPlanTextEdit.
-
class
openlp.core.ui.lib.
TreeWidgetWithDnD
(parent=None, name='')[source]¶ Bases:
PyQt5.QtWidgets.QTreeWidget
Provide a tree widget to store objects and handle drag and drop events
-
dragEnterEvent
(event)[source]¶ Receive drag enter event, check if it is a file or internal object and allow it if it is.
Parameters: event – The event that occurred
-
dragMoveEvent
(event)[source]¶ Receive drag move event, check if it is a file or internal object and allow it if it is.
Parameters: event – The event that occurred
-
-
class
openlp.core.ui.lib.
WizardStrings
[source]¶ Bases:
object
Provide standard strings for wizards to use.
-
CSV
= 'CSV'¶
-
FinishedImport
= 'Finished import.'¶
-
FormatLabel
= 'Format:'¶
-
HeaderStyle
= '<span style="font-size:14pt; font-weight:600;">%s</span>'¶
-
ImportSelect
= 'Select Import Source'¶
-
ImportSelectLong
= 'Select the import format and the location to import from.'¶
-
Importing
= 'Importing'¶
-
ImportingType
= 'Importing "%s"...'¶
-
OS
= 'OpenSong'¶
-
OSIS
= 'OSIS'¶
-
OpenTypeFile
= 'Open %s File'¶
-
OpenTypeFolder
= 'Open %s Folder'¶
-
PercentSymbolFormat
= '%p%'¶
-
Ready
= 'Ready.'¶
-
SWORD
= 'Sword'¶
-
StartingImport
= 'Starting import...'¶
-
WordProject
= 'WordProject'¶
-
YouSpecifyFile
= 'You need to specify one %s file to import from.'¶
-
YouSpecifyFiles
= 'You need to specify at least one %s file to import from.'¶
-
YouSpecifyFolder
= 'You need to specify one %s folder to import from.'¶
-
ZEF
= 'Zefania'¶
-