forked from openlp/openlp
Head
This commit is contained in:
commit
fe71058a47
@ -335,37 +335,39 @@ class Plugin(QtCore.QObject):
|
||||
"""
|
||||
return self.textStrings[name]
|
||||
|
||||
def setPluginTextStrings(self):
|
||||
def setPluginUiTextStrings(self, tooltips):
|
||||
"""
|
||||
Called to define all translatable texts of the plugin
|
||||
"""
|
||||
## Load Action ##
|
||||
self._setSingularTextString(StringContent.Load,
|
||||
UiStrings.Load, UiStrings.LoadANew)
|
||||
self.__setNameTextString(StringContent.Load,
|
||||
UiStrings.Load, tooltips[u'load'])
|
||||
## Import Action ##
|
||||
self.__setNameTextString(StringContent.Import,
|
||||
UiStrings.Import, tooltips[u'import'])
|
||||
## New Action ##
|
||||
self._setSingularTextString(StringContent.New,
|
||||
UiStrings.Add, UiStrings.AddANew)
|
||||
self.__setNameTextString(StringContent.New,
|
||||
UiStrings.Add, tooltips[u'new'])
|
||||
## Edit Action ##
|
||||
self._setSingularTextString(StringContent.Edit,
|
||||
UiStrings.Edit, UiStrings.EditSelect)
|
||||
self.__setNameTextString(StringContent.Edit,
|
||||
UiStrings.Edit, tooltips[u'edit'])
|
||||
## Delete Action ##
|
||||
self._setSingularTextString(StringContent.Delete,
|
||||
UiStrings.Delete, UiStrings.DeleteSelect)
|
||||
self.__setNameTextString(StringContent.Delete,
|
||||
UiStrings.Delete, tooltips[u'delete'])
|
||||
## Preview Action ##
|
||||
self._setSingularTextString(StringContent.Preview,
|
||||
UiStrings.Preview, UiStrings.PreviewSelect)
|
||||
self.__setNameTextString(StringContent.Preview,
|
||||
UiStrings.Preview, tooltips[u'preview'])
|
||||
## Send Live Action ##
|
||||
self._setSingularTextString(StringContent.Live,
|
||||
UiStrings.Live, UiStrings.SendSelectLive)
|
||||
self.__setNameTextString(StringContent.Live,
|
||||
UiStrings.Live, tooltips[u'live'])
|
||||
## Add to Service Action ##
|
||||
self._setSingularTextString(StringContent.Service,
|
||||
UiStrings.Service, UiStrings.AddSelectService)
|
||||
self.__setNameTextString(StringContent.Service,
|
||||
UiStrings.Service, tooltips[u'service'])
|
||||
|
||||
def _setSingularTextString(self, name, title, tooltip):
|
||||
def __setNameTextString(self, name, title, tooltip):
|
||||
"""
|
||||
Utility method for creating a plugin's textStrings. This method makes
|
||||
use of the singular name of the plugin object so must only be called
|
||||
after this has been set.
|
||||
"""
|
||||
self.textStrings[name] = { u'title': title, u'tooltip': tooltip %
|
||||
self.getString(StringContent.Name)[u'singular']}
|
||||
self.textStrings[name] = {u'title': title, u'tooltip': tooltip}
|
||||
|
@ -41,40 +41,27 @@ class UiStrings(object):
|
||||
# These strings should need a good reason to be retranslated elsewhere.
|
||||
# Should some/more/less of these have an & attached?
|
||||
Add = translate('OpenLP.Ui', '&Add')
|
||||
AddANew = unicode(translate('OpenLP.Ui', 'Add a new %s.'))
|
||||
AddSelectService = unicode(translate('OpenLP.Ui',
|
||||
'Add the selected %s to the service.'))
|
||||
Advanced = translate('OpenLP.Ui', 'Advanced')
|
||||
AllFiles = translate('OpenLP.Ui', 'All Files')
|
||||
Authors = translate('OpenLP.Ui', 'Authors')
|
||||
CreateANew = unicode(translate('OpenLP.Ui', 'Create a new %s.'))
|
||||
CreateService = translate('OpenLP.Ui', 'Create a new service.')
|
||||
Delete = translate('OpenLP.Ui', '&Delete')
|
||||
DeleteSelect = unicode(translate('OpenLP.Ui', 'Delete the selected %s.'))
|
||||
DeleteType = unicode(translate('OpenLP.Ui', 'Delete %s'))
|
||||
Edit = translate('OpenLP.Ui', '&Edit')
|
||||
EditSelect = unicode(translate('OpenLP.Ui', 'Edit the selected %s.'))
|
||||
EditType = unicode(translate('OpenLP.Ui', 'Edit %s'))
|
||||
Error = translate('OpenLP.Ui', 'Error')
|
||||
ExportType = unicode(translate('OpenLP.Ui', 'Export %s'))
|
||||
Import = translate('OpenLP.Ui', 'Import')
|
||||
ImportType = unicode(translate('OpenLP.Ui', 'Import %s'))
|
||||
LengthTime = unicode(translate('OpenLP.Ui', 'Length %s'))
|
||||
Live = translate('OpenLP.Ui', 'Live')
|
||||
Load = translate('OpenLP.Ui', 'Load')
|
||||
LoadANew = unicode(translate('OpenLP.Ui', 'Load a new %s.'))
|
||||
New = translate('OpenLP.Ui', 'New')
|
||||
NewType = unicode(translate('OpenLP.Ui', 'New %s'))
|
||||
NewService = translate('OpenLP.Ui', 'New Service')
|
||||
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
|
||||
OpenType = unicode(translate('OpenLP.Ui', 'Open %s'))
|
||||
OpenService = translate('OpenLP.Ui', 'Open Service')
|
||||
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.'))
|
||||
SaveService = translate('OpenLP.Ui', 'Save Service')
|
||||
Service = translate('OpenLP.Ui', 'Service')
|
||||
StartTimeCode = unicode(translate('OpenLP.Ui', 'Start %s'))
|
||||
Theme = translate('OpenLP.Ui', 'Theme')
|
||||
|
@ -319,17 +319,16 @@ class Ui_MainWindow(object):
|
||||
self.themeManagerDock.setWindowTitle(
|
||||
translate('OpenLP.MainWindow', 'Theme Manager'))
|
||||
self.FileNewItem.setText(translate('OpenLP.MainWindow', '&New'))
|
||||
self.FileNewItem.setToolTip(UiStrings.NewType % UiStrings.Service)
|
||||
self.FileNewItem.setStatusTip(
|
||||
UiStrings.CreateANew % UiStrings.Service.toLower())
|
||||
self.FileNewItem.setToolTip(UiStrings.NewService)
|
||||
self.FileNewItem.setStatusTip(UiStrings.CreateService)
|
||||
self.FileNewItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+N'))
|
||||
self.FileOpenItem.setText(translate('OpenLP.MainWindow', '&Open'))
|
||||
self.FileOpenItem.setToolTip(UiStrings.OpenType % UiStrings.Service)
|
||||
self.FileOpenItem.setToolTip(UiStrings.OpenService)
|
||||
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(UiStrings.SaveType % UiStrings.Service)
|
||||
self.FileSaveItem.setToolTip(UiStrings.SaveService)
|
||||
self.FileSaveItem.setStatusTip(
|
||||
translate('OpenLP.MainWindow', 'Save the current service to disk.'))
|
||||
self.FileSaveItem.setShortcut(translate('OpenLP.MainWindow', 'Ctrl+S'))
|
||||
|
@ -96,18 +96,14 @@ class ServiceManager(QtGui.QWidget):
|
||||
# Create the top toolbar
|
||||
self.toolbar = OpenLPToolbar(self)
|
||||
self.toolbar.addToolbarButton(
|
||||
UiStrings.NewType % UiStrings.Service,
|
||||
u':/general/general_new.png',
|
||||
UiStrings.CreateANew % UiStrings.Service.toLower(),
|
||||
self.onNewServiceClicked)
|
||||
UiStrings.NewService, u':/general/general_new.png',
|
||||
UiStrings.CreateService, self.onNewServiceClicked)
|
||||
self.toolbar.addToolbarButton(
|
||||
UiStrings.OpenType % UiStrings.Service,
|
||||
u':/general/general_open.png',
|
||||
UiStrings.OpenService, u':/general/general_open.png',
|
||||
translate('OpenLP.ServiceManager', 'Load an existing service'),
|
||||
self.onLoadServiceClicked)
|
||||
self.toolbar.addToolbarButton(
|
||||
UiStrings.SaveType % UiStrings.Service,
|
||||
u':/general/general_save.png',
|
||||
UiStrings.SaveService, u':/general/general_save.png',
|
||||
translate('OpenLP.ServiceManager', 'Save this service'),
|
||||
self.saveFile)
|
||||
self.toolbar.addSeparator()
|
||||
@ -469,7 +465,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
save the file.
|
||||
"""
|
||||
fileName = unicode(QtGui.QFileDialog.getSaveFileName(self.mainwindow,
|
||||
UiStrings.SaveType % UiStrings.Service,
|
||||
UiStrings.SaveService,
|
||||
SettingsManager.get_last_dir(
|
||||
self.mainwindow.serviceSettingsSection),
|
||||
translate('OpenLP.ServiceManager', 'OpenLP Service Files (*.osz)')))
|
||||
|
@ -483,7 +483,8 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
|
||||
Background Image button pushed.
|
||||
"""
|
||||
images_filter = get_images_filter()
|
||||
images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings.AllFiles)
|
||||
images_filter = u'%s;;%s (*.*) (*)' % (
|
||||
images_filter, UiStrings.AllFiles)
|
||||
filename = QtGui.QFileDialog.getOpenFileName(self,
|
||||
translate('OpenLP.ThemeForm', 'Select Image'), u'',
|
||||
images_filter)
|
||||
|
@ -63,28 +63,28 @@ class ThemeManager(QtGui.QWidget):
|
||||
self.layout.setObjectName(u'layout')
|
||||
self.toolbar = OpenLPToolbar(self)
|
||||
self.toolbar.addToolbarButton(
|
||||
UiStrings.NewType % UiStrings.Theme,
|
||||
translate('OpenLP.ThemeManager', 'New Theme'),
|
||||
u':/themes/theme_new.png',
|
||||
UiStrings.CreateANew % UiStrings.Theme.toLower(),
|
||||
translate('OpenLP.ThemeManager', 'Create a new theme.'),
|
||||
self.onAddTheme)
|
||||
self.toolbar.addToolbarButton(
|
||||
UiStrings.EditType % UiStrings.Theme,
|
||||
translate('OpenLP.ThemeManager', 'Edit Theme'),
|
||||
u':/themes/theme_edit.png',
|
||||
translate('OpenLP.ThemeManager', 'Edit a theme.'),
|
||||
self.onEditTheme)
|
||||
self.deleteToolbarAction = self.toolbar.addToolbarButton(
|
||||
UiStrings.DeleteType % UiStrings.Theme,
|
||||
translate('OpenLP.ThemeManager', 'Delete Theme'),
|
||||
u':/general/general_delete.png',
|
||||
translate('OpenLP.ThemeManager', 'Delete a theme.'),
|
||||
self.onDeleteTheme)
|
||||
self.toolbar.addSeparator()
|
||||
self.toolbar.addToolbarButton(
|
||||
UiStrings.ImportType % UiStrings.Theme,
|
||||
translate('OpenLP.ThemeManager', 'Import Theme'),
|
||||
u':/general/general_import.png',
|
||||
translate('OpenLP.ThemeManager', 'Import a theme.'),
|
||||
self.onImportTheme)
|
||||
self.toolbar.addToolbarButton(
|
||||
UiStrings.ExportType % UiStrings.Theme,
|
||||
translate('OpenLP.ThemeManager', 'Export Theme'),
|
||||
u':/general/general_export.png',
|
||||
translate('OpenLP.ThemeManager', 'Export a theme.'),
|
||||
self.onExportTheme)
|
||||
@ -406,8 +406,8 @@ class ThemeManager(QtGui.QWidget):
|
||||
files = QtGui.QFileDialog.getOpenFileNames(self,
|
||||
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
|
||||
SettingsManager.get_last_dir(self.settingsSection),
|
||||
translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;'
|
||||
'Theme v2 (*.otz);;%s (*.*)') % UiStrings.AllFiles)
|
||||
unicode(translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;'
|
||||
'Theme v2 (*.otz);;%s (*.*)')) % UiStrings.AllFiles)
|
||||
log.info(u'New Themes %s', unicode(files))
|
||||
if files:
|
||||
for file in files:
|
||||
|
@ -129,9 +129,15 @@ class BiblePlugin(Plugin):
|
||||
u'title': translate('BiblesPlugin', 'Bibles', 'container title')
|
||||
}
|
||||
# Middle Header Bar
|
||||
## Import Action ##
|
||||
self.textStrings[StringContent.Import] = {
|
||||
u'title': UiStrings.Import,
|
||||
u'tooltip': translate('BiblesPlugin', 'Import a Bible')
|
||||
tooltips = {
|
||||
u'load': u'',
|
||||
u'import': translate('BiblesPlugin', 'Import a Bible'),
|
||||
u'new': translate('BiblesPlugin', 'Add a new Bible'),
|
||||
u'edit': translate('BiblesPlugin', 'Edit the selected Bible'),
|
||||
u'delete': translate('BiblesPlugin', 'Delete the selected Bible'),
|
||||
u'preview': translate('BiblesPlugin', 'Preview the selected Bible'),
|
||||
u'live': translate('BiblesPlugin', 'Send the selected Bible live'),
|
||||
u'service': translate('BiblesPlugin',
|
||||
'Add the selected Bible to the service')
|
||||
}
|
||||
Plugin.setPluginTextStrings(self)
|
||||
self.setPluginUiTextStrings(tooltips)
|
||||
|
@ -106,13 +106,20 @@ class CustomPlugin(Plugin):
|
||||
u'title': translate('CustomsPlugin', 'Custom', 'container title')
|
||||
}
|
||||
# Middle Header Bar
|
||||
## Import Action ##
|
||||
self.textStrings[StringContent.Import] = {
|
||||
u'title': UiStrings.Import,
|
||||
u'tooltip': translate('CustomsPlugin',
|
||||
'Import a Custom')
|
||||
tooltips = {
|
||||
u'load': translate('CustomsPlugin', 'Load a new Custom'),
|
||||
u'import': translate('CustomsPlugin', 'Import a Custom'),
|
||||
u'new': translate('CustomsPlugin', 'Add a new Custom'),
|
||||
u'edit': translate('CustomsPlugin', 'Edit the selected Custom'),
|
||||
u'delete': translate('CustomsPlugin', 'Delete the selected Custom'),
|
||||
u'preview': translate('CustomsPlugin',
|
||||
'Preview the selected Custom'),
|
||||
u'live': translate('CustomsPlugin',
|
||||
'Send the selected Custom live'),
|
||||
u'service': translate('CustomsPlugin',
|
||||
'Add the selected Custom to the service')
|
||||
}
|
||||
Plugin.setPluginTextStrings(self)
|
||||
self.setPluginUiTextStrings(tooltips)
|
||||
|
||||
def finalise(self):
|
||||
"""
|
||||
|
@ -69,4 +69,15 @@ class ImagePlugin(Plugin):
|
||||
u'title': translate('ImagePlugin', 'Images', 'container title')
|
||||
}
|
||||
# Middle Header Bar
|
||||
Plugin.setPluginTextStrings(self)
|
||||
tooltips = {
|
||||
u'load': translate('ImagePlugin', 'Load a new Image'),
|
||||
u'import': u'',
|
||||
u'new': translate('ImagePlugin', 'Add a new Image'),
|
||||
u'edit': translate('ImagePlugin', 'Edit the selected Image'),
|
||||
u'delete': translate('ImagePlugin', 'Delete the selected Image'),
|
||||
u'preview': translate('ImagePlugin', 'Preview the selected Image'),
|
||||
u'live': translate('ImagePlugin', 'Send the selected Image live'),
|
||||
u'service': translate('ImagePlugin',
|
||||
'Add the selected Image to the service')
|
||||
}
|
||||
self.setPluginUiTextStrings(tooltips)
|
||||
|
@ -95,4 +95,15 @@ class MediaPlugin(Plugin):
|
||||
u'title': translate('MediaPlugin', 'Media', 'container title')
|
||||
}
|
||||
# Middle Header Bar
|
||||
Plugin.setPluginTextStrings(self)
|
||||
tooltips = {
|
||||
u'load': translate('MediaPlugin', 'Load a new Media'),
|
||||
u'import': u'',
|
||||
u'new': translate('MediaPlugin', 'Add a new Media'),
|
||||
u'edit': translate('MediaPlugin', 'Edit the selected Media'),
|
||||
u'delete': translate('MediaPlugin', 'Delete the selected Media'),
|
||||
u'preview': translate('MediaPlugin', 'Preview the selected Media'),
|
||||
u'live': translate('MediaPlugin', 'Send the selected Media live'),
|
||||
u'service': translate('MediaPlugin',
|
||||
'Add the selected Media to the service')
|
||||
}
|
||||
self.setPluginUiTextStrings(tooltips)
|
||||
|
@ -167,4 +167,18 @@ class PresentationPlugin(Plugin):
|
||||
'container title')
|
||||
}
|
||||
# Middle Header Bar
|
||||
Plugin.setPluginTextStrings(self)
|
||||
tooltips = {
|
||||
u'load': translate('PresentationPlugin', 'Load a new Presentation'),
|
||||
u'import': u'',
|
||||
u'new': u'',
|
||||
u'edit': u'',
|
||||
u'delete': translate('PresentationPlugin',
|
||||
'Delete the selected Presentation'),
|
||||
u'preview': translate('PresentationPlugin',
|
||||
'Preview the selected Presentation'),
|
||||
u'live': translate('PresentationPlugin',
|
||||
'Send the selected Presentation live'),
|
||||
u'service': translate('PresentationPlugin',
|
||||
'Add the selected Presentation to the service')
|
||||
}
|
||||
self.setPluginUiTextStrings(tooltips)
|
||||
|
@ -228,7 +228,18 @@ class SongsPlugin(Plugin):
|
||||
u'title': translate('SongsPlugin', 'Songs', 'container title')
|
||||
}
|
||||
# Middle Header Bar
|
||||
Plugin.setPluginTextStrings(self)
|
||||
tooltips = {
|
||||
u'load': u'',
|
||||
u'import': u'',
|
||||
u'new': translate('SongsPlugin', 'Add a new Song'),
|
||||
u'edit': translate('SongsPlugin', 'Edit the selected Song'),
|
||||
u'delete': translate('SongsPlugin', 'Delete the selected Song'),
|
||||
u'preview': translate('SongsPlugin', 'Preview the selected Song'),
|
||||
u'live': translate('SongsPlugin', 'Send the selected Song live'),
|
||||
u'service': translate('SongsPlugin',
|
||||
'Add the selected Song to the service')
|
||||
}
|
||||
self.setPluginUiTextStrings(tooltips)
|
||||
|
||||
def finalise(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user