forked from openlp/openlp
Added more docstrings
This commit is contained in:
parent
441296d808
commit
5c15585413
@ -315,8 +315,8 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Turn file from Drag and Drop into an array so the Validate code can run it.
|
Turn file from Drag and Drop into an array so the Validate code can run it.
|
||||||
|
|
||||||
``files``
|
``data``
|
||||||
The list of files to be loaded
|
A dictionary containing the list of files to be loaded and the target
|
||||||
"""
|
"""
|
||||||
new_files = []
|
new_files = []
|
||||||
error_shown = False
|
error_shown = False
|
||||||
@ -335,6 +335,9 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
def dnd_move_internal(self, target):
|
def dnd_move_internal(self, target):
|
||||||
"""
|
"""
|
||||||
Handle internal moving of media manager items
|
Handle internal moving of media manager items
|
||||||
|
|
||||||
|
``target``
|
||||||
|
The target of the DnD action
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -345,6 +348,9 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
|
|
||||||
``files``
|
``files``
|
||||||
The files to be loaded.
|
The files to be loaded.
|
||||||
|
|
||||||
|
``target_group``
|
||||||
|
The QTreeWidgetItem of the group that will be the parent of the added files
|
||||||
"""
|
"""
|
||||||
names = []
|
names = []
|
||||||
full_list = []
|
full_list = []
|
||||||
|
@ -219,6 +219,9 @@ class Plugin(QtCore.QObject):
|
|||||||
def upgrade_settings(self, settings):
|
def upgrade_settings(self, settings):
|
||||||
"""
|
"""
|
||||||
Upgrade the settings of this plugin.
|
Upgrade the settings of this plugin.
|
||||||
|
|
||||||
|
``settings``
|
||||||
|
The Settings object containing the old settings.
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
@ -64,9 +64,11 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
|
|||||||
|
|
||||||
def mouseMoveEvent(self, event):
|
def mouseMoveEvent(self, event):
|
||||||
"""
|
"""
|
||||||
Drag and drop event does not care what data is selected
|
Drag and drop event does not care what data is selected as the recipient will use events to request the data
|
||||||
as the recipient will use events to request the data move
|
move just tell it what plugin to call
|
||||||
just tell it what plugin to call
|
|
||||||
|
``event``
|
||||||
|
The event that occurred
|
||||||
"""
|
"""
|
||||||
if event.buttons() != QtCore.Qt.LeftButton:
|
if event.buttons() != QtCore.Qt.LeftButton:
|
||||||
event.ignore()
|
event.ignore()
|
||||||
@ -81,6 +83,12 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
|
|||||||
drag.start(QtCore.Qt.CopyAction)
|
drag.start(QtCore.Qt.CopyAction)
|
||||||
|
|
||||||
def dragEnterEvent(self, event):
|
def dragEnterEvent(self, event):
|
||||||
|
"""
|
||||||
|
Receive drag enter event, check if it is a file or internal object and allow it if it is.
|
||||||
|
|
||||||
|
``event``
|
||||||
|
The event that occurred
|
||||||
|
"""
|
||||||
if event.mimeData().hasUrls():
|
if event.mimeData().hasUrls():
|
||||||
event.accept()
|
event.accept()
|
||||||
elif self.allow_internal_dnd:
|
elif self.allow_internal_dnd:
|
||||||
@ -89,6 +97,12 @@ class TreeWidgetWithDnD(QtGui.QTreeWidget):
|
|||||||
event.ignore()
|
event.ignore()
|
||||||
|
|
||||||
def dragMoveEvent(self, event):
|
def dragMoveEvent(self, event):
|
||||||
|
"""
|
||||||
|
Receive drag move event, check if it is a file or internal object and allow it if it is.
|
||||||
|
|
||||||
|
``event``
|
||||||
|
The event that occurred
|
||||||
|
"""
|
||||||
QtGui.QTreeWidget.dragMoveEvent(self, event)
|
QtGui.QTreeWidget.dragMoveEvent(self, event)
|
||||||
if event.mimeData().hasUrls():
|
if event.mimeData().hasUrls():
|
||||||
event.setDropAction(QtCore.Qt.CopyAction)
|
event.setDropAction(QtCore.Qt.CopyAction)
|
||||||
|
@ -83,6 +83,9 @@ class ImagePlugin(Plugin):
|
|||||||
def upgrade_settings(self, settings):
|
def upgrade_settings(self, settings):
|
||||||
"""
|
"""
|
||||||
Upgrade the settings of this plugin.
|
Upgrade the settings of this plugin.
|
||||||
|
|
||||||
|
``settings``
|
||||||
|
The Settings object containing the old settings.
|
||||||
"""
|
"""
|
||||||
files_from_config = settings.get_files_from_config(self)
|
files_from_config = settings.get_files_from_config(self)
|
||||||
if len(files_from_config) > 0:
|
if len(files_from_config) > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user