pathedit

class openlp.core.ui.lib.pathedit.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.

on_browse_button_clicked()[source]

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
on_revert_button_clicked()[source]

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
update_button_tool_tips()[source]

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.pathedit.PathType[source]

Bases: enum.Enum

An enumeration.

Directories = <PathType.Directories: 2>
Files = <PathType.Files: 1>