Media cleaned up

This commit is contained in:
Tim Bentley 2014-03-08 20:53:22 +00:00
parent 836886e541
commit 9773afc61c
4 changed files with 20 additions and 12 deletions

View File

@ -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:

View File

@ -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)

View File

@ -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.

View File

@ -66,7 +66,7 @@ class MediaPlugin(Plugin):
def about(self):
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
'<br />The media plugin provides playback of audio and video.')
'<br />The media plugin provides playback of audio and video.')
return about_text
def set_plugin_text_strings(self):