mirror of https://gitlab.com/openlp/openlp.git
Remove initPluginNameVisible hack
This commit is contained in:
parent
38977e81ea
commit
a913c47254
|
@ -66,7 +66,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
The shortened (usually singular) name for the plugin e.g. *'Song'*
|
||||
for the Songs plugin.
|
||||
|
||||
``self.PluginNameVisible``
|
||||
``self.pluginNameVisible``
|
||||
The user visible name for a plugin which should use a suitable
|
||||
translation function.
|
||||
|
||||
|
@ -116,13 +116,9 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
self.pageLayout.setSpacing(0)
|
||||
self.pageLayout.setContentsMargins(4, 0, 4, 0)
|
||||
self.requiredIcons()
|
||||
self.initPluginNameVisible()
|
||||
self.setupUi()
|
||||
self.retranslateUi()
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
pass
|
||||
|
||||
def requiredIcons(self):
|
||||
"""
|
||||
This method is called to define the icons for the plugin.
|
||||
|
@ -215,7 +211,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
unicode(translate('MediaManagerItem', 'Import %s')) %
|
||||
self.PluginNameShort,
|
||||
unicode(translate('MediaManagerItem', 'Import a %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.pluginNameVisible,
|
||||
u':/general/general_import.png', self.onImportClick)
|
||||
## File Button ##
|
||||
if self.hasFileIcon:
|
||||
|
@ -223,7 +219,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
unicode(translate('MediaManagerItem', 'Load %s')) %
|
||||
self.PluginNameShort,
|
||||
unicode(translate('MediaManagerItem', 'Load a new %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.pluginNameVisible,
|
||||
u':/general/general_open.png', self.onFileClick)
|
||||
## New Button ##
|
||||
if self.hasNewIcon:
|
||||
|
@ -231,7 +227,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
unicode(translate('MediaManagerItem', 'New %s')) %
|
||||
self.PluginNameShort,
|
||||
unicode(translate('MediaManagerItem', 'Add a new %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.pluginNameVisible,
|
||||
u':/general/general_new.png', self.onNewClick)
|
||||
## Edit Button ##
|
||||
if self.hasEditIcon:
|
||||
|
@ -240,7 +236,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
self.PluginNameShort,
|
||||
unicode(translate(
|
||||
'MediaManagerItem', 'Edit the selected %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.pluginNameVisible,
|
||||
u':/general/general_edit.png', self.onEditClick)
|
||||
## Delete Button ##
|
||||
if self.hasDeleteIcon:
|
||||
|
@ -293,7 +289,7 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
context_menu_action(
|
||||
self.listView, u':/general/general_edit.png',
|
||||
unicode(translate('MediaManagerItem', '&Edit %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.pluginNameVisible,
|
||||
self.onEditClick))
|
||||
self.listView.addAction(context_menu_separator(self.listView))
|
||||
if self.hasDeleteIcon:
|
||||
|
@ -301,14 +297,14 @@ class MediaManagerItem(QtGui.QWidget):
|
|||
context_menu_action(
|
||||
self.listView, u':/general/general_delete.png',
|
||||
unicode(translate('MediaManagerItem', '&Delete %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.pluginNameVisible,
|
||||
self.onDeleteClick))
|
||||
self.listView.addAction(context_menu_separator(self.listView))
|
||||
self.listView.addAction(
|
||||
context_menu_action(
|
||||
self.listView, u':/general/general_preview.png',
|
||||
unicode(translate('MediaManagerItem', '&Preview %s')) %
|
||||
self.PluginNameVisible,
|
||||
self.pluginNameVisible,
|
||||
self.onPreviewClick))
|
||||
self.listView.addAction(
|
||||
context_menu_action(
|
||||
|
|
|
@ -55,6 +55,7 @@ class BibleMediaItem(MediaManagerItem):
|
|||
|
||||
def __init__(self, parent, icon, title):
|
||||
self.PluginNameShort = u'Bible'
|
||||
self.pluginNameVisible = translate('BiblesPlugin.MediaItem', 'Bible')
|
||||
self.IconPath = u'songs/song'
|
||||
self.ListViewWithDnD_class = BibleListView
|
||||
self.lastReference = []
|
||||
|
@ -70,9 +71,6 @@ class BibleMediaItem(MediaManagerItem):
|
|||
obj = obj.toPyObject()
|
||||
return unicode(obj)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('BiblesPlugin.MediaItem', 'Bible')
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
self.hasImportIcon = True
|
||||
|
|
|
@ -47,6 +47,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||
|
||||
def __init__(self, parent, icon, title):
|
||||
self.PluginNameShort = u'Custom'
|
||||
self.pluginNameVisible = translate('CustomPlugin.MediaItem', 'Custom')
|
||||
self.IconPath = u'custom/custom'
|
||||
# this next is a class, not an instance of a class - it will
|
||||
# be instanced by the base MediaManagerItem
|
||||
|
@ -67,9 +68,6 @@ class CustomMediaItem(MediaManagerItem):
|
|||
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||
QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('CustomPlugin.MediaItem', 'Custom')
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
|
||||
|
|
|
@ -50,15 +50,13 @@ class ImageMediaItem(MediaManagerItem):
|
|||
|
||||
def __init__(self, parent, icon, title):
|
||||
self.PluginNameShort = u'Image'
|
||||
self.pluginNameVisible = translate('ImagePlugin.MediaItem', 'Image')
|
||||
self.IconPath = u'images/image'
|
||||
# this next is a class, not an instance of a class - it will
|
||||
# be instanced by the base MediaManagerItem
|
||||
self.ListViewWithDnD_class = ImageListView
|
||||
MediaManagerItem.__init__(self, parent, icon, title)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('ImagePlugin.MediaItem', 'Image')
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = translate('ImagePlugin.MediaItem',
|
||||
'Select Image(s)')
|
||||
|
|
|
@ -47,6 +47,7 @@ class MediaMediaItem(MediaManagerItem):
|
|||
|
||||
def __init__(self, parent, icon, title):
|
||||
self.PluginNameShort = u'Media'
|
||||
self.pluginNameVisible = translate('MediaPlugin.MediaItem', 'Media')
|
||||
self.IconPath = u'images/image'
|
||||
self.background = False
|
||||
# this next is a class, not an instance of a class - it will
|
||||
|
@ -58,9 +59,6 @@ class MediaMediaItem(MediaManagerItem):
|
|||
self.singleServiceItem = False
|
||||
self.serviceItemIconName = u':/media/media_video.png'
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('MediaPlugin.MediaItem', 'Media')
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
|
||||
self.OnNewFileMasks = translate('MediaPlugin.MediaItem',
|
||||
|
|
|
@ -52,6 +52,8 @@ class PresentationMediaItem(MediaManagerItem):
|
|||
def __init__(self, parent, icon, title, controllers):
|
||||
self.controllers = controllers
|
||||
self.PluginNameShort = u'Presentation'
|
||||
self.pluginNameVisible = translate('PresentationPlugin.MediaItem',
|
||||
'Presentation')
|
||||
self.IconPath = u'presentations/presentation'
|
||||
self.Automatic = u''
|
||||
# this next is a class, not an instance of a class - it will
|
||||
|
@ -60,10 +62,6 @@ class PresentationMediaItem(MediaManagerItem):
|
|||
MediaManagerItem.__init__(self, parent, icon, title)
|
||||
self.message_listener = MessageListener(self)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('PresentationPlugin.MediaItem',
|
||||
'Presentation')
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = translate('PresentationPlugin.MediaItem',
|
||||
'Select Presentation(s)')
|
||||
|
|
|
@ -49,6 +49,7 @@ class SongMediaItem(MediaManagerItem):
|
|||
|
||||
def __init__(self, parent, icon, title):
|
||||
self.PluginNameShort = u'Song'
|
||||
self.pluginNameVisible = translate('SongsPlugin.MediaItem', 'Song')
|
||||
self.IconPath = u'songs/song'
|
||||
self.ListViewWithDnD_class = SongListView
|
||||
MediaManagerItem.__init__(self, parent, icon, title)
|
||||
|
@ -61,9 +62,6 @@ class SongMediaItem(MediaManagerItem):
|
|||
# which Song is required.
|
||||
self.remoteSong = -1
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate('SongsPlugin.MediaItem', 'Song')
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
|
||||
|
|
Loading…
Reference in New Issue