media items' __init__ methods

This commit is contained in:
rimach 2010-09-14 20:34:39 +02:00
parent 2d47e2523c
commit c53731d74b
12 changed files with 29 additions and 29 deletions

View File

@ -86,13 +86,13 @@ class MediaManagerItem(QtGui.QWidget):
""" """
log.info(u'Media Item loaded') log.info(u'Media Item loaded')
def __init__(self, parent=None, icon=None, title=None, plugin=None): def __init__(self, parent=None, plugin=None, icon=None, title=None):
""" """
Constructor to create the media manager item. Constructor to create the media manager item.
""" """
QtGui.QWidget.__init__(self) QtGui.QWidget.__init__(self)
self.parent = parent self.parent = parent
# TODO: plugin is not the parent, so add this to the calling plugins #TODO: change parent to plugin
self.plugin = parent self.plugin = parent
self.settingsSection = self.plugin.name_lower self.settingsSection = self.plugin.name_lower
if isinstance(icon, QtGui.QIcon): if isinstance(icon, QtGui.QIcon):

View File

@ -62,7 +62,7 @@ class BiblePlugin(Plugin):
def getMediaManagerItem(self): def getMediaManagerItem(self):
# Create the BibleManagerItem object. # Create the BibleManagerItem object.
return BibleMediaItem(self, self.icon, self.name) return BibleMediaItem(self, self, self.icon, self.name)
def addImportMenuItem(self, import_menu): def addImportMenuItem(self, import_menu):
self.importBibleItem = QtGui.QAction(import_menu) self.importBibleItem = QtGui.QAction(import_menu)

View File

@ -53,10 +53,10 @@ class BibleMediaItem(MediaManagerItem):
""" """
log.info(u'Bible Media Item loaded') log.info(u'Bible Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, plugin, icon, title):
self.IconPath = u'songs/song' self.IconPath = u'songs/song'
self.ListViewWithDnD_class = BibleListView self.ListViewWithDnD_class = BibleListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, self, icon, title)
# place to store the search results for both bibles # place to store the search results for both bibles
self.search_results = {} self.search_results = {}
self.dual_search_results = {} self.dual_search_results = {}

View File

