From 9773afc61c036fb26132ac10ec949b1416f0e9ed Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 8 Mar 2014 20:53:22 +0000 Subject: [PATCH] Media cleaned up --- openlp/plugins/images/lib/mediaitem.py | 3 +-- openlp/plugins/media/lib/mediaitem.py | 19 ++++++++++++++++++- openlp/plugins/media/lib/mediatab.py | 8 -------- openlp/plugins/media/mediaplugin.py | 2 +- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index a43d8395d..5b88bfb36 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -207,8 +207,7 @@ class ImageMediaItem(MediaManagerItem): """ Recursively deletes a group and all groups and images in it. - ``image_group`` - The ImageGroups instance of the group that will be deleted. + :param image_group: The ImageGroups instance of the group that will be deleted. """ images = self.manager.get_all_objects(ImageFilenames, ImageFilenames.group_id == image_group.id) for image in images: diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 644b573b9..5e1412a39 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -131,6 +131,11 @@ class MediaMediaItem(MediaManagerItem): self.display_type_combo_box.currentIndexChanged.connect(self.override_player_changed) def override_player_changed(self, index): + """ + The Player has been overridden + + :param index: Index + """ player = get_media_players()[0] if index == 0: set_media_players(player) @@ -178,9 +183,15 @@ class MediaMediaItem(MediaManagerItem): 'the media file "%s" no longer exists.') % filename) def generate_slide_data(self, service_item, item=None, xml_version=False, remote=False, - context=ServiceItemContext.Live): + context=ServiceItemContext.Service): """ Generate the slide data. Needs to be implemented by the plugin. + + :param service_item: The service item to be built on + :param item: The Song item to be used + :param xml_version: The xml version (not used) + :param remote: Triggered from remote + :param context: Why is it being generated """ if item is None: item = self.list_view.currentItem() @@ -269,6 +280,12 @@ class MediaMediaItem(MediaManagerItem): def load_list(self, media, target_group=None): # Sort the media by its filename considering language specific characters. + """ + Load the media list + + :param media: The media + :param target_group: + """ media.sort(key=lambda file_name: get_locale_key(os.path.split(str(file_name))[1])) for track in media: track_info = QtCore.QFileInfo(track) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 2fd01026f..051d937c9 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -33,14 +33,6 @@ from openlp.core.common import Settings, UiStrings, translate from openlp.core.lib import SettingsTab -class MediaQ_check_box(QtGui.QCheckBox): - """ - MediaQ_check_box adds an extra property, playerName to the Q_check_box class. - """ - def setPlayerName(self, name): - self.playerName = name - - class MediaTab(SettingsTab): """ MediaTab is the Media settings tab in the settings dialog. diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 56141a6ea..0ec0940a7 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -66,7 +66,7 @@ class MediaPlugin(Plugin): def about(self): about_text = translate('MediaPlugin', 'Media Plugin' - '
The media plugin provides playback of audio and video.') + '
The media plugin provides playback of audio and video.') return about_text def set_plugin_text_strings(self):