PluginNameVisible without splitting __init__

This commit is contained in:
Jon Tibble 2009-10-29 01:48:43 +00:00
parent 2eccd57aca
commit 8de21d057f
7 changed files with 21 additions and 13 deletions

View File

@ -121,11 +121,13 @@ class MediaManagerItem(QtGui.QWidget):
self.PageLayout.setSpacing(0)
self.PageLayout.setContentsMargins(4, 0, 4, 0)
self.requiredIcons()
def finishInit(self):
self.initPluginNameVisible()
self.setupUi()
self.retranslateUi()
def initPluginNameVisible(self):
pass
def requiredIcons(self):
"""
This method is called to define the icons for the plugin.

View File

@ -54,13 +54,14 @@ class BibleMediaItem(MediaManagerItem):
self.ServiceItemIconName = u':/media/bible_image.png'
self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title)
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
self.finishInit()
# place to store the search results
self.search_results = {}
QtCore.QObject.connect(Receiver().get_receiver(),
QtCore.SIGNAL(u'openlpreloadbibles'), self.reloadBibles)
def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
self.hasEditIcon = False

View File

@ -52,10 +52,11 @@ class CustomMediaItem(MediaManagerItem):
self.ServiceItemIconName = u':/custom/custom_image.png'
self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title)
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
self.finishInit()
self.parent = parent
def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
self.hasFileIcon = False

View File

@ -54,10 +54,11 @@ class ImageMediaItem(MediaManagerItem):
self.ServiceItemIconName = u':/media/media_image.png'
self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title)
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
self.finishInit()
self.overrideActive = False
def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
def retranslateUi(self):
self.OnNewPrompt = self.trUtf8(u'Select Image(s)')
self.OnNewFileMasks = \

View File

@ -56,8 +56,9 @@ class MediaMediaItem(MediaManagerItem):
#self.ServiceItemIconName = u':/media/media_image.png'
self.PreviewFunction = self.video_get_preview
MediaManagerItem.__init__(self, parent, icon, title)
def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
self.finishInit()
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)

View File

@ -58,10 +58,11 @@ class PresentationMediaItem(MediaManagerItem):
# be instanced by the base MediaManagerItem
self.ListViewWithDnD_class = PresentationListView
MediaManagerItem.__init__(self, parent, icon, title)
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
self.finishInit()
self.message_listener = MessageListener(controllers)
def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
self.hasFileIcon = True

View File

@ -52,13 +52,14 @@ class SongMediaItem(MediaManagerItem):
self.ServiceItemIconName = u':/media/song_image.png'
self.servicePath = None
MediaManagerItem.__init__(self, parent, icon, title)
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
self.finishInit()
self.edit_song_form = EditSongForm(self.parent.songmanager, self)
self.song_maintenance_form = SongMaintenanceForm(
self.parent.songmanager, self)
self.fromPreview = None
def initPluginNameVisible(self):
self.PluginNameVisible = self.trUtf8(self.PluginNameShort)
def requiredIcons(self):
MediaManagerItem.requiredIcons(self)
self.hasFileIcon = False