@ -59,7 +59,7 @@ class CustomPlugin(Plugin):
def getMediaManagerItem(self): def getMediaManagerItem(self):
# Create the CustomManagerItem object # Create the CustomManagerItem object
return CustomMediaItem(self, self.icon, self.name) return CustomMediaItem(self, self, self.icon, self.name)
def about(self): def about(self):
about_text = translate('CustomPlugin', '<strong>Custom Plugin</strong>' about_text = translate('CustomPlugin', '<strong>Custom Plugin</strong>'

View File

@ -46,12 +46,12 @@ class CustomMediaItem(MediaManagerItem):
""" """
log.info(u'Custom Media Item loaded') log.info(u'Custom Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, plugin, icon, title):
self.IconPath = u'custom/custom' self.IconPath = u'custom/custom'
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will
# be instanced by the base MediaManagerItem # be instanced by the base MediaManagerItem
self.ListViewWithDnD_class = CustomListView self.ListViewWithDnD_class = CustomListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, self, icon, title)
self.singleServiceItem = False self.singleServiceItem = False
# Holds information about whether the edit is remotly triggered and # Holds information about whether the edit is remotly triggered and
# which Custom is required. # which Custom is required.

View File

@ -42,7 +42,7 @@ class ImagePlugin(Plugin):
def getMediaManagerItem(self): def getMediaManagerItem(self):
# Create the MediaManagerItem object # Create the MediaManagerItem object
return ImageMediaItem(self, self.icon, self.name) return ImageMediaItem(self, self, self.icon, self.name)
def about(self): def about(self):
about_text = translate('ImagePlugin', '<strong>Image Plugin</strong>' about_text = translate('ImagePlugin', '<strong>Image Plugin</strong>'

View File

@ -49,12 +49,12 @@ class ImageMediaItem(MediaManagerItem):
""" """
log.info(u'Image Media Item loaded') log.info(u'Image Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, plugin, icon, title):
self.IconPath = u'images/image' self.IconPath = u'images/image'
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will
# be instanced by the base MediaManagerItem # be instanced by the base MediaManagerItem
self.ListViewWithDnD_class = ImageListView self.ListViewWithDnD_class = ImageListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, self, icon, title)
def retranslateUi(self): def retranslateUi(self):
self.OnNewPrompt = translate('ImagePlugin.MediaItem', self.OnNewPrompt = translate('ImagePlugin.MediaItem',

View File

@ -46,7 +46,7 @@ class MediaMediaItem(MediaManagerItem):
""" """
log.info(u'%s MediaMediaItem loaded', __name__) log.info(u'%s MediaMediaItem loaded', __name__)
def __init__(self, parent, icon, title): def __init__(self, parent, plugin, icon, title):
self.IconPath = u'images/image' self.IconPath = u'images/image'
self.background = False self.background = False
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will
@ -54,7 +54,7 @@ class MediaMediaItem(MediaManagerItem):
self.ListViewWithDnD_class = MediaListView self.ListViewWithDnD_class = MediaListView
self.PreviewFunction = QtGui.QPixmap( self.PreviewFunction = QtGui.QPixmap(
u':/media/media_video.png').toImage() u':/media/media_video.png').toImage()
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, self, icon, title)
self.singleServiceItem = False self.singleServiceItem = False
self.serviceItemIconName = u':/media/media_video.png' self.serviceItemIconName = u':/media/media_video.png'

View File

@ -70,7 +70,7 @@ class MediaPlugin(Plugin):
def getMediaManagerItem(self): def getMediaManagerItem(self):
# Create the MediaManagerItem object # Create the MediaManagerItem object
return MediaMediaItem(self, self.icon, self.name) return MediaMediaItem(self, self, self.icon, self.name)
def about(self): def about(self):
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>' about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'

View File

@ -63,7 +63,7 @@ class PresentationMediaItem(MediaManagerItem):
# this next is a class, not an instance of a class - it will # this next is a class, not an instance of a class - it will
# be instanced by the base MediaManagerItem # be instanced by the base MediaManagerItem
self.ListViewWithDnD_class = PresentationListView self.ListViewWithDnD_class = PresentationListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, self, icon, title)
self.message_listener = MessageListener(self) self.message_listener = MessageListener(self)
QtCore.QObject.connect(Receiver.get_receiver(), QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'mediaitem_presentation_rebuild'), self.rebuild) QtCore.SIGNAL(u'mediaitem_presentation_rebuild'), self.rebuild)

View File

@ -48,10 +48,10 @@ class SongMediaItem(MediaManagerItem):
""" """
log.info(u'Song Media Item loaded') log.info(u'Song Media Item loaded')
def __init__(self, parent, icon, title): def __init__(self, parent, plugin, icon, title):
self.IconPath = u'songs/song' self.IconPath = u'songs/song'
self.ListViewWithDnD_class = SongListView self.ListViewWithDnD_class = SongListView
MediaManagerItem.__init__(self, parent, icon, title) MediaManagerItem.__init__(self, parent, self, icon, title)
self.edit_song_form = EditSongForm(self, self.parent.manager) self.edit_song_form = EditSongForm(self, self.parent.manager)
self.singleServiceItem = False self.singleServiceItem = False
#self.edit_song_form = EditSongForm(self.parent.manager, self) #self.edit_song_form = EditSongForm(self.parent.manager, self)

View File

@ -70,7 +70,7 @@ class SongsPlugin(Plugin):
Create the MediaManagerItem object, which is displaed in the Create the MediaManagerItem object, which is displaed in the
Media Manager. Media Manager.
""" """
return SongMediaItem(self, self.icon, self.name) return SongMediaItem(self, self, self.icon, self.name)
def addImportMenuItem(self, import_menu): def addImportMenuItem(self, import_menu):
""" """