forked from openlp/openlp
Plugin refactor: icons, tabs, mediaitems
This commit is contained in:
parent
ae2b625d4f
commit
12d0867623
@ -197,61 +197,43 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Create buttons for the media item toolbar
|
Create buttons for the media item toolbar
|
||||||
"""
|
"""
|
||||||
|
toolbar_actions = []
|
||||||
## Import Button ##
|
## Import Button ##
|
||||||
if self.hasImportIcon:
|
if self.hasImportIcon:
|
||||||
import_string = self.plugin.getString(StringContent.Import)
|
toolbar_actions.append([StringContent.Import,
|
||||||
self.addToolbarButton(
|
u':/general/general_import.png', self.onImportClick])
|
||||||
import_string[u'title'],
|
|
||||||
import_string[u'tooltip'],
|
|
||||||
u':/general/general_import.png', self.onImportClick)
|
|
||||||
## Load Button ##
|
## Load Button ##
|
||||||
if self.hasFileIcon:
|
if self.hasFileIcon:
|
||||||
load_string = self.plugin.getString(StringContent.Load)
|
toolbar_actions.append([StringContent.Load,
|
||||||
self.addToolbarButton(
|
u':/general/general_open.png', self.onFileClick])
|
||||||
load_string[u'title'],
|
|
||||||
load_string[u'tooltip'],
|
|
||||||
u':/general/general_open.png', self.onFileClick)
|
|
||||||
## New Button ##
|
## New Button ##
|
||||||
if self.hasNewIcon:
|
if self.hasNewIcon:
|
||||||
new_string = self.plugin.getString(StringContent.New)
|
toolbar_actions.append([StringContent.New,
|
||||||
self.addToolbarButton(
|
u':/general/general_new.png', self.onNewClick])
|
||||||
new_string[u'title'],
|
|
||||||
new_string[u'tooltip'],
|
|
||||||
u':/general/general_new.png', self.onNewClick)
|
|
||||||
## Edit Button ##
|
## Edit Button ##
|
||||||
if self.hasEditIcon:
|
if self.hasEditIcon:
|
||||||
edit_string = self.plugin.getString(StringContent.Edit)
|
toolbar_actions.append([StringContent.Edit,
|
||||||
self.addToolbarButton(
|
u':/general/general_edit.png', self.onEditClick])
|
||||||
edit_string[u'title'],
|
|
||||||
edit_string[u'tooltip'],
|
|
||||||
u':/general/general_edit.png', self.onEditClick)
|
|
||||||
## Delete Button ##
|
## Delete Button ##
|
||||||
if self.hasDeleteIcon:
|
if self.hasDeleteIcon:
|
||||||
delete_string = self.plugin.getString(StringContent.Delete)
|
toolbar_actions.append([StringContent.Delete,
|
||||||
self.addToolbarButton(
|
u':/general/general_delete.png', self.onDeleteClick])
|
||||||
delete_string[u'title'],
|
|
||||||
delete_string[u'tooltip'],
|
|
||||||
u':/general/general_delete.png', self.onDeleteClick)
|
|
||||||
## Separator Line ##
|
## Separator Line ##
|
||||||
self.addToolbarSeparator()
|
self.addToolbarSeparator()
|
||||||
## Preview ##
|
## Preview ##
|
||||||
preview_string = self.plugin.getString(StringContent.Preview)
|
toolbar_actions.append([StringContent.Preview,
|
||||||
self.addToolbarButton(
|
u':/general/general_preview.png', self.onPreviewClick])
|
||||||
preview_string[u'title'],
|
|
||||||
preview_string[u'tooltip'],
|
|
||||||
u':/general/general_preview.png', self.onPreviewClick)
|
|
||||||
## Live Button ##
|
## Live Button ##
|
||||||
live_string = self.plugin.getString(StringContent.Live)
|
toolbar_actions.append([StringContent.Live,
|
||||||
self.addToolbarButton(
|
u':/general/general_live.png', self.onLiveClick])
|
||||||
live_string[u'title'],
|
|
||||||
live_string[u'tooltip'],
|
|
||||||
u':/general/general_live.png', self.onLiveClick)
|
|
||||||
## Add to service Button ##
|
## Add to service Button ##
|
||||||
service_string = self.plugin.getString(StringContent.Service)
|
toolbar_actions.append([StringContent.Service,
|
||||||
|
u':/general/general_add.png', self.onAddClick])
|
||||||
|
for action in toolbar_actions:
|
||||||
self.addToolbarButton(
|
self.addToolbarButton(
|
||||||
service_string[u'title'],
|
self.plugin.getString(action[0])[u'title'],
|
||||||
service_string[u'tooltip'],
|
self.plugin.getString(action[0])[u'tooltip'],
|
||||||
u':/general/general_add.png', self.onAddClick)
|
action[1], action[2])
|
||||||
|
|
||||||
def addListViewToToolBar(self):
|
def addListViewToToolBar(self):
|
||||||
"""
|
"""
|
||||||
|
@ -114,7 +114,8 @@ class Plugin(QtCore.QObject):
|
|||||||
"""
|
"""
|
||||||
log.info(u'loaded')
|
log.info(u'loaded')
|
||||||
|
|
||||||
def __init__(self, name, version=None, pluginHelpers=None):
|
def __init__(self, name, version=None, pluginHelpers=None,
|
||||||
|
mediaItemClass=None, settingsTabClass=None):
|
||||||
"""
|
"""
|
||||||
This is the constructor for the plugin object. This provides an easy
|
This is the constructor for the plugin object. This provides an easy
|
||||||
way for descendent plugins to populate common data. This method *must*
|
way for descendent plugins to populate common data. This method *must*
|
||||||
@ -132,6 +133,12 @@ class Plugin(QtCore.QObject):
|
|||||||
|
|
||||||
``pluginHelpers``
|
``pluginHelpers``
|
||||||
Defaults to *None*. A list of helper objects.
|
Defaults to *None*. A list of helper objects.
|
||||||
|
|
||||||
|
``mediaItemClass``
|
||||||
|
The class name of the plugin's media item.
|
||||||
|
|
||||||
|
``settingsTabClass``
|
||||||
|
The class name of the plugin's settings tab.
|
||||||
"""
|
"""
|
||||||
QtCore.QObject.__init__(self)
|
QtCore.QObject.__init__(self)
|
||||||
self.name = name
|
self.name = name
|
||||||
@ -141,6 +148,8 @@ class Plugin(QtCore.QObject):
|
|||||||
self.version = version
|
self.version = version
|
||||||
self.settingsSection = self.name.lower()
|
self.settingsSection = self.name.lower()
|
||||||
self.icon = None
|
self.icon = None
|
||||||
|
self.mediaItemClass = mediaItemClass
|
||||||
|
self.settingsTabClass = settingsTabClass
|
||||||
self.weight = 0
|
self.weight = 0
|
||||||
self.status = PluginStatus.Inactive
|
self.status = PluginStatus.Inactive
|
||||||
# Set up logging
|
# Set up logging
|
||||||
@ -199,7 +208,9 @@ class Plugin(QtCore.QObject):
|
|||||||
Construct a MediaManagerItem object with all the buttons and things
|
Construct a MediaManagerItem object with all the buttons and things
|
||||||
you need, and return it for integration into openlp.org.
|
you need, and return it for integration into openlp.org.
|
||||||
"""
|
"""
|
||||||
pass
|
if self.mediaItemClass:
|
||||||
|
return self.mediaItemClass(self, self, self.icon)
|
||||||
|
return None
|
||||||
|
|
||||||
def addImportMenuItem(self, importMenu):
|
def addImportMenuItem(self, importMenu):
|
||||||
"""
|
"""
|
||||||
@ -230,9 +241,13 @@ class Plugin(QtCore.QObject):
|
|||||||
|
|
||||||
def getSettingsTab(self):
|
def getSettingsTab(self):
|
||||||
"""
|
"""
|
||||||
Create a tab for the settings window.
|
Create a tab for the settings window to display the configurable
|
||||||
|
options for this plugin to the user.
|
||||||
"""
|
"""
|
||||||
pass
|
if self.settingsTabClass:
|
||||||
|
return self.settingsTabClass(self.name,
|
||||||
|
self.getString(StringContent.VisibleName)[u'title'])
|
||||||
|
return None
|
||||||
|
|
||||||
def addToMenu(self, menubar):
|
def addToMenu(self, menubar):
|
||||||
"""
|
"""
|
||||||
|
@ -68,7 +68,6 @@ class RenderManager(object):
|
|||||||
self.theme_level = u''
|
self.theme_level = u''
|
||||||
self.override_background = None
|
self.override_background = None
|
||||||
self.theme_data = None
|
self.theme_data = None
|
||||||
self.alertTab = None
|
|
||||||
self.force_page = False
|
self.force_page = False
|
||||||
|
|
||||||
def update_display(self):
|
def update_display(self):
|
||||||
|
@ -65,7 +65,6 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.parent = parent
|
self.parent = parent
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
self.isLive = live
|
self.isLive = live
|
||||||
self.alertTab = None
|
|
||||||
self.hideMode = None
|
self.hideMode = None
|
||||||
self.override = {}
|
self.override = {}
|
||||||
mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
|
mainIcon = build_icon(u':/icon/openlp-logo-16x16.png')
|
||||||
|
@ -415,7 +415,6 @@ class SlideController(QtGui.QWidget):
|
|||||||
# rebuild display as screen size changed
|
# rebuild display as screen size changed
|
||||||
self.display = MainDisplay(self, self.screens, self.isLive)
|
self.display = MainDisplay(self, self.screens, self.isLive)
|
||||||
self.display.imageManager = self.parent.renderManager.image_manager
|
self.display.imageManager = self.parent.renderManager.image_manager
|
||||||
self.display.alertTab = self.alertTab
|
|
||||||
self.display.setup()
|
self.display.setup()
|
||||||
if self.isLive:
|
if self.isLive:
|
||||||
self.__addActionsToWidget(self.display)
|
self.__addActionsToWidget(self.display)
|
||||||
|
@ -40,21 +40,14 @@ class AlertsPlugin(Plugin):
|
|||||||
log.info(u'Alerts Plugin loaded')
|
log.info(u'Alerts Plugin loaded')
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
def __init__(self, plugin_helpers):
|
||||||
Plugin.__init__(self, u'Alerts', u'1.9.4', plugin_helpers)
|
Plugin.__init__(self, u'Alerts', u'1.9.4', plugin_helpers,
|
||||||
|
settingsTabClass=AlertsTab)
|
||||||
self.weight = -3
|
self.weight = -3
|
||||||
self.icon = build_icon(u':/plugins/plugin_alerts.png')
|
self.icon = build_icon(u':/plugins/plugin_alerts.png')
|
||||||
self.alertsmanager = AlertsManager(self)
|
self.alertsmanager = AlertsManager(self)
|
||||||
self.manager = Manager(u'alerts', init_schema)
|
self.manager = Manager(u'alerts', init_schema)
|
||||||
self.visible_name = self.getString(StringContent.VisibleName)
|
|
||||||
self.alertForm = AlertForm(self)
|
self.alertForm = AlertForm(self)
|
||||||
|
|
||||||
def getSettingsTab(self):
|
|
||||||
"""
|
|
||||||
Return the settings tab for the Alerts plugin
|
|
||||||
"""
|
|
||||||
self.alertsTab = AlertsTab(self, self.visible_name[u'title'])
|
|
||||||
return self.alertsTab
|
|
||||||
|
|
||||||
def addToolsMenuItem(self, tools_menu):
|
def addToolsMenuItem(self, tools_menu):
|
||||||
"""
|
"""
|
||||||
Give the alerts plugin the opportunity to add items to the
|
Give the alerts plugin the opportunity to add items to the
|
||||||
@ -81,7 +74,7 @@ class AlertsPlugin(Plugin):
|
|||||||
log.info(u'Alerts Initialising')
|
log.info(u'Alerts Initialising')
|
||||||
Plugin.initialise(self)
|
Plugin.initialise(self)
|
||||||
self.toolsAlertItem.setVisible(True)
|
self.toolsAlertItem.setVisible(True)
|
||||||
self.liveController.alertTab = self.alertsTab
|
self.liveController.alertTab = self.settings_tab
|
||||||
|
|
||||||
def finalise(self):
|
def finalise(self):
|
||||||
"""
|
"""
|
||||||
|
@ -84,7 +84,7 @@ class AlertsManager(QtCore.QObject):
|
|||||||
if len(self.alertList) == 0:
|
if len(self.alertList) == 0:
|
||||||
return
|
return
|
||||||
text = self.alertList.pop(0)
|
text = self.alertList.pop(0)
|
||||||
alertTab = self.parent.alertsTab
|
alertTab = self.parent.settings_tab
|
||||||
self.parent.liveController.display.alert(text)
|
self.parent.liveController.display.alert(text)
|
||||||
# Check to see if we have a timer running.
|
# Check to see if we have a timer running.
|
||||||
if self.timer_id == 0:
|
if self.timer_id == 0:
|
||||||
|
@ -33,10 +33,8 @@ class AlertsTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
AlertsTab is the alerts settings tab in the settings dialog.
|
AlertsTab is the alerts settings tab in the settings dialog.
|
||||||
"""
|
"""
|
||||||
def __init__(self, parent, visible_title):
|
def __init__(self, name, visible_title):
|
||||||
self.parent = parent
|
SettingsTab.__init__(self, name, visible_title)
|
||||||
self.manager = parent.manager
|
|
||||||
SettingsTab.__init__(self, parent.name, visible_title)
|
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.setObjectName(u'AlertsTab')
|
self.setObjectName(u'AlertsTab')
|
||||||
|
@ -38,7 +38,8 @@ class BiblePlugin(Plugin):
|
|||||||
log.info(u'Bible Plugin loaded')
|
log.info(u'Bible Plugin loaded')
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
def __init__(self, plugin_helpers):
|
||||||
Plugin.__init__(self, u'Bibles', u'1.9.4', plugin_helpers)
|
Plugin.__init__(self, u'Bibles', u'1.9.4', plugin_helpers,
|
||||||
|
BibleMediaItem, BiblesTab)
|
||||||
self.weight = -9
|
self.weight = -9
|
||||||
self.icon_path = u':/plugins/plugin_bibles.png'
|
self.icon_path = u':/plugins/plugin_bibles.png'
|
||||||
self.icon = build_icon(self.icon_path)
|
self.icon = build_icon(self.icon_path)
|
||||||
@ -62,14 +63,6 @@ class BiblePlugin(Plugin):
|
|||||||
self.importBibleItem.setVisible(False)
|
self.importBibleItem.setVisible(False)
|
||||||
self.exportBibleItem.setVisible(False)
|
self.exportBibleItem.setVisible(False)
|
||||||
|
|
||||||
def getSettingsTab(self):
|
|
||||||
visible_name = self.getString(StringContent.VisibleName)
|
|
||||||
return BiblesTab(self.name, visible_name[u'title'])
|
|
||||||
|
|
||||||
def getMediaManagerItem(self):
|
|
||||||
# Create the BibleManagerItem object.
|
|
||||||
return BibleMediaItem(self, self, self.icon)
|
|
||||||
|
|
||||||
def addImportMenuItem(self, import_menu):
|
def addImportMenuItem(self, import_menu):
|
||||||
self.importBibleItem = QtGui.QAction(import_menu)
|
self.importBibleItem = QtGui.QAction(import_menu)
|
||||||
self.importBibleItem.setObjectName(u'importBibleItem')
|
self.importBibleItem.setObjectName(u'importBibleItem')
|
||||||
|
@ -48,21 +48,14 @@ class CustomPlugin(Plugin):
|
|||||||
log.info(u'Custom Plugin loaded')
|
log.info(u'Custom Plugin loaded')
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
def __init__(self, plugin_helpers):
|
||||||
Plugin.__init__(self, u'Custom', u'1.9.4', plugin_helpers)
|
Plugin.__init__(self, u'Custom', u'1.9.4', plugin_helpers,
|
||||||
|
CustomMediaItem, CustomTab)
|
||||||
self.weight = -5
|
self.weight = -5
|
||||||
self.manager = Manager(u'custom', init_schema)
|
self.manager = Manager(u'custom', init_schema)
|
||||||
self.edit_custom_form = EditCustomForm(self.manager)
|
self.edit_custom_form = EditCustomForm(self.manager)
|
||||||
self.icon_path = u':/plugins/plugin_custom.png'
|
self.icon_path = u':/plugins/plugin_custom.png'
|
||||||
self.icon = build_icon(self.icon_path)
|
self.icon = build_icon(self.icon_path)
|
||||||
|
|
||||||
def getSettingsTab(self):
|
|
||||||
visible_name = self.getString(StringContent.VisibleName)
|
|
||||||
return CustomTab(self.name, visible_name[u'title'])
|
|
||||||
|
|
||||||
def getMediaManagerItem(self):
|
|
||||||
# Create the ManagerItem object
|
|
||||||
return CustomMediaItem(self, self, self.icon)
|
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
about_text = translate('CustomPlugin', '<strong>Custom Plugin</strong>'
|
about_text = translate('CustomPlugin', '<strong>Custom Plugin</strong>'
|
||||||
'<br />The custom plugin provides the ability to set up custom '
|
'<br />The custom plugin provides the ability to set up custom '
|
||||||
|
@ -35,15 +35,12 @@ class ImagePlugin(Plugin):
|
|||||||
log.info(u'Image Plugin loaded')
|
log.info(u'Image Plugin loaded')
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
def __init__(self, plugin_helpers):
|
||||||
Plugin.__init__(self, u'Images', u'1.9.4', plugin_helpers)
|
Plugin.__init__(self, u'Images', u'1.9.4', plugin_helpers,
|
||||||
|
ImageMediaItem)
|
||||||
self.weight = -7
|
self.weight = -7
|
||||||
self.icon_path = u':/plugins/plugin_images.png'
|
self.icon_path = u':/plugins/plugin_images.png'
|
||||||
self.icon = build_icon(self.icon_path)
|
self.icon = build_icon(self.icon_path)
|
||||||
|
|
||||||
def getMediaManagerItem(self):
|
|
||||||
# Create the MediaManagerItem object.
|
|
||||||
return ImageMediaItem(self, self, self.icon)
|
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
about_text = translate('ImagePlugin', '<strong>Image Plugin</strong>'
|
about_text = translate('ImagePlugin', '<strong>Image Plugin</strong>'
|
||||||
'<br />The image plugin provides displaying of images.<br />One '
|
'<br />The image plugin provides displaying of images.<br />One '
|
||||||
|
@ -138,6 +138,7 @@ class MediaMediaItem(MediaManagerItem):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
|
self.listView.clear()
|
||||||
self.listView.setIconSize(QtCore.QSize(88, 50))
|
self.listView.setIconSize(QtCore.QSize(88, 50))
|
||||||
self.loadList(SettingsManager.load_list(self.settingsSection,
|
self.loadList(SettingsManager.load_list(self.settingsSection,
|
||||||
self.settingsSection))
|
self.settingsSection))
|
||||||
|
@ -32,8 +32,8 @@ class MediaTab(SettingsTab):
|
|||||||
"""
|
"""
|
||||||
MediaTab is the Media settings tab in the settings dialog.
|
MediaTab is the Media settings tab in the settings dialog.
|
||||||
"""
|
"""
|
||||||
def __init__(self, title):
|
def __init__(self, title, visible_title):
|
||||||
SettingsTab.__init__(self, title)
|
SettingsTab.__init__(self, title, visible_title)
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.setObjectName(u'MediaTab')
|
self.setObjectName(u'MediaTab')
|
||||||
@ -53,9 +53,8 @@ class MediaTab(SettingsTab):
|
|||||||
self.onUsePhononCheckBoxChanged)
|
self.onUsePhononCheckBoxChanged)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.tabTitleVisible = translate('MediaPlugin.MediaTab', 'Media')
|
self.mediaModeGroupBox.setTitle(
|
||||||
self.mediaModeGroupBox.setTitle(translate('MediaPlugin.MediaTab',
|
translate('MediaPlugin.MediaTab', 'Media Display'))
|
||||||
'Media Display'))
|
|
||||||
self.usePhononCheckBox.setText(
|
self.usePhononCheckBox.setText(
|
||||||
translate('MediaPlugin.MediaTab', 'Use Phonon for video playback'))
|
translate('MediaPlugin.MediaTab', 'Use Phonon for video playback'))
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ class MediaPlugin(Plugin):
|
|||||||
log.info(u'%s MediaPlugin loaded', __name__)
|
log.info(u'%s MediaPlugin loaded', __name__)
|
||||||
|
|
||||||
def __init__(self, plugin_helpers):
|
def __init__(self, plugin_helpers):
|
||||||
Plugin.__init__(self, u'Media', u'1.9.4', plugin_helpers)
|
Plugin.__init__(self, u'Media', u'1.9.4', plugin_helpers,
|
||||||
|
MediaMediaItem, MediaTab)
|
||||||
self.weight = -6
|
self.weight = -6
|
||||||
self.icon_path = u':/plugins/plugin_media.png'
|
self.icon_path = u':/plugins/plugin_media.png'
|
||||||
self.icon = build_icon(self.icon_path)
|
self.icon = build_icon(self.icon_path)
|
||||||
@ -75,13 +76,6 @@ class MediaPlugin(Plugin):
|
|||||||
mimetype = u''
|
mimetype = u''
|
||||||
return list, mimetype
|
return list, mimetype
|
||||||
|
|
||||||
def getSettingsTab(self):
|
|
||||||
return MediaTab(self.name)
|
|
||||||
|
|
||||||
def getMediaManagerItem(self):
|
|
||||||
# Create the MediaManagerItem object.
|
|
||||||
return MediaMediaItem(self, self, self.icon)
|
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>'
|
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.')
|
||||||
|
@ -38,7 +38,8 @@ class RemotesPlugin(Plugin):
|
|||||||
"""
|
"""
|
||||||
remotes constructor
|
remotes constructor
|
||||||
"""
|
"""
|
||||||
Plugin.__init__(self, u'Remotes', u'1.9.4', plugin_helpers)
|
Plugin.__init__(self, u'Remotes', u'1.9.4', plugin_helpers,
|
||||||
|
settingsTabClass=RemoteTab)
|
||||||
self.icon = build_icon(u':/plugins/plugin_remote.png')
|
self.icon = build_icon(u':/plugins/plugin_remote.png')
|
||||||
self.weight = -1
|
self.weight = -1
|
||||||
self.server = None
|
self.server = None
|
||||||
@ -61,13 +62,6 @@ class RemotesPlugin(Plugin):
|
|||||||
if self.server:
|
if self.server:
|
||||||
self.server.close()
|
self.server.close()
|
||||||
|
|
||||||
def getSettingsTab(self):
|
|
||||||
"""
|
|
||||||
Create the settings Tab
|
|
||||||
"""
|
|
||||||
visible_name = self.getString(StringContent.VisibleName)
|
|
||||||
return RemoteTab(self.name, visible_name[u'title'])
|
|
||||||
|
|
||||||
def about(self):
|
def about(self):
|
||||||
"""
|
"""
|
||||||
Information about this plugin
|
Information about this plugin
|
||||||
|
@ -51,17 +51,14 @@ class SongsPlugin(Plugin):
|
|||||||
"""
|
"""
|
||||||
Create and set up the Songs plugin.
|
Create and set up the Songs plugin.
|
||||||
"""
|
"""
|
||||||
Plugin.__init__(self, u'Songs', u'1.9.4', plugin_helpers)
|
Plugin.__init__(self, u'Songs', u'1.9.4', plugin_helpers,
|
||||||
|
SongMediaItem, SongsTab)
|
||||||
self.weight = -10
|
self.weight = -10
|
||||||
self.manager = Manager(u'songs', init_schema)
|
self.manager = Manager(u'songs', init_schema)
|
||||||
self.icon_path = u':/plugins/plugin_songs.png'
|
self.icon_path = u':/plugins/plugin_songs.png'
|
||||||
self.icon = build_icon(self.icon_path)
|
self.icon = build_icon(self.icon_path)
|
||||||
self.whitespace = re.compile(r'\W+', re.UNICODE)
|
self.whitespace = re.compile(r'\W+', re.UNICODE)
|
||||||
|
|
||||||
def getSettingsTab(self):
|
|
||||||
visible_name = self.getString(StringContent.VisibleName)
|
|
||||||
return SongsTab(self.name, visible_name[u'title'])
|
|
||||||
|
|
||||||
def initialise(self):
|
def initialise(self):
|
||||||
log.info(u'Songs Initialising')
|
log.info(u'Songs Initialising')
|
||||||
Plugin.initialise(self)
|
Plugin.initialise(self)
|
||||||
@ -69,13 +66,6 @@ class SongsPlugin(Plugin):
|
|||||||
self.mediaItem.displayResultsSong(
|
self.mediaItem.displayResultsSong(
|
||||||
self.manager.get_all_objects(Song, order_by_ref=Song.search_title))
|
self.manager.get_all_objects(Song, order_by_ref=Song.search_title))
|
||||||
|
|
||||||
def getMediaManagerItem(self):
|
|
||||||
"""
|
|
||||||
Create the MediaManagerItem object, which is displaed in the
|
|
||||||
Media Manager.
|
|
||||||
"""
|
|
||||||
return SongMediaItem(self, self, self.icon)
|
|
||||||
|
|
||||||
def addImportMenuItem(self, import_menu):
|
def addImportMenuItem(self, import_menu):
|
||||||
"""
|
"""
|
||||||
Give the Songs plugin the opportunity to add items to the
|
Give the Songs plugin the opportunity to add items to the
|
||||||
|
Loading…
Reference in New Issue
Block a user