From 399813e6aa5fee1275d69b4a44a01c4b477b3e77 Mon Sep 17 00:00:00 2001 From: rimach Date: Thu, 16 Sep 2010 23:10:36 +0200 Subject: [PATCH] fix for the merge comments, add correct translations for settings window --- openlp.pyw | 20 +++++----- openlp/core/lib/__init__.py | 4 +- openlp/core/lib/mediamanageritem.py | 28 +++++++------- openlp/core/lib/plugin.py | 12 +++--- openlp/core/lib/pluginmanager.py | 12 +++--- openlp/core/lib/settingstab.py | 10 ++--- openlp/core/ui/mediadockmanager.py | 24 ++++++------ openlp/core/ui/pluginform.py | 10 ++--- openlp/plugins/alerts/alertsplugin.py | 11 ++---- openlp/plugins/alerts/forms/alertform.py | 4 +- openlp/plugins/alerts/lib/alertstab.py | 6 +-- openlp/plugins/bibles/bibleplugin.py | 29 +++++++------- openlp/plugins/bibles/lib/biblestab.py | 5 +-- openlp/plugins/custom/customplugin.py | 38 +++++++++---------- openlp/plugins/custom/lib/customtab.py | 5 +-- openlp/plugins/images/imageplugin.py | 27 ++++++------- openlp/plugins/media/mediaplugin.py | 26 ++++++------- .../presentations/lib/presentationtab.py | 6 +-- .../presentations/presentationplugin.py | 25 ++++++------ openlp/plugins/remotes/lib/remotetab.py | 5 +-- openlp/plugins/remotes/remoteplugin.py | 15 +++----- openlp/plugins/songs/lib/songstab.py | 5 +-- openlp/plugins/songs/songsplugin.py | 27 ++++++------- openlp/plugins/songusage/songusageplugin.py | 11 ++---- 24 files changed, 165 insertions(+), 200 deletions(-) diff --git a/openlp.pyw b/openlp.pyw index af587ff19..9327a1168 100755 --- a/openlp.pyw +++ b/openlp.pyw @@ -164,16 +164,16 @@ def main(): # Set up command line options. usage = u'Usage: %prog [options] [qt-options]' parser = OptionParser(usage=usage) - parser.add_option('-e', '--no-error-form', dest='no_error_form', - action='store_true', help='Disable the error notification form.') - parser.add_option('-l', '--log-level', dest='loglevel', - default='warning', metavar='LEVEL', help='Set logging to LEVEL ' - 'level. Valid values are "debug", "info", "warning".') - parser.add_option('-p', '--portable', dest='portable', - action='store_true', help='Specify if this should be run as a ' - 'portable app, off a USB flash drive (not implemented).') - parser.add_option('-s', '--style', dest='style', - help='Set the Qt4 style (passed directly to Qt4).') + parser.add_option(u'-e', u'--no-error-form', dest=u'no_error_form', + action=u'store_true', help=u'Disable the error notification form.') + parser.add_option(u'-l', u'--log-level', dest=u'loglevel', + default=u'warning', metavar=u'LEVEL', help=u'Set logging to LEVEL ' + u'level. Valid values are "debug", "info", "warning".') + parser.add_option(u'-p', u'--portable', dest=u'portable', + action=u'store_true', help=u'Specify if this should be run as a ' + u'portable app, off a USB flash drive (not implemented).') + parser.add_option(u'-s', u'--style', dest=u'style', + help=u'Set the Qt4 style (passed directly to Qt4).') # Set up logging log_path = AppLocation.get_directory(AppLocation.CacheDir) if not os.path.exists(log_path): diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index ea2634df4..4fe278e42 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -304,7 +304,7 @@ def expand_tags(text): from spelltextedit import SpellTextEdit from eventreceiver import Receiver from settingsmanager import SettingsManager -from plugin import PluginStatus, StringType, Plugin +from plugin import PluginStatus, StringContent, Plugin from pluginmanager import PluginManager from settingstab import SettingsTab from serviceitem import ServiceItem @@ -318,4 +318,4 @@ from theme import ThemeLevel, ThemeXML from renderer import Renderer from rendermanager import RenderManager from mediamanageritem import MediaManagerItem -from baselistwithdnd import BaseListWithDnD +from baselistwithdnd import BaseListWithDnD \ No newline at end of file diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index ead482e88..7f916e157 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -32,7 +32,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import context_menu_action, context_menu_separator, \ - SettingsManager, OpenLPToolbar, ServiceItem, StringType, build_icon, \ + SettingsManager, OpenLPToolbar, ServiceItem, StringContent, build_icon, \ translate log = logging.getLogger(__name__) @@ -95,9 +95,9 @@ class MediaManagerItem(QtGui.QWidget): self.parent = parent #TODO: plugin should not be the parent in future self.plugin = parent#plugin - media_title_string = self.plugin.getString(StringType.MediaItem) - self.title = media_title_string[u'title'] - self.settingsSection = self.plugin.name_lower + visible_title = self.plugin.getString(StringContent.VisibleName) + self.title = visible_title[u'title'] + self.settingsSection = self.plugin.name.lower() if isinstance(icon, QtGui.QIcon): self.icon = icon elif isinstance(icon, basestring): @@ -204,35 +204,35 @@ class MediaManagerItem(QtGui.QWidget): """ ## Import Button ## if self.hasImportIcon: - import_string = self.plugin.getString(StringType.Import) + import_string = self.plugin.getString(StringContent.Import) self.addToolbarButton( import_string[u'title'], import_string[u'tooltip'], u':/general/general_import.png', self.onImportClick) ## Load Button ## if self.hasFileIcon: - load_string = self.plugin.getString(StringType.Load) + load_string = self.plugin.getString(StringContent.Load) self.addToolbarButton( load_string[u'title'], load_string[u'tooltip'], u':/general/general_open.png', self.onFileClick) ## New Button ## if self.hasNewIcon: - new_string = self.plugin.getString(StringType.New) + new_string = self.plugin.getString(StringContent.New) self.addToolbarButton( new_string[u'title'], new_string[u'tooltip'], u':/general/general_new.png', self.onNewClick) ## Edit Button ## if self.hasEditIcon: - edit_string = self.plugin.getString(StringType.Edit) + edit_string = self.plugin.getString(StringContent.Edit) self.addToolbarButton( edit_string[u'title'], edit_string[u'tooltip'], u':/general/general_edit.png', self.onEditClick) ## Delete Button ## if self.hasDeleteIcon: - delete_string = self.plugin.getString(StringType.Delete) + delete_string = self.plugin.getString(StringContent.Delete) self.addToolbarButton( delete_string[u'title'], delete_string[u'tooltip'], @@ -240,19 +240,19 @@ class MediaManagerItem(QtGui.QWidget): ## Separator Line ## self.addToolbarSeparator() ## Preview ## - preview_string = self.plugin.getString(StringType.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) ## Live Button ## - live_string = self.plugin.getString(StringType.Live) + live_string = self.plugin.getString(StringContent.Live) self.addToolbarButton( live_string[u'title'], live_string[u'tooltip'], u':/general/general_live.png', self.onLiveClick) ## Add to service Button ## - service_string = self.plugin.getString(StringType.Service) + service_string = self.plugin.getString(StringContent.Service) self.addToolbarButton( service_string[u'title'], service_string[u'tooltip'], @@ -276,7 +276,7 @@ class MediaManagerItem(QtGui.QWidget): self.pageLayout.addWidget(self.listView) #define and add the context menu self.listView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) - name_string = self.plugin.getString(StringType.Name) + name_string = self.plugin.getString(StringContent.Name) if self.hasEditIcon: self.listView.addAction( context_menu_action( @@ -530,4 +530,4 @@ class MediaManagerItem(QtGui.QWidget): if self.generateSlideData(service_item, item): return service_item else: - return None + return None \ No newline at end of file diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index 7f668066f..c80fdfadd 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -42,7 +42,7 @@ class PluginStatus(object): Inactive = 0 Disabled = -1 -class StringType(object): +class StringContent(object): Name = u'name' Import = u'import' Load = u'load' @@ -52,7 +52,7 @@ class StringType(object): Preview = u'preview' Live = u'live' Service = u'service' - MediaItem = u'media_item' + VisibleName = u'visible_name' class Plugin(QtCore.QObject): """ @@ -128,11 +128,12 @@ class Plugin(QtCore.QObject): Defaults to *None*. A list of helper objects. """ QtCore.QObject.__init__(self) - self.setPluginStrings() self.name = name + self.strings = {} + self.setPluginStrings() if version: self.version = version - self.settingsSection = self.name_lower + self.settingsSection = self.name.lower() self.icon = None self.weight = 0 self.status = PluginStatus.Inactive @@ -314,6 +315,3 @@ class Plugin(QtCore.QObject): """ Called to define all translatable texts of the plugin """ - self.name = u'Plugin' - self.name_lower = u'plugin' - self.strings = {} diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 7aaf99f00..14bf48566 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -30,7 +30,7 @@ import os import sys import logging -from openlp.core.lib import Plugin, StringType, PluginStatus +from openlp.core.lib import Plugin, StringContent, PluginStatus log = logging.getLogger(__name__) @@ -152,13 +152,13 @@ class PluginManager(object): for plugin in self.plugins: if plugin.status is not PluginStatus.Disabled: plugin.settings_tab = plugin.getSettingsTab() - media_item_string = plugin.getString(StringType.MediaItem) + visible_title = plugin.getString(StringContent.VisibleName) if plugin.settings_tab: log.debug(u'Inserting settings tab item from %s' % - media_item_string[u'title']) - settingsform.addTab(media_item_string[u'title'], plugin.settings_tab) + visible_title[u'title']) + settingsform.addTab(visible_title[u'title'], plugin.settings_tab) else: - log.debug(u'No tab settings in %s' % media_item_string[u'title']) + log.debug(u'No tab settings in %s' % visible_title[u'title']) def hook_import_menu(self, import_menu): """ @@ -219,4 +219,4 @@ class PluginManager(object): for plugin in self.plugins: if plugin.isActive(): plugin.finalise() - log.info(u'Finalisation Complete for %s ' % plugin.name) + log.info(u'Finalisation Complete for %s ' % plugin.name) \ No newline at end of file diff --git a/openlp/core/lib/settingstab.py b/openlp/core/lib/settingstab.py index d746636cd..181dc2df8 100644 --- a/openlp/core/lib/settingstab.py +++ b/openlp/core/lib/settingstab.py @@ -31,17 +31,17 @@ class SettingsTab(QtGui.QWidget): SettingsTab is a helper widget for plugins to define Tabs for the settings dialog. """ - def __init__(self, title): + def __init__(self, title, visible_title=None): """ Constructor to create the Settings tab item. - ``title`` - The title of the tab, which is usually displayed on the tab. + ``plugin`` + The related plugin of the tab, which holds the content of the plugin. """ QtGui.QWidget.__init__(self) self.tabTitle = title - self.tabTitleVisible = None - self.settingsSection = self.tabTitle + self.tabTitleVisible = visible_title + self.settingsSection = self.tabTitle.lower() self.setupUi() self.retranslateUi() self.initialise() diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/mediadockmanager.py index ca0c72a6a..7d5b6aa2a 100644 --- a/openlp/core/ui/mediadockmanager.py +++ b/openlp/core/ui/mediadockmanager.py @@ -26,7 +26,7 @@ import logging -from openlp.core.lib import StringType +from openlp.core.lib import StringContent log = logging.getLogger(__name__) @@ -50,9 +50,9 @@ class MediaDockManager(object): ``icon`` An icon for this dock item """ - media_item_string = media_item.plugin.getString(StringType.MediaItem) - log.info(u'Adding %s dock' % media_item_string) - self.media_dock.addItem(media_item, icon, media_item_string[u'title']) + visible_title = media_item.plugin.getString(StringContent.VisibleName) + log.info(u'Adding %s dock' % visible_title) + self.media_dock.addItem(media_item, icon, visible_title[u'title']) def insert_dock(self, media_item, icon, weight): """ @@ -60,16 +60,16 @@ class MediaDockManager(object): This does not work as it gives a Segmentation error. For now add at end of stack if not present """ - media_item_string = media_item.plugin.getString(StringType.MediaItem) - log.debug(u'Inserting %s dock' % media_item_string[u'title']) + visible_title = media_item.plugin.getString(StringContent.VisibleName) + log.debug(u'Inserting %s dock' % visible_title[u'title']) match = False for dock_index in range(0, self.media_dock.count()): if self.media_dock.widget(dock_index).settingsSection == \ - media_item.plugin.name_lower: + media_item.plugin.name.lower(): match = True break if not match: - self.media_dock.addItem(media_item, icon, media_item_string[u'title']) + self.media_dock.addItem(media_item, icon, visible_title[u'title']) def remove_dock(self, media_item): """ @@ -78,11 +78,11 @@ class MediaDockManager(object): ``media_item`` The item to add to the dock """ - media_item_string = media_item.plugin.getString(StringType.MediaItem) - log.debug(u'remove %s dock' % media_item_string[u'title']) + visible_title = media_item.plugin.getString(StringContent.VisibleName) + log.debug(u'remove %s dock' % visible_title[u'title']) for dock_index in range(0, self.media_dock.count()): if self.media_dock.widget(dock_index): if self.media_dock.widget(dock_index).settingsSection == \ - media_item.plugin.name_lower: + media_item.plugin.name.lower(): self.media_dock.widget(dock_index).hide() - self.media_dock.removeItem(dock_index) + self.media_dock.removeItem(dock_index) \ No newline at end of file diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 83cd15941..56fe94b3f 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import PluginStatus, StringType, translate +from openlp.core.lib import PluginStatus, StringContent, translate from plugindialog import Ui_PluginViewDialog log = logging.getLogger(__name__) @@ -78,7 +78,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): elif plugin.status == PluginStatus.Disabled: status_text = unicode( translate('OpenLP.PluginForm', '%s (Disabled)')) - name_string = plugin.getString(StringType.Name) + name_string = plugin.getString(StringContent.Name) item.setText(status_text % name_string[u'plural']) # If the plugin has an icon, set it! if plugin.icon: @@ -110,7 +110,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): plugin_name_plural = self.pluginListWidget.currentItem().text().split(u' ')[0] self.activePlugin = None for plugin in self.parent.plugin_manager.plugins: - name_string = plugin.getString(StringType.Name) + name_string = plugin.getString(StringContent.Name) if name_string[u'plural'] == plugin_name_plural: self.activePlugin = plugin break @@ -139,6 +139,6 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog): elif self.activePlugin.status == PluginStatus.Disabled: status_text = unicode( translate('OpenLP.PluginForm', '%s (Disabled)')) - name_string = self.activePlugin.getString(StringType.Name) + name_string = self.activePlugin.getString(StringContent.Name) self.pluginListWidget.currentItem().setText( - status_text % name_string[u'plural']) + status_text % name_string[u'plural']) \ No newline at end of file diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 656ea7aeb..4577fc76e 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, StringType, build_icon, translate +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.plugins.alerts.lib import AlertsManager, AlertsTab from openlp.plugins.alerts.lib.db import init_schema @@ -106,15 +106,12 @@ class AlertsPlugin(Plugin): """ Called to define all translatable texts of the plugin """ - self.name = u'Alerts' - self.name_lower = u'alerts' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('AlertsPlugin', 'Alert'), u'plural': translate('AlertsPlugin', 'Alerts') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('AlertsPlugin', 'Alerts') - } + } \ No newline at end of file diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index e2ff6e2e2..730d5ebc8 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -35,7 +35,7 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): """ Provide UI for the alert system """ - def __init__(self, plugin): + def __init__(self, title, visible_title): """ Initialise the alert form """ @@ -155,4 +155,4 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): text = text.replace(u'<>', unicode(self.ParameterEdit.text())) self.parent.alertsmanager.displayAlert(text) return True - return False + return False \ No newline at end of file diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 77b6e7fb6..625287603 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -32,14 +32,13 @@ class AlertsTab(SettingsTab): """ AlertsTab is the alerts settings tab in the settings dialog. """ - def __init__(self, parent): + def __init__(self, parent, visible_title): self.parent = parent self.manager = parent.manager - SettingsTab.__init__(self, parent.name) + SettingsTab.__init__(self, parent.name, visible_title) def setupUi(self): self.setObjectName(u'AlertsTab') - self.tabTitleVisible = translate('AlertsPlugin.AlertsTab', 'Alerts') self.AlertsLayout = QtGui.QHBoxLayout(self) self.AlertsLayout.setSpacing(8) self.AlertsLayout.setMargin(8) @@ -296,4 +295,3 @@ class AlertsTab(SettingsTab): self.FontPreview.setFont(font) self.FontPreview.setStyleSheet(u'background-color: %s; color: %s' % (self.bg_color, self.font_color)) - diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 1685b493a..018f15c3e 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, StringType, build_icon, translate +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem log = logging.getLogger(__name__) @@ -58,8 +58,8 @@ class BiblePlugin(Plugin): self.exportBibleItem.setVisible(False) def getSettingsTab(self): - media_item_string = self.getString(StringType.MediaItem) - return BiblesTab(media_item_string[u'title']) + visible_name = self.getString(StringContent.VisibleName) + return BiblesTab(self.name, visible_name[u'title']) def getMediaManagerItem(self): # Create the BibleManagerItem object. @@ -122,51 +122,48 @@ class BiblePlugin(Plugin): """ Called to define all translatable texts of the plugin """ - self.name = u'Bibles' - self.name_lower = u'Bibles' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('BiblesPlugin', 'Bible'), u'plural': translate('BiblesPlugin', 'Bibles') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('BiblesPlugin', 'Bibles') } # Middle Header Bar ## Import Button ## - self.strings[StringType.Import] = { + self.strings[StringContent.Import] = { u'title': translate('BiblesPlugin', 'Import'), u'tooltip': translate('BiblesPlugin', 'Import a Bible') } ## New Button ## - self.strings[StringType.New] = { + self.strings[StringContent.New] = { u'title': translate('BiblesPlugin', 'Add'), u'tooltip': translate('BiblesPlugin', 'Add a new Bible') } ## Edit Button ## - self.strings[StringType.Edit] = { + self.strings[StringContent.Edit] = { u'title': translate('BiblesPlugin', 'Edit'), u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible') } ## Delete Button ## - self.strings[StringType.Delete] = { + self.strings[StringContent.Delete] = { u'title': translate('BiblesPlugin', 'Delete'), u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible') } ## Preview ## - self.strings[StringType.Preview] = { + self.strings[StringContent.Preview] = { u'title': translate('BiblesPlugin', 'Preview'), u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible') } ## Live Button ## - self.strings[StringType.Live] = { + self.strings[StringContent.Live] = { u'title': translate('BiblesPlugin', 'Live'), u'tooltip': translate('BiblesPlugin', 'Send the selected Bible live') } ## Add to service Button ## - self.strings[StringType.Service] = { + self.strings[StringContent.Service] = { u'title': translate('BiblesPlugin', 'Service'), u'tooltip': translate('BiblesPlugin', 'Add the selected Bible to the service') - } + } \ No newline at end of file diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 0903c9625..b7d1b9bde 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -38,15 +38,14 @@ class BiblesTab(SettingsTab): """ log.info(u'Bible Tab loaded') - def __init__(self, title): + def __init__(self, title, visible_title): self.paragraph_style = True self.show_new_chapters = False self.display_style = 0 - SettingsTab.__init__(self, title) + SettingsTab.__init__(self, title, visible_title) def setupUi(self): self.setObjectName(u'BiblesTab') - self.tabTitleVisible = translate('BiblesPlugin.BiblesTab', 'Bibles') self.BibleLayout = QtGui.QHBoxLayout(self) self.BibleLayout.setSpacing(8) self.BibleLayout.setMargin(8) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index c4cc9ba99..081e036b0 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -28,7 +28,7 @@ import logging from forms import EditCustomForm -from openlp.core.lib import Plugin, StringType, build_icon, translate +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.plugins.custom.lib import CustomMediaItem, CustomTab from openlp.plugins.custom.lib.db import CustomSlide, init_schema @@ -40,8 +40,8 @@ class CustomPlugin(Plugin): This plugin enables the user to create, edit and display custom slide shows. Custom shows are divided into slides. Each show is able to have it's own theme. - Custom shows are designed to replace the use of Customs where - the Customs plugin has become restrictive. Examples could be + Custom shows are designed to replace the use of songs where + the songs plugin has become restrictive. Examples could be Welcome slides, Bible Reading information, Orders of service. """ log.info(u'Custom Plugin loaded') @@ -55,8 +55,8 @@ class CustomPlugin(Plugin): self.icon = build_icon(self.icon_path) def getSettingsTab(self): - media_item_string = self.getString(StringType.MediaItem) - return CustomTab(media_item_string[u'title']) + visible_name = self.getString(StringContent.VisibleName) + return CustomTab(self.name, visible_name[u'title']) def getMediaManagerItem(self): # Create the CustomManagerItem object @@ -66,7 +66,7 @@ class CustomPlugin(Plugin): about_text = translate('CustomPlugin', 'Custom Plugin' '
The custom plugin provides the ability to set up custom ' 'text slides that can be displayed on the screen the same way ' - 'Customs are. This plugin provides greater freedom over the Customs ' + 'songs are. This plugin provides greater freedom over the songs ' 'plugin.') return about_text @@ -97,60 +97,58 @@ class CustomPlugin(Plugin): for custom in customsUsingTheme: custom.theme_name = newTheme self.custommanager.save_object(custom) + def setPluginStrings(self): """ Called to define all translatable texts of the plugin """ - self.name = u'Custom' - self.name_lower = u'custom' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('CustomsPlugin', 'Custom'), u'plural': translate('CustomsPlugin', 'Customs') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('CustomsPlugin', 'Customs') } # Middle Header Bar ## Import Button ## - self.strings[StringType.Import] = { + self.strings[StringContent.Import] = { u'title': translate('CustomsPlugin', 'Import'), u'tooltip': translate('CustomsPlugin', 'Import a Custom') } ## Load Button ## - self.strings[StringType.Load] = { + self.strings[StringContent.Load] = { u'title': translate('CustomsPlugin', 'Load'), u'tooltip': translate('CustomsPlugin', 'Load a new Custom') } ## New Button ## - self.strings[StringType.New] = { + self.strings[StringContent.New] = { u'title': translate('CustomsPlugin', 'Add'), u'tooltip': translate('CustomsPlugin', 'Add a new Custom') } ## Edit Button ## - self.strings[StringType.Edit] = { + self.strings[StringContent.Edit] = { u'title': translate('CustomsPlugin', 'Edit'), u'tooltip': translate('CustomsPlugin', 'Edit the selected Custom') } ## Delete Button ## - self.strings[StringType.Delete] = { + self.strings[StringContent.Delete] = { u'title': translate('CustomsPlugin', 'Delete'), u'tooltip': translate('CustomsPlugin', 'Delete the selected Custom') } ## Preview ## - self.strings[StringType.Preview] = { + self.strings[StringContent.Preview] = { u'title': translate('CustomsPlugin', 'Preview'), u'tooltip': translate('CustomsPlugin', 'Preview the selected Custom') } ## Live Button ## - self.strings[StringType.Live] = { + self.strings[StringContent.Live] = { u'title': translate('CustomsPlugin', 'Live'), u'tooltip': translate('CustomsPlugin', 'Send the selected Custom live') } ## Add to service Button ## - self.strings[StringType.Service] = { + self.strings[StringContent.Service] = { u'title': translate('CustomsPlugin', 'Service'), u'tooltip': translate('CustomsPlugin', 'Add the selected Custom to the service') - } + } \ No newline at end of file diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 77ef0f3f6..461d6af59 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -32,12 +32,11 @@ class CustomTab(SettingsTab): """ CustomTab is the Custom 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'CustomTab') - self.tabTitleVisible = translate('CustomPlugin.CustomTab', 'Custom') self.customLayout = QtGui.QFormLayout(self) self.customLayout.setSpacing(8) self.customLayout.setMargin(8) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index cca311203..d0ef63156 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -26,7 +26,7 @@ import logging -from openlp.core.lib import Plugin, StringType, build_icon, translate +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.plugins.images.lib import ImageMediaItem log = logging.getLogger(__name__) @@ -53,7 +53,7 @@ class ImagePlugin(Plugin): 'make use of OpenLP\'s "timed looping" feature to create a slide ' 'show that runs automatically. In addition to this, images from ' 'the plugin can be used to override the current theme\'s ' - 'background, which renders text-based items like Images with the ' + 'background, which renders text-based items like songs with the ' 'selected image as a background instead of the background ' 'provided by the theme.') return about_text @@ -62,51 +62,48 @@ class ImagePlugin(Plugin): """ Called to define all translatable texts of the plugin """ - self.name = u'Images' - self.name_lower = u'images' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('ImagePlugin', 'Image'), u'plural': translate('ImagePlugin', 'Images') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('ImagePlugin', 'Images') } # Middle Header Bar ## Load Button ## - self.strings[StringType.Load] = { + self.strings[StringContent.Load] = { u'title': translate('ImagePlugin', 'Load'), u'tooltip': translate('ImagePlugin', 'Load a new Image') } ## New Button ## - self.strings[StringType.New] = { + self.strings[StringContent.New] = { u'title': translate('ImagePlugin', 'Add'), u'tooltip': translate('ImagePlugin', 'Add a new Image') } ## Edit Button ## - self.strings[StringType.Edit] = { + self.strings[StringContent.Edit] = { u'title': translate('ImagePlugin', 'Edit'), u'tooltip': translate('ImagePlugin', 'Edit the selected Image') } ## Delete Button ## - self.strings[StringType.Delete] = { + self.strings[StringContent.Delete] = { u'title': translate('ImagePlugin', 'Delete'), u'tooltip': translate('ImagePlugin', 'Delete the selected Image') } ## Preview ## - self.strings[StringType.Preview] = { + self.strings[StringContent.Preview] = { u'title': translate('ImagePlugin', 'Preview'), u'tooltip': translate('ImagePlugin', 'Preview the selected Image') } ## Live Button ## - self.strings[StringType.Live] = { + self.strings[StringContent.Live] = { u'title': translate('ImagePlugin', 'Live'), u'tooltip': translate('ImagePlugin', 'Send the selected Image live') } ## Add to service Button ## - self.strings[StringType.Service] = { + self.strings[StringContent.Service] = { u'title': translate('ImagePlugin', 'Service'), u'tooltip': translate('ImagePlugin', 'Add the selected Image to the service') - } + } \ No newline at end of file diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 6f4197821..23cce3056 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -28,7 +28,7 @@ import logging from PyQt4.phonon import Phonon -from openlp.core.lib import Plugin, StringType, build_icon, translate +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.plugins.media.lib import MediaMediaItem log = logging.getLogger(__name__) @@ -76,55 +76,53 @@ class MediaPlugin(Plugin): about_text = translate('MediaPlugin', 'Media Plugin' '
The media plugin provides playback of audio and video.') return about_text + def setPluginStrings(self): """ Called to define all translatable texts of the plugin """ - self.name = u'Media' - self.name_lower = u'media' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('MediaPlugin', 'Media'), u'plural': translate('MediaPlugin', 'Media') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('MediaPlugin', 'Media') } # Middle Header Bar ## Load Button ## - self.strings[StringType.Load] = { + self.strings[StringContent.Load] = { u'title': translate('MediaPlugin', 'Load'), u'tooltip': translate('MediaPlugin', 'Load a new Media') } ## New Button ## - self.strings[StringType.New] = { + self.strings[StringContent.New] = { u'title': translate('MediaPlugin', 'Add'), u'tooltip': translate('MediaPlugin', 'Add a new Media') } ## Edit Button ## - self.strings[StringType.Edit] = { + self.strings[StringContent.Edit] = { u'title': translate('MediaPlugin', 'Edit'), u'tooltip': translate('MediaPlugin', 'Edit the selected Media') } ## Delete Button ## - self.strings[StringType.Delete] = { + self.strings[StringContent.Delete] = { u'title': translate('MediaPlugin', 'Delete'), u'tooltip': translate('MediaPlugin', 'Delete the selected Media') } ## Preview ## - self.strings[StringType.Preview] = { + self.strings[StringContent.Preview] = { u'title': translate('MediaPlugin', 'Preview'), u'tooltip': translate('MediaPlugin', 'Preview the selected Media') } ## Live Button ## - self.strings[StringType.Live] = { + self.strings[StringContent.Live] = { u'title': translate('MediaPlugin', 'Live'), u'tooltip': translate('MediaPlugin', 'Send the selected Media live') } ## Add to service Button ## - self.strings[StringType.Service] = { + self.strings[StringContent.Service] = { u'title': translate('MediaPlugin', 'Service'), u'tooltip': translate('MediaPlugin', 'Add the selected Media to the service') - } + } \ No newline at end of file diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index c664221cc..a7b16cd5a 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -32,20 +32,18 @@ class PresentationTab(SettingsTab): """ PresentationsTab is the Presentations settings tab in the settings dialog. """ - def __init__(self, title, controllers): + def __init__(self, title, visible_title, controllers): """ Constructor """ self.controllers = controllers - SettingsTab.__init__(self, title) + SettingsTab.__init__(self, title, visible_title) def setupUi(self): """ Create the controls for the settings tab """ self.setObjectName(u'PresentationTab') - self.tabTitleVisible = translate('PresentationPlugin.PresentationTab', - 'Presentations') self.PresentationLayout = QtGui.QHBoxLayout(self) self.PresentationLayout.setSpacing(8) self.PresentationLayout.setMargin(8) diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index b085828e7..6e1281dae 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -30,7 +30,7 @@ presentations from a variety of document formats. import os import logging -from openlp.core.lib import Plugin, StringType, build_icon, translate +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.utils import AppLocation from openlp.plugins.presentations.lib import PresentationController, \ PresentationMediaItem, PresentationTab @@ -60,8 +60,8 @@ class PresentationPlugin(Plugin): """ Create the settings Tab """ - media_item_string = self.getString(StringType.MediaItem) - return PresentationTab(media_item_string[u'title'], self.controllers) + visible_name = self.getString(StringContent.VisibleName) + return PresentationTab(self.name, visible_name[u'title'], self.controllers) def initialise(self): """ @@ -149,41 +149,38 @@ class PresentationPlugin(Plugin): """ Called to define all translatable texts of the plugin """ - self.name = u'Presentations' - self.name_lower = u'presentations' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('PresentationPlugin', 'Presentation'), u'plural': translate('PresentationPlugin', 'Presentations') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('PresentationPlugin', 'Presentations') } # Middle Header Bar ## Load Button ## - self.strings[StringType.Load] = { + self.strings[StringContent.Load] = { u'title': translate('PresentationPlugin', 'Load'), u'tooltip': translate('PresentationPlugin', 'Load a new Presentation') } ## Delete Button ## - self.strings[StringType.Delete] = { + self.strings[StringContent.Delete] = { u'title': translate('PresentationPlugin', 'Delete'), u'tooltip': translate('PresentationPlugin', 'Delete the selected Presentation') } ## Preview ## - self.strings[StringType.Preview] = { + self.strings[StringContent.Preview] = { u'title': translate('PresentationPlugin', 'Preview'), u'tooltip': translate('PresentationPlugin', 'Preview the selected Presentation') } ## Live Button ## - self.strings[StringType.Live] = { + self.strings[StringContent.Live] = { u'title': translate('PresentationPlugin', 'Live'), u'tooltip': translate('PresentationPlugin', 'Send the selected Presentation live') } ## Add to service Button ## - self.strings[StringType.Service] = { + self.strings[StringContent.Service] = { u'title': translate('PresentationPlugin', 'Service'), u'tooltip': translate('PresentationPlugin', 'Add the selected Presentation to the service') - } + } \ No newline at end of file diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index ad1f4aac5..123aa291d 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -32,12 +32,11 @@ class RemoteTab(SettingsTab): """ RemoteTab is the Remotes 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'RemoteTab') - self.tabTitleVisible = translate('RemotePlugin.RemoteTab', 'Remotes') self.remoteLayout = QtGui.QFormLayout(self) self.remoteLayout.setSpacing(8) self.remoteLayout.setMargin(8) diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index 586addaa3..4efed2c9d 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -26,7 +26,7 @@ import logging -from openlp.core.lib import Plugin, StringType, translate, build_icon +from openlp.core.lib import Plugin, StringContent, translate, build_icon from openlp.plugins.remotes.lib import RemoteTab, HttpServer log = logging.getLogger(__name__) @@ -65,8 +65,8 @@ class RemotesPlugin(Plugin): """ Create the settings Tab """ - media_item_string = self.getString(StringType.MediaItem) - return RemoteTab(media_item_string[u'title']) + visible_name = self.getString(StringContent.VisibleName) + return RemoteTab(self.name, visible_name[u'title']) def about(self): """ @@ -82,15 +82,12 @@ class RemotesPlugin(Plugin): """ Called to define all translatable texts of the plugin """ - self.name = u'Remotes' - self.name_lower = u'remotes' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('RemotePlugin', 'Remote'), u'plural': translate('RemotePlugin', 'Remotes') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('RemotePlugin', 'Remotes') - } + } \ No newline at end of file diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 274370065..39a53f1c6 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -32,12 +32,11 @@ class SongsTab(SettingsTab): """ SongsTab is the Songs 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'SongsTab') - self.tabTitleVisible = translate('SongsPlugin.SongsTab', 'Songs') self.SongsLayout = QtGui.QFormLayout(self) self.SongsLayout.setSpacing(8) self.SongsLayout.setMargin(8) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index e0b25ca67..89b6cca23 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, StringType, build_icon, translate +from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager from openlp.plugins.songs.lib import SongMediaItem, SongsTab from openlp.plugins.songs.lib.db import init_schema, Song @@ -57,8 +57,8 @@ class SongsPlugin(Plugin): self.icon = build_icon(self.icon_path) def getSettingsTab(self): - media_item_string = self.getString(StringType.MediaItem) - return SongsTab(media_item_string[u'title']) + visible_name = self.getString(StringContent.VisibleName) + return SongsTab(self.name, visible_name[u'title']) def initialise(self): log.info(u'Songs Initialising') @@ -153,46 +153,43 @@ class SongsPlugin(Plugin): """ Called to define all translatable texts of the plugin """ - self.name = u'Songs' - self.name_lower = u'songs' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('SongsPlugin', 'Song'), u'plural': translate('SongsPlugin', 'Songs') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('SongsPlugin', 'Songs') } # Middle Header Bar ## New Button ## - self.strings[StringType.New] = { + self.strings[StringContent.New] = { u'title': translate('SongsPlugin', 'Add'), u'tooltip': translate('SongsPlugin', 'Add a new Song') } ## Edit Button ## - self.strings[StringType.Edit] = { + self.strings[StringContent.Edit] = { u'title': translate('SongsPlugin', 'Edit'), u'tooltip': translate('SongsPlugin', 'Edit the selected Song') } ## Delete Button ## - self.strings[StringType.Delete] = { + self.strings[StringContent.Delete] = { u'title': translate('SongsPlugin', 'Delete'), u'tooltip': translate('SongsPlugin', 'Delete the selected Song') } ## Preview ## - self.strings[StringType.Preview] = { + self.strings[StringContent.Preview] = { u'title': translate('SongsPlugin', 'Preview'), u'tooltip': translate('SongsPlugin', 'Preview the selected Song') } ## Live Button ## - self.strings[StringType.Live] = { + self.strings[StringContent.Live] = { u'title': translate('SongsPlugin', 'Live'), u'tooltip': translate('SongsPlugin', 'Send the selected Song live') } ## Add to service Button ## - self.strings[StringType.Service] = { + self.strings[StringContent.Service] = { u'title': translate('SongsPlugin', 'Service'), u'tooltip': translate('SongsPlugin', 'Add the selected Song to the service') - } + } \ No newline at end of file diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 4422b1b95..e2ff2adae 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -29,7 +29,7 @@ from datetime import datetime from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, StringType, Receiver, build_icon, translate +from openlp.core.lib import Plugin, StringContent, Receiver, build_icon, translate from openlp.core.lib.db import Manager from openlp.plugins.songusage.forms import SongUsageDetailForm, \ SongUsageDeleteForm @@ -167,15 +167,12 @@ class SongUsagePlugin(Plugin): """ Called to define all translatable texts of the plugin """ - self.name = u'SongUsage' - self.name_lower = u'songusage' - self.strings = {} ## Name PluginList ## - self.strings[StringType.Name] = { + self.strings[StringContent.Name] = { u'singular': translate('SongUsagePlugin', 'SongUsage'), u'plural': translate('SongUsagePlugin', 'SongUsage') } ## Name for MediaDockManager, SettingsManager ## - self.strings[StringType.MediaItem] = { + self.strings[StringContent.VisibleName] = { u'title': translate('SongUsagePlugin', 'SongUsage') - } + } \ No newline at end of file