fix for the merge comments, add correct translations for settings window

This commit is contained in:
rimach 2010-09-16 23:10:36 +02:00
parent ad6294ffcc
commit 399813e6aa
24 changed files with 165 additions and 200 deletions

View File

@ -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):

View File

@ -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

View File

@ -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

View File

@ -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 = {}

View File

@ -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)

View File

@ -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()

View File

@ -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)

View File

@ -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'])

View File

@ -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')
}
}

View File

@ -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

View File

@ -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))

View File

@ -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')
}
}

View File

@ -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)

View File

@ -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', '<strong>Custom Plugin</strong>'
'<br />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')
}
}

View File

@ -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)

View File

@ -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')
}
}

View File

@ -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', '<strong>Media Plugin</strong>'
'<br />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')
}
}

View File

@ -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)

View File

@ -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')
}
}

View File

@ -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)

View File

@ -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')
}
}

View File

@ -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)

View File

@ -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')
}
}

View File

@ -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')
}
}