Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews: OpenLP Core (openlp-core) For more details, see: https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/49337 Fixes, cleanups and UiStrings Refactor plugins: icon building, settings tabs and media items -- https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/49337 Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/core/lib/htmlbuilder.py' --- openlp/core/lib/htmlbuilder.py 2011-01-23 15:36:15 +0000 +++ openlp/core/lib/htmlbuilder.py 2011-02-11 04:14:54 +0000 @@ -28,7 +28,8 @@ from PyQt4 import QtWebKit -from openlp.core.lib import BackgroundType, BackgroundGradientType +from openlp.core.lib import BackgroundType, BackgroundGradientType, \ + VerticalType log = logging.getLogger(__name__) @@ -536,12 +537,7 @@ align = u'right' else: align = u'left' - if theme.display_vertical_align == 2: - valign = u'bottom' - elif theme.display_vertical_align == 1: - valign = u'middle' - else: - valign = u'top' + valign = VerticalType.to_string(theme.display_vertical_align) if theme.font_main_outline: left_margin = int(theme.font_main_outline_size) * 2 else: @@ -634,13 +630,7 @@ """ if not alertTab: return u'' - align = u'' - if alertTab.location == 2: - align = u'bottom' - elif alertTab.location == 1: - align = u'middle' - else: - align = u'top' + align = VerticalType.to_string(alertTab.location) alert = style % (width, align, alertTab.font_face, alertTab.font_size, alertTab.font_color, alertTab.bg_color) return alert === modified file 'openlp/core/lib/mediamanageritem.py' --- openlp/core/lib/mediamanageritem.py 2011-02-10 19:05:35 +0000 +++ openlp/core/lib/mediamanageritem.py 2011-02-11 04:14:54 +0000 @@ -197,61 +197,43 @@ """ Create buttons for the media item toolbar """ + toolbar_actions = [] ## Import Button ## if self.hasImportIcon: - import_string = self.plugin.getString(StringContent.Import) - self.addToolbarButton( - import_string[u'title'], - import_string[u'tooltip'], - u':/general/general_import.png', self.onImportClick) + toolbar_actions.append([StringContent.Import, + u':/general/general_import.png', self.onImportClick]) ## Load Button ## if self.hasFileIcon: - load_string = self.plugin.getString(StringContent.Load) - self.addToolbarButton( - load_string[u'title'], - load_string[u'tooltip'], - u':/general/general_open.png', self.onFileClick) + toolbar_actions.append([StringContent.Load, + u':/general/general_open.png', self.onFileClick]) ## New Button ## if self.hasNewIcon: - new_string = self.plugin.getString(StringContent.New) - self.addToolbarButton( - new_string[u'title'], - new_string[u'tooltip'], - u':/general/general_new.png', self.onNewClick) + toolbar_actions.append([StringContent.New, + u':/general/general_new.png', self.onNewClick]) ## Edit Button ## if self.hasEditIcon: - edit_string = self.plugin.getString(StringContent.Edit) - self.addToolbarButton( - edit_string[u'title'], - edit_string[u'tooltip'], - u':/general/general_edit.png', self.onEditClick) + toolbar_actions.append([StringContent.Edit, + u':/general/general_edit.png', self.onEditClick]) ## Delete Button ## if self.hasDeleteIcon: - delete_string = self.plugin.getString(StringContent.Delete) - self.addToolbarButton( - delete_string[u'title'], - delete_string[u'tooltip'], - u':/general/general_delete.png', self.onDeleteClick) + toolbar_actions.append([StringContent.Delete, + u':/general/general_delete.png', self.onDeleteClick]) ## Separator Line ## self.addToolbarSeparator() ## Preview ## - preview_string = self.plugin.getString(StringContent.Preview) - self.addToolbarButton( - preview_string[u'title'], - preview_string[u'tooltip'], - u':/general/general_preview.png', self.onPreviewClick) + toolbar_actions.append([StringContent.Preview, + u':/general/general_preview.png', self.onPreviewClick]) ## Live Button ## - live_string = self.plugin.getString(StringContent.Live) - self.addToolbarButton( - live_string[u'title'], - live_string[u'tooltip'], - u':/general/general_live.png', self.onLiveClick) + toolbar_actions.append([StringContent.Live, + u':/general/general_live.png', self.onLiveClick]) ## Add to service Button ## - service_string = self.plugin.getString(StringContent.Service) - self.addToolbarButton( - service_string[u'title'], - service_string[u'tooltip'], - u':/general/general_add.png', self.onAddClick) + toolbar_actions.append([StringContent.Service, + u':/general/general_add.png', self.onAddClick]) + for action in toolbar_actions: + self.addToolbarButton( + self.plugin.getString(action[0])[u'title'], + self.plugin.getString(action[0])[u'tooltip'], + action[1], action[2]) def addListViewToToolBar(self): """ === modified file 'openlp/core/lib/plugin.py' --- openlp/core/lib/plugin.py 2011-02-09 17:30:38 +0000 +++ openlp/core/lib/plugin.py 2011-02-11 04:14:54 +0000 @@ -114,7 +114,8 @@ """ 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 way for descendent plugins to populate common data. This method *must* @@ -132,6 +133,12 @@ ``pluginHelpers`` 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) self.name = name @@ -141,6 +148,8 @@ self.version = version self.settingsSection = self.name.lower() self.icon = None + self.mediaItemClass = mediaItemClass + self.settingsTabClass = settingsTabClass self.weight = 0 self.status = PluginStatus.Inactive # Set up logging @@ -199,7 +208,9 @@ Construct a MediaManagerItem object with all the buttons and things 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): """ @@ -230,9 +241,13 @@ 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): """ === modified file 'openlp/core/lib/rendermanager.py' --- openlp/core/lib/rendermanager.py 2010-12-27 08:32:01 +0000 +++ openlp/core/lib/rendermanager.py 2011-02-11 04:14:54 +0000 @@ -68,7 +68,6 @@ self.theme_level = u'' self.override_background = None self.theme_data = None - self.alertTab = None self.force_page = False def update_display(self): @@ -261,4 +260,4 @@ log.debug(u'calculate default %d, %d, %f', self.width, self.height, self.screen_ratio ) # 90% is start of footer - self.footer_start = int(self.height * 0.90) \ No newline at end of file + self.footer_start = int(self.height * 0.90) === modified file 'openlp/core/lib/theme.py' --- openlp/core/lib/theme.py 2011-02-08 02:45:37 +0000 +++ openlp/core/lib/theme.py 2011-02-11 04:14:54 +0000 @@ -164,6 +164,7 @@ elif type_string == u'leftBottom': return BackgroundGradientType.LeftBottom + class HorizontalType(object): """ Type enumeration for horizontal alignment. @@ -172,6 +173,19 @@ Center = 1 Right = 2 + @staticmethod + def to_string(horizontal_type): + """ + Return a string representation of a horizontal type. + """ + if horizontal_type == Horizontal.Right: + return u'right' + elif horizontal_type == Horizontal.Center: + return u'center' + else: + return u'left' + + class VerticalType(object): """ Type enumeration for vertical alignment. @@ -180,6 +194,19 @@ Middle = 1 Bottom = 2 + @staticmethod + def to_string(vertical_type): + """ + Return a string representation of a vertical type. + """ + if vertical_type == VerticalType.Bottom: + return u'bottom' + elif vertical_type == VerticalType.Middle: + return u'middle' + else: + return u'top' + + BOOLEAN_LIST = [u'bold', u'italics', u'override', u'outline', u'shadow', u'slide_transition'] === modified file 'openlp/core/lib/ui.py' --- openlp/core/lib/ui.py 2011-02-10 18:35:59 +0000 +++ openlp/core/lib/ui.py 2011-02-11 04:14:54 +0000 @@ -64,12 +64,14 @@ New = translate('OpenLP.Ui', 'New') NewType = unicode(translate('OpenLP.Ui', 'New %s')) OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0') + OpenType = unicode(translate('OpenLP.Ui', 'Open %s')) Preview = translate('OpenLP.Ui', 'Preview') PreviewSelect = unicode(translate('OpenLP.Ui', 'Preview the selected %s.')) ReplaceBG = translate('OpenLP.Ui', 'Replace Background') ReplaceLiveBG = translate('OpenLP.Ui', 'Replace Live Background') ResetBG = translate('OpenLP.Ui', 'Reset Background') ResetLiveBG = translate('OpenLP.Ui', 'Reset Live Background') + SaveType = unicode(translate('OpenLP.Ui', 'Save %s')) SendSelectLive = unicode(translate('OpenLP.Ui', 'Send the selected %s live.')) Service = translate('OpenLP.Ui', 'Service') === modified file 'openlp/core/ui/maindisplay.py' --- openlp/core/ui/maindisplay.py 2011-02-08 02:45:37 +0000 +++ openlp/core/ui/maindisplay.py 2011-02-11 04:14:54 +0000 @@ -65,7 +65,6 @@ self.parent = parent self.screens = screens self.isLive = live - self.alertTab = None self.hideMode = None self.override = {} mainIcon = build_icon(u':/icon/openlp-logo-16x16.png') === modified file 'openlp/core/ui/mainwindow.py' --- openlp/core/ui/mainwindow.py 2011-02-10 18:59:59 +0000 +++ openlp/core/ui/mainwindow.py 2011-02-11 04:14:54 +0000 @@ -324,14 +324,12 @@ UiStrings.CreateANew % UiStrings.Service.toLower()) self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N')) self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open')) - self.FileOpenItem.setToolTip( - translate('OpenLP.MainWindow', 'Open Service')) + self.FileOpenItem.setToolTip(UiStrings.OpenType % UiStrings.Service) self.FileOpenItem.setStatusTip( translate('OpenLP.MainWindow', 'Open an existing service.')) self.FileOpenItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+O')) self.FileSaveItem.setText(translate('OpenLP.MainWindow', '&Save')) - self.FileSaveItem.setToolTip( - translate('OpenLP.MainWindow', 'Save Service')) + self.FileSaveItem.setToolTip(UiStrings.SaveType % UiStrings.Service) self.FileSaveItem.setStatusTip( translate('OpenLP.MainWindow', 'Save the current service to disk.')) self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S')) === modified file 'openlp/core/ui/servicemanager.py' --- openlp/core/ui/servicemanager.py 2011-02-10 18:35:59 +0000 +++ openlp/core/ui/servicemanager.py 2011-02-11 04:14:54 +0000 @@ -100,12 +100,12 @@ UiStrings.CreateANew % UiStrings.Service.toLower(), self.onNewServiceClicked) self.toolbar.addToolbarButton( - translate('OpenLP.ServiceManager', 'Open Service'), + UiStrings.OpenType % UiStrings.Service, u':/general/general_open.png', translate('OpenLP.ServiceManager', 'Load an existing service'), self.onLoadServiceClicked) self.toolbar.addToolbarButton( - translate('OpenLP.ServiceManager', 'Save Service'), + UiStrings.SaveType % UiStrings.Service, u':/general/general_save.png', translate('OpenLP.ServiceManager', 'Save this service'), self.saveFile) @@ -465,7 +465,7 @@ save the file. """ fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow, - translate('OpenLP.ServiceManager', 'Save Service'), + UiStrings.SaveType % UiStrings.Service, SettingsManager.get_last_dir( self.mainwindow.serviceSettingsSection), translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)'))) === modified file 'openlp/core/ui/slidecontroller.py' --- openlp/core/ui/slidecontroller.py 2011-02-09 17:30:38 +0000 +++ openlp/core/ui/slidecontroller.py 2011-02-11 04:14:54 +0000 @@ -415,7 +415,6 @@ # rebuild display as screen size changed self.display = MainDisplay(self, self.screens, self.isLive) self.display.imageManager = self.parent.renderManager.image_manager - self.display.alertTab = self.alertTab self.display.setup() if self.isLive: self.__addActionsToWidget(self.display) === modified file 'openlp/core/ui/thememanager.py' --- openlp/core/ui/thememanager.py 2011-02-10 04:06:16 +0000 +++ openlp/core/ui/thememanager.py 2011-02-11 04:14:54 +0000 @@ -34,7 +34,8 @@ from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ - BackgroundType, BackgroundGradientType, check_directory_exists + BackgroundType, BackgroundGradientType, check_directory_exists, \ + VerticalType from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm @@ -762,11 +763,11 @@ newtheme.font_main_outline = True newtheme.font_main_outline_color = \ unicode(theme.OutlineColor.name()) - vAlignCorrection = 0 + vAlignCorrection = VerticalType.Top if theme.VerticalAlign == 2: - vAlignCorrection = 1 + vAlignCorrection = VerticalType.Middle elif theme.VerticalAlign == 1: - vAlignCorrection = 2 + vAlignCorrection = VerticalType.Bottom newtheme.display_horizontal_align = theme.HorizontalAlign newtheme.display_vertical_align = vAlignCorrection return newtheme.extract_xml() === modified file 'openlp/core/ui/wizard.py' --- openlp/core/ui/wizard.py 2011-02-10 19:37:02 +0000 +++ openlp/core/ui/wizard.py 2011-02-11 04:14:54 +0000 @@ -27,11 +27,12 @@ The :mod:``wizard`` module provides generic wizard tools for OpenLP. """ import logging +import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, Receiver -from openlp.core.lib.ui import add_welcome_page +from openlp.core.lib import build_icon, Receiver, SettingsManager +from openlp.core.lib.ui import UiStrings, add_welcome_page log = logging.getLogger(__name__) === modified file 'openlp/plugins/alerts/alertsplugin.py' --- openlp/plugins/alerts/alertsplugin.py 2011-01-22 17:50:32 +0000 +++ openlp/plugins/alerts/alertsplugin.py 2011-02-11 04:14:54 +0000 @@ -40,21 +40,14 @@ log.info(u'Alerts Plugin loaded') 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.icon = build_icon(u':/plugins/plugin_alerts.png') self.alertsmanager = AlertsManager(self) self.manager = Manager(u'alerts', init_schema) - self.visible_name = self.getString(StringContent.VisibleName) 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): """ Give the alerts plugin the opportunity to add items to the @@ -81,7 +74,7 @@ log.info(u'Alerts Initialising') Plugin.initialise(self) self.toolsAlertItem.setVisible(True) - self.liveController.alertTab = self.alertsTab + self.liveController.alertTab = self.settings_tab def finalise(self): """ === modified file 'openlp/plugins/alerts/lib/alertsmanager.py' --- openlp/plugins/alerts/lib/alertsmanager.py 2010-12-26 11:04:47 +0000 +++ openlp/plugins/alerts/lib/alertsmanager.py 2011-02-11 04:14:54 +0000 @@ -84,7 +84,7 @@ if len(self.alertList) == 0: return text = self.alertList.pop(0) - alertTab = self.parent.alertsTab + alertTab = self.parent.settings_tab self.parent.liveController.display.alert(text) # Check to see if we have a timer running. if self.timer_id == 0: @@ -103,4 +103,4 @@ self.parent.liveController.display.alert(u'') self.killTimer(self.timer_id) self.timer_id = 0 - self.generateAlert() \ No newline at end of file + self.generateAlert() === modified file 'openlp/plugins/alerts/lib/alertstab.py' --- openlp/plugins/alerts/lib/alertstab.py 2011-02-09 05:04:12 +0000 +++ openlp/plugins/alerts/lib/alertstab.py 2011-02-11 04:14:54 +0000 @@ -33,10 +33,8 @@ """ AlertsTab is the alerts settings tab in the settings dialog. """ - def __init__(self, parent, visible_title): - self.parent = parent - self.manager = parent.manager - SettingsTab.__init__(self, parent.name, visible_title) + def __init__(self, name, visible_title): + SettingsTab.__init__(self, name, visible_title) def setupUi(self): self.setObjectName(u'AlertsTab') === modified file 'openlp/plugins/bibles/bibleplugin.py' --- openlp/plugins/bibles/bibleplugin.py 2011-02-09 17:30:38 +0000 +++ openlp/plugins/bibles/bibleplugin.py 2011-02-11 04:14:54 +0000 @@ -38,7 +38,8 @@ log.info(u'Bible Plugin loaded') 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.icon_path = u':/plugins/plugin_bibles.png' self.icon = build_icon(self.icon_path) @@ -62,14 +63,6 @@ self.importBibleItem.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): self.importBibleItem = QtGui.QAction(import_menu) self.importBibleItem.setObjectName(u'importBibleItem') === modified file 'openlp/plugins/bibles/forms/bibleimportform.py' --- openlp/plugins/bibles/forms/bibleimportform.py 2011-02-10 19:37:02 +0000 +++ openlp/plugins/bibles/forms/bibleimportform.py 2011-02-11 04:14:54 +0000 @@ -33,9 +33,9 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.lib import Receiver, translate from openlp.core.lib.db import delete_database -from openlp.core.lib.ui import UiStrings, critical_error_message_box +from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui.wizard import OpenLPWizard from openlp.core.utils import AppLocation, string_is_unicode from openlp.plugins.bibles.lib.manager import BibleFormat === modified file 'openlp/plugins/custom/customplugin.py' --- openlp/plugins/custom/customplugin.py 2011-02-09 17:30:38 +0000 +++ openlp/plugins/custom/customplugin.py 2011-02-11 04:14:54 +0000 @@ -48,21 +48,14 @@ log.info(u'Custom Plugin loaded') 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.manager = Manager(u'custom', init_schema) self.edit_custom_form = EditCustomForm(self.manager) self.icon_path = u':/plugins/plugin_custom.png' 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): about_text = translate('CustomPlugin', '<strong>Custom Plugin</strong>' '<br />The custom plugin provides the ability to set up custom ' === modified file 'openlp/plugins/images/imageplugin.py' --- openlp/plugins/images/imageplugin.py 2011-02-09 21:30:41 +0000 +++ openlp/plugins/images/imageplugin.py 2011-02-11 04:14:54 +0000 @@ -35,15 +35,12 @@ log.info(u'Image Plugin loaded') 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.icon_path = u':/plugins/plugin_images.png' self.icon = build_icon(self.icon_path) - def getMediaManagerItem(self): - # Create the MediaManagerItem object. - return ImageMediaItem(self, self, self.icon) - def about(self): about_text = translate('ImagePlugin', '<strong>Image Plugin</strong>' '<br />The image plugin provides displaying of images.<br />One ' === modified file 'openlp/plugins/media/lib/mediaitem.py' --- openlp/plugins/media/lib/mediaitem.py 2011-02-10 18:38:03 +0000 +++ openlp/plugins/media/lib/mediaitem.py 2011-02-11 04:14:54 +0000 @@ -138,6 +138,7 @@ return False def initialise(self): + self.listView.clear() self.listView.setIconSize(QtCore.QSize(88, 50)) self.loadList(SettingsManager.load_list(self.settingsSection, self.settingsSection)) === modified file 'openlp/plugins/media/lib/mediatab.py' --- openlp/plugins/media/lib/mediatab.py 2011-01-03 11:25:30 +0000 +++ openlp/plugins/media/lib/mediatab.py 2011-02-11 04:14:54 +0000 @@ -32,8 +32,8 @@ """ MediaTab is the Media settings tab in the settings dialog. """ - def __init__(self, title): - SettingsTab.__init__(self, title) + def __init__(self, title, visible_title): + SettingsTab.__init__(self, title, visible_title) def setupUi(self): self.setObjectName(u'MediaTab') @@ -53,9 +53,8 @@ self.onUsePhononCheckBoxChanged) def retranslateUi(self): - self.tabTitleVisible = translate('MediaPlugin.MediaTab', 'Media') - self.mediaModeGroupBox.setTitle(translate('MediaPlugin.MediaTab', - 'Media Display')) + self.mediaModeGroupBox.setTitle( + translate('MediaPlugin.MediaTab', 'Media Display')) self.usePhononCheckBox.setText( translate('MediaPlugin.MediaTab', 'Use Phonon for video playback')) === modified file 'openlp/plugins/media/mediaplugin.py' --- openlp/plugins/media/mediaplugin.py 2011-02-09 21:30:41 +0000 +++ openlp/plugins/media/mediaplugin.py 2011-02-11 04:14:54 +0000 @@ -38,7 +38,8 @@ log.info(u'%s MediaPlugin loaded', __name__) 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.icon_path = u':/plugins/plugin_media.png' self.icon = build_icon(self.icon_path) @@ -75,13 +76,6 @@ mimetype = u'' 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): about_text = translate('MediaPlugin', '<strong>Media Plugin</strong>' '<br />The media plugin provides playback of audio and video.') === modified file 'openlp/plugins/remotes/remoteplugin.py' --- openlp/plugins/remotes/remoteplugin.py 2010-12-31 02:17:41 +0000 +++ openlp/plugins/remotes/remoteplugin.py 2011-02-11 04:14:54 +0000 @@ -38,7 +38,8 @@ """ 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.weight = -1 self.server = None @@ -61,13 +62,6 @@ if self.server: 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): """ Information about this plugin === modified file 'openlp/plugins/songs/songsplugin.py' --- openlp/plugins/songs/songsplugin.py 2011-02-10 18:35:59 +0000 +++ openlp/plugins/songs/songsplugin.py 2011-02-11 04:14:54 +0000 @@ -51,17 +51,14 @@ """ 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.manager = Manager(u'songs', init_schema) self.icon_path = u':/plugins/plugin_songs.png' self.icon = build_icon(self.icon_path) 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): log.info(u'Songs Initialising') Plugin.initialise(self) @@ -69,13 +66,6 @@ self.mediaItem.displayResultsSong( 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): """ Give the Songs plugin the opportunity to add items to the
_______________________________________________ Mailing list: https://launchpad.net/~openlp-core Post to : openlp-core@lists.launchpad.net Unsubscribe : https://launchpad.net/~openlp-core More help : https://help.launchpad.net/ListHelp