From 3be909c5c06ac5864fdfba42b5e25b943d474c2e Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Tue, 1 Jun 2010 00:06:16 +0200 Subject: [PATCH 01/17] Replaced { self.trUtf8() } with { translate() } which is the new standar. I also imported the translate library on the following files. I did not remove any import sinse I do not know how this { self.trUtf8() } does work. --- openlp/core/ui/aboutform.py | 3 +- openlp/core/ui/amendthemeform.py | 12 +-- openlp/core/ui/displaytab.py | 28 +++---- openlp/core/ui/generaltab.py | 36 ++++----- openlp/core/ui/mainwindow.py | 12 +-- openlp/core/ui/servicemanager.py | 78 +++++++++---------- openlp/core/ui/slidecontroller.py | 54 ++++++------- openlp/core/ui/splashscreen.py | 2 +- openlp/core/ui/thememanager.py | 65 ++++++++-------- openlp/core/ui/themestab.py | 20 ++--- openlp/plugins/alerts/alertsplugin.py | 8 +- openlp/plugins/alerts/forms/alertform.py | 5 +- openlp/plugins/alerts/lib/alertsmanager.py | 4 +- openlp/plugins/alerts/lib/alertstab.py | 30 +++---- openlp/plugins/bibles/bibleplugin.py | 4 +- .../plugins/bibles/forms/importwizardform.py | 46 +++++------ openlp/plugins/bibles/lib/biblestab.py | 32 ++++---- openlp/plugins/bibles/lib/mediaitem.py | 60 +++++++------- openlp/plugins/bibles/lib/opensong.py | 4 +- openlp/plugins/custom/customplugin.py | 4 +- openlp/plugins/custom/forms/editcustomform.py | 14 ++-- openlp/plugins/custom/lib/customtab.py | 8 +- openlp/plugins/custom/lib/mediaitem.py | 4 +- openlp/plugins/images/imageplugin.py | 4 +- openlp/plugins/images/lib/imagetab.py | 10 +-- openlp/plugins/images/lib/mediaitem.py | 18 ++--- openlp/plugins/media/lib/mediaitem.py | 18 ++--- openlp/plugins/media/mediaplugin.py | 4 +- openlp/plugins/presentations/lib/mediaitem.py | 14 ++-- .../presentations/lib/presentationtab.py | 8 +- .../presentations/presentationplugin.py | 4 +- openlp/plugins/remotes/lib/remotetab.py | 6 +- openlp/plugins/remotes/remoteplugin.py | 4 +- openlp/plugins/songs/forms/authorsform.py | 13 ++-- openlp/plugins/songs/forms/editsongform.py | 22 +++--- openlp/plugins/songs/forms/songbookform.py | 5 +- openlp/plugins/songs/forms/songimportform.py | 24 +++--- .../plugins/songs/forms/songimportwizard.py | 46 +++++------ .../songs/forms/songmaintenanceform.py | 49 ++++++------ openlp/plugins/songs/forms/topicsform.py | 5 +- openlp/plugins/songs/lib/mediaitem.py | 32 ++++---- openlp/plugins/songs/lib/songstab.py | 10 +-- openlp/plugins/songs/songsplugin.py | 8 +- .../songusage/forms/songusagedeleteform.py | 5 +- .../songusage/forms/songusagedetailform.py | 4 +- openlp/plugins/songusage/songusageplugin.py | 4 +- 46 files changed, 430 insertions(+), 420 deletions(-) diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index c79324515..97e286820 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -26,6 +26,7 @@ from PyQt4 import QtCore, QtGui from aboutdialog import Ui_AboutDialog +from openlp.core.lib import translate class AboutForm(QtGui.QDialog, Ui_AboutDialog): """ @@ -43,7 +44,7 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): about_text = about_text.replace(u'', self.applicationVersion[u'version']) if self.applicationVersion[u'build']: - build_text = u' %s %s' % (self.trUtf8('build'), + build_text = u' %s %s' % (translate('AboutForm','build'), self.applicationVersion[u'build']) else: build_text = u'' diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index fab72c312..fb21fb36b 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -29,7 +29,7 @@ import os.path from PyQt4 import QtCore, QtGui -from openlp.core.lib import ThemeXML +from openlp.core.lib import ThemeXML, translate from amendthemedialog import Ui_AmendThemeDialog log = logging.getLogger(u'AmendThemeForm') @@ -210,7 +210,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def onImageToolButtonClicked(self): filename = QtGui.QFileDialog.getOpenFileName( - self, self.trUtf8(u'Open file')) + self, translate('AmendThemeForm',u'Open file')) if filename: self.ImageLineEdit.setText(filename) self.theme.background_filename = filename @@ -629,7 +629,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): if theme.background_type == u'solid': self.Color1PushButton.setStyleSheet( u'background-color: %s' % unicode(theme.background_color)) - self.Color1Label.setText(self.trUtf8('Background Color:')) + self.Color1Label.setText(translate('AmendThemeForm','Background Color:')) self.Color1Label.setVisible(True) self.Color1PushButton.setVisible(True) self.Color2Label.setVisible(False) @@ -644,8 +644,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): % unicode(theme.background_startColor)) self.Color2PushButton.setStyleSheet(u'background-color: %s' \ % unicode(theme.background_endColor)) - self.Color1Label.setText(self.trUtf8('First Color:')) - self.Color2Label.setText(self.trUtf8('Second Color:')) + self.Color1Label.setText(translate('AmendThemeForm','First Color:')) + self.Color2Label.setText(translate('AmendThemeForm','Second Color:')) self.Color1Label.setVisible(True) self.Color1PushButton.setVisible(True) self.Color2Label.setVisible(True) @@ -713,7 +713,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): log.debug(u'Page Length area height %s, metrics %s, lines %s' % (self.FontMainHeightSpinBox.value(), metrics.height(), page_length)) - page_length_text = unicode(self.trUtf8('Slide Height is %s rows')) + page_length_text = unicode(translate('AmendThemeForm','Slide Height is %s rows')) self.FontMainLinesPageLabel.setText(page_length_text % page_length) frame = self.thememanager.generateImage(self.theme) self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) diff --git a/openlp/core/ui/displaytab.py b/openlp/core/ui/displaytab.py index 65a5b8044..026007d2b 100644 --- a/openlp/core/ui/displaytab.py +++ b/openlp/core/ui/displaytab.py @@ -25,7 +25,7 @@ from PyQt4 import QtGui, QtCore -from openlp.core.lib import SettingsTab, Receiver +from openlp.core.lib import SettingsTab, Receiver, translate class DisplayTab(SettingsTab): """ @@ -39,7 +39,7 @@ class DisplayTab(SettingsTab): SettingsTab.__init__(self, u'Display') def setupUi(self): - self.tabTitleVisible = self.trUtf8('Displays') + self.tabTitleVisible = translate('DisplayTab','Displays') self.layoutWidget = QtGui.QWidget(self) self.layoutWidget.setGeometry(QtCore.QRect(0, 40, 241, 79)) self.layoutWidget.setObjectName(u'layoutWidget') @@ -159,22 +159,22 @@ class DisplayTab(SettingsTab): self.onOverrideCheckBoxChanged) def retranslateUi(self): - self.setWindowTitle( self.trUtf8(u'Amend Display Settings')) - self.CurrentGroupBox.setTitle( self.trUtf8(u'Default Settings')) - self.XLabel.setText(self.trUtf8(u'X')) + self.setWindowTitle( translate('DisplayTab',u'Amend Display Settings')) + self.CurrentGroupBox.setTitle( translate('DisplayTab',u'Default Settings')) + self.XLabel.setText(translate('DisplayTab',u'X')) self.Xpos.setText(u'0') - self.YLabel.setText( self.trUtf8(u'Y')) + self.YLabel.setText( translate('DisplayTab',u'Y')) self.Ypos.setText(u'0') - self.HeightLabel.setText( self.trUtf8(u'Height')) + self.HeightLabel.setText( translate('DisplayTab',u'Height')) self.Height.setText(u'0') - self.WidthLabel.setText( self.trUtf8(u'Width')) + self.WidthLabel.setText( translate('DisplayTab',u'Width')) self.Width.setText(u'0') - self.CurrentGroupBox_2.setTitle( self.trUtf8(u'Amend Settings')) - self.XAmendLabel.setText( self.trUtf8(u'X')) - self.YAmendLabel.setText( self.trUtf8(u'Y')) - self.HeightAmendLabel.setText( self.trUtf8(u'Height')) - self.WidthAmendLabel.setText( self.trUtf8(u'Width')) - self.OverrideCheckBox.setText( self.trUtf8(u'Override Output Display')) + self.CurrentGroupBox_2.setTitle( translate('DisplayTab',u'Amend Settings')) + self.XAmendLabel.setText( translate('DisplayTab',u'X')) + self.YAmendLabel.setText( translate('DisplayTab',u'Y')) + self.HeightAmendLabel.setText( translate('DisplayTab',u'Height')) + self.WidthAmendLabel.setText( translate('DisplayTab',u'Width')) + self.OverrideCheckBox.setText( translate('DisplayTab',u'Override Output Display')) def load(self): settings = QtCore.QSettings() diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index f55d81a70..2856b6558 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, Receiver +from openlp.core.lib import SettingsTab, Receiver, translate class GeneralTab(SettingsTab): """ @@ -54,7 +54,7 @@ class GeneralTab(SettingsTab): def setupUi(self): self.setObjectName(u'GeneralTab') - self.tabTitleVisible = self.trUtf8('General') + self.tabTitleVisible = translate('GeneralTab','General') self.GeneralLayout = QtGui.QHBoxLayout(self) self.GeneralLayout.setSpacing(8) self.GeneralLayout.setMargin(8) @@ -177,25 +177,25 @@ class GeneralTab(SettingsTab): QtCore.SIGNAL(u'editingFinished()'), self.onPasswordEditLostFocus) def retranslateUi(self): - self.MonitorGroupBox.setTitle(self.trUtf8('Monitors')) + self.MonitorGroupBox.setTitle(translate('GeneralTab','Monitors')) self.MonitorLabel.setText( - self.trUtf8('Select monitor for output display:')) + translate('GeneralTab','Select monitor for output display:')) self.DisplayOnMonitorCheck.setText( - self.trUtf8('Display if a single screen')) - self.StartupGroupBox.setTitle(self.trUtf8('Application Startup')) - self.WarningCheckBox.setText(self.trUtf8('Show blank screen warning')) + translate('GeneralTab','Display if a single screen')) + self.StartupGroupBox.setTitle(translate('GeneralTab','Application Startup')) + self.WarningCheckBox.setText(translate('GeneralTab','Show blank screen warning')) self.AutoOpenCheckBox.setText( - self.trUtf8('Automatically open the last service')) - self.ShowSplashCheckBox.setText(self.trUtf8('Show the splash screen')) - self.SettingsGroupBox.setTitle(self.trUtf8('Application Settings')) + translate('GeneralTab','Automatically open the last service')) + self.ShowSplashCheckBox.setText(translate('GeneralTab','Show the splash screen')) + self.SettingsGroupBox.setTitle(translate('GeneralTab','Application Settings')) self.SaveCheckServiceCheckBox.setText( - self.trUtf8('Prompt to save Service before starting New')) + translate('GeneralTab','Prompt to save Service before starting New')) self.AutoPreviewCheckBox.setText( - self.trUtf8('Preview Next Song from Service Manager')) - self.CCLIGroupBox.setTitle(self.trUtf8('CCLI Details')) - self.NumberLabel.setText(self.trUtf8('CCLI Number:')) - self.UsernameLabel.setText(self.trUtf8('SongSelect Username:')) - self.PasswordLabel.setText(self.trUtf8('SongSelect Password:')) + translate('GeneralTab','Preview Next Song from Service Manager')) + self.CCLIGroupBox.setTitle(translate('GeneralTab','CCLI Details')) + self.NumberLabel.setText(translate('GeneralTab','CCLI Number:')) + self.UsernameLabel.setText(translate('GeneralTab','SongSelect Username:')) + self.PasswordLabel.setText(translate('GeneralTab','SongSelect Password:')) def onMonitorComboBoxChanged(self): self.MonitorNumber = self.MonitorComboBox.currentIndex() @@ -231,10 +231,10 @@ class GeneralTab(SettingsTab): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) for screen in self.screens.screen_list: - screen_name = u'%s %d' % (self.trUtf8('Screen'), + screen_name = u'%s %d' % (translate('GeneralTab','Screen'), screen[u'number'] + 1) if screen[u'primary']: - screen_name = u'%s (%s)' % (screen_name, self.trUtf8('primary')) + screen_name = u'%s (%s)' % (screen_name, translate('GeneralTab','primary')) self.MonitorComboBox.addItem(screen_name) # Get the configs self.Warning = settings.value( diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4dc75ea92..716bfbabb 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -616,11 +616,11 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): Triggered by delay thread. """ app_version = self.applicationVersion[u'full'] - version_text = unicode(self.trUtf8('Version %s of OpenLP is now ' + version_text = unicode(translate('MainWindow','Version %s of OpenLP is now ' 'available for download (you are currently running version %s).' '\n\nYou can download the latest version from http://openlp.org')) QtGui.QMessageBox.question(self, - self.trUtf8('OpenLP Version Updated'), + translate('MainWindow','OpenLP Version Updated'), version_text % (version, app_version), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) @@ -651,8 +651,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): and settings.value(u'blank warning', QtCore.QVariant(False)).toBool(): self.LiveController.onBlankDisplay(True) QtGui.QMessageBox.question(self, - self.trUtf8('OpenLP Main Display Blanked'), - self.trUtf8('The Main Display has been blanked out'), + translate('MainWindow','OpenLP Main Display Blanked'), + translate('MainWindow','The Main Display has been blanked out'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) settings.endGroup() @@ -707,8 +707,8 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): """ if self.serviceNotSaved: ret = QtGui.QMessageBox.question(self, - self.trUtf8('Save Changes to Service?'), - self.trUtf8('Your service has changed. ' + translate('MainWindow','Save Changes to Service?'), + translate('MainWindow','Your service has changed. ' 'Do you want to save those changes?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Cancel | diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 548d04357..c4f55c28f 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -33,7 +33,7 @@ log = logging.getLogger(__name__) from PyQt4 import QtCore, QtGui from openlp.core.lib import OpenLPToolbar, ServiceItem, contextMenuAction, \ - Receiver, build_icon, ItemCapabilities, SettingsManager + Receiver, build_icon, ItemCapabilities, SettingsManager, translate from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm from openlp.core.utils import AppLocation @@ -114,21 +114,21 @@ class ServiceManager(QtGui.QWidget): # Create the top toolbar self.Toolbar = OpenLPToolbar(self) self.Toolbar.addToolbarButton( - self.trUtf8('New Service'), u':/general/general_new.png', - self.trUtf8('Create a new service'), self.onNewService) + translate('ServiceManager','New Service'), u':/general/general_new.png', + translate('ServiceManager','Create a new service'), self.onNewService) self.Toolbar.addToolbarButton( - self.trUtf8('Open Service'), u':/general/general_open.png', - self.trUtf8('Load an existing service'), self.onLoadService) + translate('ServiceManager','Open Service'), u':/general/general_open.png', + translate('ServiceManager','Load an existing service'), self.onLoadService) self.Toolbar.addToolbarButton( - self.trUtf8('Save Service'), u':/general/general_save.png', - self.trUtf8('Save this service'), self.onSaveService) + translate('ServiceManager','Save Service'), u':/general/general_save.png', + translate('ServiceManager','Save this service'), self.onSaveService) self.Toolbar.addSeparator() - self.ThemeLabel = QtGui.QLabel(self.trUtf8('Theme:'), + self.ThemeLabel = QtGui.QLabel(translate('ServiceManager','Theme:'), self) self.ThemeLabel.setMargin(3) self.Toolbar.addWidget(self.ThemeLabel) self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) - self.ThemeComboBox.setToolTip(self.trUtf8( + self.ThemeComboBox.setToolTip(translate('ServiceManager', u'Select a theme for the service')) self.ThemeComboBox.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToContents) @@ -159,21 +159,21 @@ class ServiceManager(QtGui.QWidget): # Add the bottom toolbar self.OrderToolbar = OpenLPToolbar(self) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move to &top'), u':/services/service_top.png', - self.trUtf8('Move to top'), self.onServiceTop) + translate('ServiceManager','Move to &top'), u':/services/service_top.png', + translate('ServiceManager','Move to top'), self.onServiceTop) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move &up'), u':/services/service_up.png', - self.trUtf8('Move up order'), self.onServiceUp) + translate('ServiceManager','Move &up'), u':/services/service_up.png', + translate('ServiceManager','Move up order'), self.onServiceUp) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move &down'), u':/services/service_down.png', - self.trUtf8('Move down order'), self.onServiceDown) + translate('ServiceManager','Move &down'), u':/services/service_down.png', + translate('ServiceManager','Move down order'), self.onServiceDown) self.OrderToolbar.addToolbarButton( - self.trUtf8('Move to &bottom'), u':/services/service_bottom.png', - self.trUtf8('Move to end'), self.onServiceEnd) + translate('ServiceManager','Move to &bottom'), u':/services/service_bottom.png', + translate('ServiceManager','Move to end'), self.onServiceEnd) self.OrderToolbar.addSeparator() self.OrderToolbar.addToolbarButton( - self.trUtf8('&Delete From Service'), u':/general/general_delete.png', - self.trUtf8('Delete From Service'), self.onDeleteFromService) + translate('ServiceManager','&Delete From Service'), u':/general/general_delete.png', + translate('ServiceManager','Delete From Service'), self.onDeleteFromService) self.Layout.addWidget(self.OrderToolbar) # Connect up our signals and slots QtCore.QObject.connect(self.ThemeComboBox, @@ -203,30 +203,30 @@ class ServiceManager(QtGui.QWidget): self.servicePath = AppLocation.get_section_data_path(u'servicemanager') #build the drag and drop context menu self.dndMenu = QtGui.QMenu() - self.newAction = self.dndMenu.addAction(self.trUtf8('&Add New Item')) + self.newAction = self.dndMenu.addAction(translate('ServiceManager','&Add New Item')) self.newAction.setIcon(build_icon(u':/general/general_edit.png')) - self.addToAction = self.dndMenu.addAction(self.trUtf8('&Add to Selected Item')) + self.addToAction = self.dndMenu.addAction(translate('ServiceManager','&Add to Selected Item')) self.addToAction.setIcon(build_icon(u':/general/general_edit.png')) #build the context menu self.menu = QtGui.QMenu() - self.editAction = self.menu.addAction(self.trUtf8('&Edit Item')) + self.editAction = self.menu.addAction(translate('ServiceManager','&Edit Item')) self.editAction.setIcon(build_icon(u':/general/general_edit.png')) - self.maintainAction = self.menu.addAction(self.trUtf8('&Maintain Item')) + self.maintainAction = self.menu.addAction(translate('ServiceManager','&Maintain Item')) self.maintainAction.setIcon(build_icon(u':/general/general_edit.png')) - self.notesAction = self.menu.addAction(self.trUtf8('&Notes')) + self.notesAction = self.menu.addAction(translate('ServiceManager','&Notes')) self.notesAction.setIcon(build_icon(u':/services/service_notes.png')) self.deleteAction = self.menu.addAction( - self.trUtf8('&Delete From Service')) + translate('ServiceManager','&Delete From Service')) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.sep1 = self.menu.addAction(u'') self.sep1.setSeparator(True) - self.previewAction = self.menu.addAction(self.trUtf8('&Preview Verse')) + self.previewAction = self.menu.addAction(translate('ServiceManager','&Preview Verse')) self.previewAction.setIcon(build_icon(u':/general/general_preview.png')) - self.liveAction = self.menu.addAction(self.trUtf8('&Live Verse')) + self.liveAction = self.menu.addAction(translate('ServiceManager','&Live Verse')) self.liveAction.setIcon(build_icon(u':/general/general_live.png')) self.sep2 = self.menu.addAction(u'') self.sep2.setSeparator(True) - self.themeMenu = QtGui.QMenu(self.trUtf8(u'&Change Item Theme')) + self.themeMenu = QtGui.QMenu(translate('ServiceManager',u'&Change Item Theme')) self.menu.addMenu(self.themeMenu) def supportedSuffixes(self, suffix): @@ -458,8 +458,8 @@ class ServiceManager(QtGui.QWidget): self.parent.generalSettingsSection + u'/save prompt', QtCore.QVariant(False)).toBool(): ret = QtGui.QMessageBox.question(self, - self.trUtf8('Save Changes to Service?'), - self.trUtf8('Your service is unsaved, do you want to save ' + translate('ServiceManager','Save Changes to Service?'), + translate('ServiceManager','Your service is unsaved, do you want to save ' 'those changes before creating a new one?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Cancel | @@ -542,9 +542,9 @@ class ServiceManager(QtGui.QWidget): log.debug(u'onSaveService') if not quick or self.isNew: filename = QtGui.QFileDialog.getSaveFileName(self, - self.trUtf8(u'Save Service'), + translate('ServiceManager',u'Save Service'), SettingsManager.get_last_dir(self.parent.serviceSettingsSection), - self.trUtf8(u'OpenLP Service Files (*.osz)')) + translate('ServiceManager',u'OpenLP Service Files (*.osz)')) else: filename = SettingsManager.get_last_dir( self.parent.serviceSettingsSection) @@ -601,7 +601,7 @@ class ServiceManager(QtGui.QWidget): self.parent.serviceSettingsSection) else: filename = QtGui.QFileDialog.getOpenFileName( - self, self.trUtf8('Open Service'), + self, translate('ServiceManager','Open Service'), SettingsManager.get_last_dir( self.parent.serviceSettingsSection), u'Services (*.osz)') self.loadService(filename) @@ -614,8 +614,8 @@ class ServiceManager(QtGui.QWidget): """ if self.parent.serviceNotSaved: ret = QtGui.QMessageBox.question(self, - self.trUtf8('Save Changes to Service?'), - self.trUtf8('Your current service is unsaved, do you want to ' + translate('ServiceManager','Save Changes to Service?'), + translate('ServiceManager','Your current service is unsaved, do you want to ' 'save the changes before opening a new one?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Discard | @@ -778,8 +778,8 @@ class ServiceManager(QtGui.QWidget): self.serviceItems[item][u'service_item'], count) else: QtGui.QMessageBox.critical(self, - self.trUtf8('Missing Display Handler'), - self.trUtf8('Your item cannot be displayed as ' + translate('ServiceManager','Missing Display Handler'), + translate('ServiceManager','Your item cannot be displayed as ' 'there is no handler to display it'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Ok), @@ -814,8 +814,8 @@ class ServiceManager(QtGui.QWidget): self.serviceItems[item][u'service_item'], 0) else: QtGui.QMessageBox.critical(self, - self.trUtf8('Missing Display Handler'), - self.trUtf8('Your item cannot be displayed as ' + translate('ServiceManager','Missing Display Handler'), + translate('ServiceManager','Your item cannot be displayed as ' 'there is no handler to display it'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Ok), diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index f9dd89daf..581b23338 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon from openlp.core.ui import HideMode from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \ -ItemCapabilities +ItemCapabilities, translate log = logging.getLogger(__name__) @@ -127,11 +127,11 @@ class SlideController(QtGui.QWidget): # Type label for the top of the slide controller self.TypeLabel = QtGui.QLabel(self.Panel) if self.isLive: - self.TypeLabel.setText(self.trUtf8('Live')) + self.TypeLabel.setText(translate('SlideController','Live')) self.split = 1 self.typePrefix = u'live' else: - self.TypeLabel.setText(self.trUtf8('Preview')) + self.TypeLabel.setText(translate('SlideController','Preview')) self.split = 0 self.typePrefix = u'preview' self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') @@ -178,75 +178,75 @@ class SlideController(QtGui.QWidget): if self.isLive: self.Toolbar.addToolbarButton( u'First Slide', u':/slides/slide_first.png', - self.trUtf8('Move to first'), self.onSlideSelectedFirst) + translate('SlideController','Move to first'), self.onSlideSelectedFirst) self.Toolbar.addToolbarButton( u'Previous Slide', u':/slides/slide_previous.png', - self.trUtf8('Move to previous'), self.onSlideSelectedPrevious) + translate('SlideController','Move to previous'), self.onSlideSelectedPrevious) self.Toolbar.addToolbarButton( u'Next Slide', u':/slides/slide_next.png', - self.trUtf8('Move to next'), self.onSlideSelectedNext) + translate('SlideController','Move to next'), self.onSlideSelectedNext) if self.isLive: self.Toolbar.addToolbarButton( u'Last Slide', u':/slides/slide_last.png', - self.trUtf8('Move to last'), self.onSlideSelectedLast) + translate('SlideController','Move to last'), self.onSlideSelectedLast) if self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.blankButton = self.Toolbar.addToolbarButton( u'Blank Screen', u':/slides/slide_blank.png', - self.trUtf8('Blank Screen'), self.onBlankDisplay, True) + translate('SlideController','Blank Screen'), self.onBlankDisplay, True) self.themeButton = self.Toolbar.addToolbarButton( u'Display Theme', u':/slides/slide_theme.png', - self.trUtf8('Theme Screen'), self.onThemeDisplay, True) + translate('SlideController','Theme Screen'), self.onThemeDisplay, True) self.hideButton = self.Toolbar.addToolbarButton( u'Hide screen', u':/slides/slide_desktop.png', - self.trUtf8('Hide Screen'), self.onHideDisplay, True) + translate('SlideController','Hide Screen'), self.onHideDisplay, True) if not self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( u'Go Live', u':/general/general_live.png', - self.trUtf8('Move to live'), self.onGoLive) + translate('SlideController','Move to live'), self.onGoLive) self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( u'Edit Song', u':/general/general_edit.png', - self.trUtf8('Edit and re-preview Song'), self.onEditSong) + translate('SlideController','Edit and re-preview Song'), self.onEditSong) if isLive: self.Toolbar.addToolbarSeparator(u'Loop Separator') self.Toolbar.addToolbarButton( u'Start Loop', u':/media/media_time.png', - self.trUtf8('Start continuous loop'), self.onStartLoop) + translate('SlideController','Start continuous loop'), self.onStartLoop) self.Toolbar.addToolbarButton( u'Stop Loop', u':/media/media_stop.png', - self.trUtf8('Stop continuous loop'), self.onStopLoop) + translate('SlideController','Stop continuous loop'), self.onStopLoop) self.DelaySpinBox = QtGui.QSpinBox() self.DelaySpinBox.setMinimum(1) self.DelaySpinBox.setMaximum(180) self.Toolbar.addToolbarWidget( u'Image SpinBox', self.DelaySpinBox) - self.DelaySpinBox.setSuffix(self.trUtf8('s')) + self.DelaySpinBox.setSuffix(translate('SlideController','s')) self.DelaySpinBox.setToolTip( - self.trUtf8('Delay between slides in seconds')) + translate('SlideController','Delay between slides in seconds')) self.ControllerLayout.addWidget(self.Toolbar) #Build a Media ToolBar self.Mediabar = OpenLPToolbar(self) self.Mediabar.addToolbarButton( u'Media Start', u':/slides/media_playback_start.png', - self.trUtf8('Start playing media'), self.onMediaPlay) + translate('SlideController','Start playing media'), self.onMediaPlay) self.Mediabar.addToolbarButton( u'Media Pause', u':/slides/media_playback_pause.png', - self.trUtf8('Start playing media'), self.onMediaPause) + translate('SlideController','Start playing media'), self.onMediaPause) self.Mediabar.addToolbarButton( u'Media Stop', u':/slides/media_playback_stop.png', - self.trUtf8('Start playing media'), self.onMediaStop) + translate('SlideController','Start playing media'), self.onMediaStop) if self.isLive: self.blankButton = self.Mediabar.addToolbarButton( u'Blank Screen', u':/slides/slide_blank.png', - self.trUtf8('Blank Screen'), self.onBlankDisplay, True) + translate('SlideController','Blank Screen'), self.onBlankDisplay, True) self.themeButton = self.Mediabar.addToolbarButton( u'Display Theme', u':/slides/slide_theme.png', - self.trUtf8('Theme Screen'), self.onThemeDisplay, True) + translate('SlideController','Theme Screen'), self.onThemeDisplay, True) self.hideButton = self.Mediabar.addToolbarButton( u'Hide screen', u':/slides/slide_desktop.png', - self.trUtf8('Hide Screen'), self.onHideDisplay, True) + translate('SlideController','Hide Screen'), self.onHideDisplay, True) if not self.isLive: self.seekSlider = Phonon.SeekSlider() self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24)) @@ -262,10 +262,10 @@ class SlideController(QtGui.QWidget): # Build the Song Toolbar if isLive: self.SongMenu = QtGui.QToolButton(self.Toolbar) - self.SongMenu.setText(self.trUtf8('Go to Verse')) + self.SongMenu.setText(translate('SlideController','Go to Verse')) self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup) self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu) - self.SongMenu.setMenu(QtGui.QMenu(self.trUtf8('Go to Verse'), + self.SongMenu.setMenu(QtGui.QMenu(translate('SlideController','Go to Verse'), self.Toolbar)) self.Toolbar.makeWidgetsInvisible([u'Song Menu']) # Screen preview area @@ -539,8 +539,8 @@ class SlideController(QtGui.QWidget): bits = frame[u'verseTag'].split(u':') tag = None #If verse handle verse number else tag only - if bits[0] == self.trUtf8('Verse') or \ - bits[0] == self.trUtf8('Chorus'): + if bits[0] == translate('SlideController','Verse') or \ + bits[0] == translate('SlideController','Chorus'): tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) row = tag @@ -553,7 +553,7 @@ class SlideController(QtGui.QWidget): if self.isLive and frame[u'verseTag'] is not None: if tag1 not in self.slideList: self.slideList[tag1] = framenumber - self.SongMenu.menu().addAction(self.trUtf8(u'%s'%tag1), + self.SongMenu.menu().addAction(translate('SlideController',u'%s'%tag1), self.onSongBarHandler) item.setText(frame[u'text']) else: diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index 10cea5a11..f87bb84f6 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.py @@ -24,7 +24,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon +from openlp.core.lib import build_icon, translate class SplashScreen(object): def __init__(self, version): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index d908311b3..bbfbfa54f 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -30,6 +30,7 @@ import logging from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtCore, QtGui +from openlp.core.lib import translate from openlp.core.ui import AmendThemeForm from openlp.core.theme import Theme @@ -54,21 +55,21 @@ class ThemeManager(QtGui.QWidget): self.amendThemeForm = AmendThemeForm(self) self.Toolbar = OpenLPToolbar(self) self.Toolbar.addToolbarButton( - self.trUtf8('New Theme'), u':/themes/theme_new.png', - self.trUtf8('Create a new theme'), self.onAddTheme) + translate('ThemeManager','New Theme'), u':/themes/theme_new.png', + translate('ThemeManager','Create a new theme'), self.onAddTheme) self.Toolbar.addToolbarButton( - self.trUtf8('Edit Theme'), u':/themes/theme_edit.png', - self.trUtf8('Edit a theme'), self.onEditTheme) + translate('ThemeManager','Edit Theme'), u':/themes/theme_edit.png', + translate('ThemeManager','Edit a theme'), self.onEditTheme) self.Toolbar.addToolbarButton( - self.trUtf8('Delete Theme'), u':/general/general_delete.png', - self.trUtf8('Delete a theme'), self.onDeleteTheme) + translate('ThemeManager','Delete Theme'), u':/general/general_delete.png', + translate('ThemeManager','Delete a theme'), self.onDeleteTheme) self.Toolbar.addSeparator() self.Toolbar.addToolbarButton( - self.trUtf8('Import Theme'), u':/general/general_import.png', - self.trUtf8('Import a theme'), self.onImportTheme) + translate('ThemeManager','Import Theme'), u':/general/general_import.png', + translate('ThemeManager','Import a theme'), self.onImportTheme) self.Toolbar.addToolbarButton( - self.trUtf8('Export Theme'), u':/general/general_export.png', - self.trUtf8('Export a theme'), self.onExportTheme) + translate('ThemeManager','Export Theme'), u':/general/general_export.png', + translate('ThemeManager','Export a theme'), self.onExportTheme) self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) self.Layout.addWidget(self.Toolbar) self.ThemeListWidget = QtGui.QListWidget(self) @@ -78,23 +79,23 @@ class ThemeManager(QtGui.QWidget): self.ThemeListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/themes/theme_edit.png', - self.trUtf8('Edit a theme'), self.onEditTheme)) + translate('ThemeManager','Edit a theme'), self.onEditTheme)) self.ThemeListWidget.addAction( contextMenuSeparator(self.ThemeListWidget)) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/general/general_delete.png', - self.trUtf8('Delete theme'), + translate('ThemeManager','Delete theme'), self.onDeleteTheme)) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/general/general_export.png', - self.trUtf8('Make Global'), + translate('ThemeManager','Make Global'), self.changeGlobalFromScreen)) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/general/general_export.png', - self.trUtf8('Export theme'), + translate('ThemeManager','Export theme'), self.onExportTheme)) self.ThemeListWidget.addAction( contextMenuSeparator(self.ThemeListWidget)) @@ -127,7 +128,7 @@ class ThemeManager(QtGui.QWidget): self.ThemeListWidget.item(count).setText(newName) #Set the new name if themeName == newName: - name = u'%s (%s)' % (newName, self.trUtf8('default')) + name = u'%s (%s)' % (newName, translate('ThemeManager','default')) self.ThemeListWidget.item(count).setText(name) def changeGlobalFromScreen(self, index = -1): @@ -144,7 +145,7 @@ class ThemeManager(QtGui.QWidget): if count == selected_row: self.global_theme = unicode( self.ThemeListWidget.item(count).text()) - name = u'%s (%s)' % (self.global_theme, self.trUtf8('default')) + name = u'%s (%s)' % (self.global_theme, translate('ThemeManager','default')) self.ThemeListWidget.item(count).setText(name) QtCore.QSettings().setValue( self.settingsSection + u'/global theme', @@ -178,21 +179,21 @@ class ThemeManager(QtGui.QWidget): # should be the same unless default if theme != unicode(item.data(QtCore.Qt.UserRole).toString()): QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('You are unable to delete the default theme.'), + self, translate('ThemeManager','Error'), + translate('ThemeManager','You are unable to delete the default theme.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) else: for plugin in self.parent.plugin_manager.plugins: if not plugin.can_delete_theme(theme): QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Theme %s is use in %s plugin' % (theme, plugin.name)), + self, translate('ThemeManager','Error'), + translate('ThemeManager','Theme %s is use in %s plugin' % (theme, plugin.name)), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Theme %s is use by Service Manager' % theme), + self, translate('ThemeManager','Error'), + translate('ThemeManager','Theme %s is use by Service Manager' % theme), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return self.themelist.remove(theme) @@ -217,13 +218,13 @@ class ThemeManager(QtGui.QWidget): """ item = self.ThemeListWidget.currentItem() if item is None: - QtGui.QMessageBox.critical(self, self.trUtf8('Error'), - self.trUtf8('You have not selected a theme.'), + QtGui.QMessageBox.critical(self, translate('ThemeManager','Error'), + translate('ThemeManager','You have not selected a theme.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return theme = unicode(item.data(QtCore.Qt.UserRole).toString()) path = QtGui.QFileDialog.getExistingDirectory(self, - unicode(self.trUtf8('Save Theme - (%s)')) % theme, + unicode(translate('ThemeManager','Save Theme - (%s)')) % theme, SettingsManager.get_last_dir(self.settingsSection, 1)) path = unicode(path) if path: @@ -246,7 +247,7 @@ class ThemeManager(QtGui.QWidget): def onImportTheme(self): files = QtGui.QFileDialog.getOpenFileNames( - self, self.trUtf8('Select Theme Import File'), + self, translate('ThemeManager','Select Theme Import File'), SettingsManager.get_last_dir(self.settingsSection), u'Theme (*.*)') log.info(u'New Themes %s', unicode(files)) if files: @@ -276,7 +277,7 @@ class ThemeManager(QtGui.QWidget): textName = os.path.splitext(name)[0] if textName == self.global_theme: name = u'%s (%s)' % (textName, - self.trUtf8('default')) + translate('ThemeManager','default')) else: name = textName thumb = os.path.join(self.thumbPath, u'%s.png' % textName) @@ -362,8 +363,8 @@ class ThemeManager(QtGui.QWidget): self.generateAndSaveImage(dir, themename, filexml) except: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('File is not a valid theme.'), + self, translate('ThemeManager','Error'), + translate('ThemeManager','File is not a valid theme.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) log.exception(u'Importing theme from zip file failed %s' % filename) finally: @@ -445,8 +446,8 @@ class ThemeManager(QtGui.QWidget): if self.saveThemeName != name: if os.path.exists(theme_file): result = QtGui.QMessageBox.question( - self, self.trUtf8('Theme Exists'), - self.trUtf8('A theme with this name already exists, ' + self, translate('ThemeManager','Theme Exists'), + translate('ThemeManager','A theme with this name already exists, ' 'would you like to overwrite it?'), (QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) @@ -503,7 +504,7 @@ class ThemeManager(QtGui.QWidget): def baseTheme(self): log.debug(u'base theme created') newtheme = ThemeXML() - newtheme.new_document(unicode(self.trUtf8('New Theme'))) + newtheme.new_document(unicode(translate('ThemeManager','New Theme'))) newtheme.add_background_solid(unicode(u'#000000')) newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False') diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index dba07eb6d..8d3355448 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, Receiver, ThemeLevel +from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate class ThemesTab(SettingsTab): """ @@ -37,7 +37,7 @@ class ThemesTab(SettingsTab): def setupUi(self): self.setObjectName(u'ThemesTab') - self.tabTitleVisible = self.trUtf8('Themes') + self.tabTitleVisible = translate('ThemesTab','Themes') self.ThemesTabLayout = QtGui.QHBoxLayout(self) self.ThemesTabLayout.setSpacing(8) self.ThemesTabLayout.setMargin(8) @@ -106,19 +106,19 @@ class ThemesTab(SettingsTab): QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): - self.GlobalGroupBox.setTitle(self.trUtf8('Global theme')) - self.LevelGroupBox.setTitle(self.trUtf8('Theme level')) - self.SongLevelRadioButton.setText(self.trUtf8('Song level')) - self.SongLevelLabel.setText(self.trUtf8('Use the theme from each song ' + self.GlobalGroupBox.setTitle(translate('ThemesTab','Global theme')) + self.LevelGroupBox.setTitle(translate('ThemesTab','Theme level')) + self.SongLevelRadioButton.setText(translate('ThemesTab','Song level')) + self.SongLevelLabel.setText(translate('ThemesTab','Use the theme from each song ' 'in the database. If a song doesn\'t have a theme associated with ' 'it, then use the service\'s theme. If the service doesn\'t have ' 'a theme, then use the global theme.')) - self.ServiceLevelRadioButton.setText(self.trUtf8('Service level')) - self.ServiceLevelLabel.setText(self.trUtf8('Use the theme from the ' + self.ServiceLevelRadioButton.setText(translate('ThemesTab','Service level')) + self.ServiceLevelLabel.setText(translate('ThemesTab','Use the theme from the ' 'service, overriding any of the individual songs\' themes. If the ' 'service doesn\'t have a theme, then use the global theme.')) - self.GlobalLevelRadioButton.setText(self.trUtf8('Global level')) - self.GlobalLevelLabel.setText(self.trUtf8('Use the global theme, ' + self.GlobalLevelRadioButton.setText(translate('ThemesTab','Global level')) + self.GlobalLevelLabel.setText(translate('ThemesTab','Use the global theme, ' 'overriding any themes associated with either the service or the ' 'songs.')) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index f97540029..024791bf2 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon, PluginStatus +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.alerts.lib import AlertsManager, AlertsTab, DBManager from openlp.plugins.alerts.forms import AlertForm @@ -63,8 +63,8 @@ class alertsPlugin(Plugin): AlertIcon = build_icon(u':/tools/tools_alert.png') self.toolsAlertItem.setIcon(AlertIcon) self.toolsAlertItem.setObjectName(u'toolsAlertItem') - self.toolsAlertItem.setText(self.trUtf8('&Alert')) - self.toolsAlertItem.setStatusTip(self.trUtf8('Show an alert message')) + self.toolsAlertItem.setText(translate('AlertsPlugin','&Alert')) + self.toolsAlertItem.setStatusTip(translate('AlertsPlugin','Show an alert message')) self.toolsAlertItem.setShortcut(u'F7') self.service_manager.parent.ToolsMenu.addAction(self.toolsAlertItem) QtCore.QObject.connect(self.toolsAlertItem, @@ -92,6 +92,6 @@ class alertsPlugin(Plugin): self.alertForm.exec_() def about(self): - about_text = self.trUtf8('Alerts Plugin
This plugin ' + about_text = translate('AlertsPlugin','Alerts Plugin
This plugin ' 'controls the displaying of alerts on the presentations screen') return about_text diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 9656dea42..995152e00 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -26,6 +26,7 @@ from PyQt4 import QtGui, QtCore from openlp.plugins.alerts.lib.models import AlertItem +from openlp.core.lib import translate from alertdialog import Ui_AlertDialog @@ -101,8 +102,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.AlertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, - self.trUtf8('Item selected to Add'), - self.trUtf8('Missing data')) + translate('AlertForm','Item selected to Add'), + translate('AlertForm','Missing data')) else: alert = AlertItem() alert.text = unicode(self.AlertTextEdit.text()) diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index e1e693b45..61d805700 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver +from openlp.core.lib import Receiver, translate log = logging.getLogger(__name__) @@ -93,7 +93,7 @@ class AlertsManager(QtCore.QObject): self.alertList.append(text) if self.timer_id != 0: Receiver.send_message(u'maindisplay_status_text', - self.trUtf8(u'Alert message created and delayed')) + translate('AlertsManager',u'Alert message created and delayed')) return Receiver.send_message(u'maindisplay_status_text', u'') self.generateAlert() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 7cda09488..80f776505 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab +from openlp.core.lib import SettingsTab, translate class AlertsTab(SettingsTab): """ @@ -38,7 +38,7 @@ class AlertsTab(SettingsTab): def setupUi(self): self.setObjectName(u'AlertsTab') - self.tabTitleVisible = self.trUtf8('Alerts') + self.tabTitleVisible = translate('AlertsTab','Alerts') self.AlertsLayout = QtGui.QHBoxLayout(self) self.AlertsLayout.setSpacing(8) self.AlertsLayout.setMargin(8) @@ -186,19 +186,19 @@ class AlertsTab(SettingsTab): QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged) def retranslateUi(self): - self.FontGroupBox.setTitle(self.trUtf8('Font')) - self.FontLabel.setText(self.trUtf8('Font Name:')) - self.FontColorLabel.setText(self.trUtf8('Font Color:')) - self.BackgroundColorLabel.setText(self.trUtf8('Background Color:')) - self.FontSizeLabel.setText(self.trUtf8('Font Size:')) - self.FontSizeSpinBox.setSuffix(self.trUtf8('pt')) - self.TimeoutLabel.setText(self.trUtf8('Alert timeout:')) - self.TimeoutSpinBox.setSuffix(self.trUtf8('s')) - self.LocationLabel.setText(self.trUtf8('Location:')) - self.PreviewGroupBox.setTitle(self.trUtf8('Preview')) - self.FontPreview.setText(self.trUtf8('openlp.org')) - self.LocationComboBox.setItemText(0, self.trUtf8('Top')) - self.LocationComboBox.setItemText(1, self.trUtf8('Bottom')) + self.FontGroupBox.setTitle(translate('AlertsTab','Font')) + self.FontLabel.setText(translate('AlertsTab','Font Name:')) + self.FontColorLabel.setText(translate('AlertsTab','Font Color:')) + self.BackgroundColorLabel.setText(translate('AlertsTab','Background Color:')) + self.FontSizeLabel.setText(translate('AlertsTab','Font Size:')) + self.FontSizeSpinBox.setSuffix(translate('AlertsTab','pt')) + self.TimeoutLabel.setText(translate('AlertsTab','Alert timeout:')) + self.TimeoutSpinBox.setSuffix(translate('AlertsTab','s')) + self.LocationLabel.setText(translate('AlertsTab','Location:')) + self.PreviewGroupBox.setTitle(translate('AlertsTab','Preview')) + self.FontPreview.setText(translate('AlertsTab','openlp.org')) + self.LocationComboBox.setItemText(0, translate('AlertsTab','Top')) + self.LocationComboBox.setItemText(1, translate('AlertsTab','Bottom')) def onBackgroundColorButtonClicked(self): self.bg_color = QtGui.QColorDialog.getColor( diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 5b4070665..38bd7bbf5 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon, PluginStatus +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem log = logging.getLogger(__name__) @@ -88,7 +88,7 @@ class BiblePlugin(Plugin): self.media_item.onImportClick() def about(self): - about_text = self.trUtf8('Bible Plugin
This ' + about_text = translate('BiblePlugin','Bible Plugin
This ' 'plugin allows bible verses from different sources to be ' 'displayed on the screen during the service.') return about_text diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 011bf264a..84ed345f4 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -31,7 +31,7 @@ import os.path from PyQt4 import QtCore, QtGui from bibleimportwizard import Ui_BibleImportWizard -from openlp.core.lib import Receiver, SettingsManager +from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.utils import AppLocation, variant_to_unicode from openlp.plugins.bibles.lib.manager import BibleFormat @@ -123,8 +123,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if self.field(u'osis_location').toString() == u'': QtGui.QMessageBox.critical(self, - self.trUtf8('Invalid Bible Location'), - self.trUtf8('You need to specify a file to import your ' + translate('ImportWizardForm','Invalid Bible Location'), + translate('ImportWizardForm','You need to specify a file to import your ' 'Bible from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OSISLocationEdit.setFocus() @@ -132,16 +132,16 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: if self.field(u'csv_booksfile').toString() == u'': QtGui.QMessageBox.critical(self, - self.trUtf8('Invalid Books File'), - self.trUtf8('You need to specify a file with books of ' + translate('ImportWizardForm','Invalid Books File'), + translate('ImportWizardForm','You need to specify a file with books of ' 'the Bible to use in the import.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.BooksLocationEdit.setFocus() return False elif self.field(u'csv_versefile').toString() == u'': QtGui.QMessageBox.critical(self, - self.trUtf8('Invalid Verse File'), - self.trUtf8('You need to specify a file of Bible ' + translate('ImportWizardForm','Invalid Verse File'), + translate('ImportWizardForm','You need to specify a file of Bible ' 'verses to import.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.CsvVerseLocationEdit.setFocus() @@ -149,8 +149,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenSong: if self.field(u'opensong_file').toString() == u'': QtGui.QMessageBox.critical(self, - self.trUtf8('Invalid OpenSong Bible'), - self.trUtf8('You need to specify an OpenSong Bible ' + translate('ImportWizardForm','Invalid OpenSong Bible'), + translate('ImportWizardForm','You need to specify an OpenSong Bible ' 'file to import.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OpenSongFileEdit.setFocus() @@ -162,16 +162,16 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): license_copyright = variant_to_unicode(self.field(u'license_copyright')) if license_version == u'': QtGui.QMessageBox.critical(self, - self.trUtf8('Empty Version Name'), - self.trUtf8('You need to specify a version name for your ' + translate('ImportWizardForm','Empty Version Name'), + translate('ImportWizardForm','You need to specify a version name for your ' 'Bible.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.VersionNameEdit.setFocus() return False elif license_copyright == u'': QtGui.QMessageBox.critical(self, - self.trUtf8('Empty Copyright'), - self.trUtf8('You need to set a copyright for your Bible! ' + translate('ImportWizardForm','Empty Copyright'), + translate('ImportWizardForm','You need to set a copyright for your Bible! ' 'Bibles in the Public Domain need to be marked as ' 'such.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) @@ -179,8 +179,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): return False elif self.manager.exists(license_version): QtGui.QMessageBox.critical(self, - self.trUtf8('Bible Exists'), - self.trUtf8('This Bible already exists! Please import ' + translate('ImportWizardForm','Bible Exists'), + translate('ImportWizardForm','This Bible already exists! Please import ' 'a different Bible or first delete the existing one.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.VersionNameEdit.setFocus() @@ -200,34 +200,34 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): """ self.BibleComboBox.clear() for bible in self.web_bible_list[index].keys(): - self.BibleComboBox.addItem(unicode(self.trUtf8(bible))) + self.BibleComboBox.addItem(unicode(translate('ImportWizardForm',bible))) def onOsisFileButtonClicked(self): """ Show the file open dialog for the OSIS file. """ - self.getFileName(self.trUtf8('Open OSIS File'), + self.getFileName(translate('ImportWizardForm','Open OSIS File'), self.OSISLocationEdit) def onBooksFileButtonClicked(self): """ Show the file open dialog for the books CSV file. """ - self.getFileName(self.trUtf8('Open Books CSV File'), + self.getFileName(translate('ImportWizardForm','Open Books CSV File'), self.BooksLocationEdit) def onCsvVersesFileButtonClicked(self): """ Show the file open dialog for the verses CSV file. """ - self.getFileName(self.trUtf8('Open Verses CSV File'), + self.getFileName(translate('ImportWizardForm','Open Verses CSV File'), self.CsvVerseLocationEdit) def onOpenSongBrowseButtonClicked(self): """ Show the file open dialog for the OpenSong file. """ - self.getFileName(self.trUtf8('Open OpenSong Bible'), + self.getFileName(translate('ImportWizardForm','Open OpenSong Bible'), self.OpenSongFileEdit) def onCancelButtonClicked(self, checked): @@ -362,7 +362,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.ImportProgressBar.setMinimum(0) self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setValue(0) - self.ImportProgressLabel.setText(self.trUtf8('Starting import...')) + self.ImportProgressLabel.setText(translate('ImportWizardForm','Starting import...')) Receiver.send_message(u'openlp_process_events') def performImport(self): @@ -416,10 +416,10 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.manager.save_meta_data(license_version, license_version, license_copyright, license_permission) self.manager.reload_bibles() - self.ImportProgressLabel.setText(self.trUtf8('Finished import.')) + self.ImportProgressLabel.setText(translate('ImportWizardForm','Finished import.')) else: self.ImportProgressLabel.setText( - self.trUtf8('Your Bible import failed.')) + translate('ImportWizardForm','Your Bible import failed.')) importer.delete() def postImport(self): diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 80e0cef5e..549adb818 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsTab +from openlp.core.lib import Receiver, SettingsTab, translate log = logging.getLogger(__name__) @@ -45,7 +45,7 @@ class BiblesTab(SettingsTab): def setupUi(self): self.setObjectName(u'BiblesTab') - self.tabTitleVisible = self.trUtf8('Bibles') + self.tabTitleVisible = translate('BiblesTab','Bibles') self.BibleLayout = QtGui.QHBoxLayout(self) self.BibleLayout.setSpacing(8) self.BibleLayout.setMargin(8) @@ -149,22 +149,22 @@ class BiblesTab(SettingsTab): QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): - self.VerseDisplayGroupBox.setTitle(self.trUtf8('Verse Display')) + self.VerseDisplayGroupBox.setTitle(translate('BiblesTab','Verse Display')) self.NewChaptersCheckBox.setText( - self.trUtf8('Only show new chapter numbers')) - self.LayoutStyleLabel.setText(self.trUtf8('Layout Style:')) - self.DisplayStyleLabel.setText(self.trUtf8('Display Style:')) - self.BibleThemeLabel.setText(self.trUtf8('Bible Theme:')) - self.LayoutStyleComboBox.setItemText(0, self.trUtf8('verse per slide')) - self.LayoutStyleComboBox.setItemText(1, self.trUtf8('verse per line')) - self.LayoutStyleComboBox.setItemText(2, self.trUtf8('continuous')) - self.DisplayStyleComboBox.setItemText(0, self.trUtf8('No brackets')) - self.DisplayStyleComboBox.setItemText(1, self.trUtf8('( and )')) - self.DisplayStyleComboBox.setItemText(2, self.trUtf8('{ and }')) - self.DisplayStyleComboBox.setItemText(3, self.trUtf8('[ and ]')) - self.ChangeNoteLabel.setText(self.trUtf8( + translate('BiblesTab','Only show new chapter numbers')) + self.LayoutStyleLabel.setText(translate('BiblesTab','Layout Style:')) + self.DisplayStyleLabel.setText(translate('BiblesTab','Display Style:')) + self.BibleThemeLabel.setText(translate('BiblesTab','Bible Theme:')) + self.LayoutStyleComboBox.setItemText(0, translate('BiblesTab','verse per slide')) + self.LayoutStyleComboBox.setItemText(1, translate('BiblesTab','verse per line')) + self.LayoutStyleComboBox.setItemText(2, translate('BiblesTab','continuous')) + self.DisplayStyleComboBox.setItemText(0, translate('BiblesTab','No brackets')) + self.DisplayStyleComboBox.setItemText(1, translate('BiblesTab','( and )')) + self.DisplayStyleComboBox.setItemText(2, translate('BiblesTab','{ and }')) + self.DisplayStyleComboBox.setItemText(3, translate('BiblesTab','[ and ]')) + self.ChangeNoteLabel.setText(translate('BiblesTab', 'Note:\nChanges don\'t affect verses already in the service')) - self.BibleDualCheckBox.setText(self.trUtf8('Display Dual Bible Verses')) + self.BibleDualCheckBox.setText(translate('BiblesTab','Display Dual Bible Verses')) def onBibleThemeComboBoxChanged(self): self.bible_theme = self.BibleThemeComboBox.currentText() diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 469d53640..24c4d42e0 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -29,7 +29,7 @@ import time from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \ - ItemCapabilities + ItemCapabilities, translate from openlp.plugins.bibles.forms import ImportWizardForm log = logging.getLogger(__name__) @@ -71,7 +71,7 @@ class BibleMediaItem(MediaManagerItem): return unicode(obj) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8('Bible') + self.PluginNameVisible = translate('MediaItem','Bible') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -147,7 +147,7 @@ class BibleMediaItem(MediaManagerItem): self.QuickMessage = QtGui.QLabel(self.QuickTab) self.QuickMessage.setObjectName(u'QuickMessage') self.QuickLayout.addWidget(self.QuickMessage, 6, 0, 1, 3) - self.SearchTabWidget.addTab(self.QuickTab, self.trUtf8('Quick')) + self.SearchTabWidget.addTab(self.QuickTab, translate('MediaItem','Quick')) QuickSpacerItem = QtGui.QSpacerItem(20, 35, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.QuickLayout.addItem(QuickSpacerItem, 6, 2, 1, 1) @@ -231,7 +231,7 @@ class BibleMediaItem(MediaManagerItem): self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab) self.AdvancedMessage.setObjectName(u'AdvancedMessage') self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3) - self.SearchTabWidget.addTab(self.AdvancedTab, self.trUtf8('Advanced')) + self.SearchTabWidget.addTab(self.AdvancedTab, translate('MediaItem','Advanced')) # Add the search tab widget to the page layout self.PageLayout.addWidget(self.SearchTabWidget) # Combo Boxes @@ -289,27 +289,27 @@ class BibleMediaItem(MediaManagerItem): def retranslateUi(self): log.debug(u'retranslateUi') - self.QuickVersionLabel.setText(self.trUtf8('Version:')) - self.QuickSecondVersionLabel.setText(self.trUtf8('Dual:')) - self.QuickSearchLabel.setText(self.trUtf8('Search Type:')) - self.QuickSearchLabel.setText(self.trUtf8('Find:')) - self.QuickSearchButton.setText(self.trUtf8('Search')) - self.QuickClearLabel.setText(self.trUtf8('Results:')) - self.AdvancedVersionLabel.setText(self.trUtf8('Version:')) - self.AdvancedSecondBibleLabel.setText(self.trUtf8('Dual:')) - self.AdvancedBookLabel.setText(self.trUtf8('Book:')) - self.AdvancedChapterLabel.setText(self.trUtf8('Chapter:')) - self.AdvancedVerseLabel.setText(self.trUtf8('Verse:')) - self.AdvancedFromLabel.setText(self.trUtf8('From:')) - self.AdvancedToLabel.setText(self.trUtf8('To:')) - self.AdvancedClearLabel.setText(self.trUtf8('Results:')) - self.AdvancedSearchButton.setText(self.trUtf8('Search')) - self.QuickSearchComboBox.addItem(self.trUtf8('Verse Search')) - self.QuickSearchComboBox.addItem(self.trUtf8('Text Search')) - self.ClearQuickSearchComboBox.addItem(self.trUtf8('Clear')) - self.ClearQuickSearchComboBox.addItem(self.trUtf8('Keep')) - self.ClearAdvancedSearchComboBox.addItem(self.trUtf8('Clear')) - self.ClearAdvancedSearchComboBox.addItem(self.trUtf8('Keep')) + self.QuickVersionLabel.setText(translate('MediaItem','Version:')) + self.QuickSecondVersionLabel.setText(translate('MediaItem','Dual:')) + self.QuickSearchLabel.setText(translate('MediaItem','Search Type:')) + self.QuickSearchLabel.setText(translate('MediaItem','Find:')) + self.QuickSearchButton.setText(translate('MediaItem','Search')) + self.QuickClearLabel.setText(translate('MediaItem','Results:')) + self.AdvancedVersionLabel.setText(translate('MediaItem','Version:')) + self.AdvancedSecondBibleLabel.setText(translate('MediaItem','Dual:')) + self.AdvancedBookLabel.setText(translate('MediaItem','Book:')) + self.AdvancedChapterLabel.setText(translate('MediaItem','Chapter:')) + self.AdvancedVerseLabel.setText(translate('MediaItem','Verse:')) + self.AdvancedFromLabel.setText(translate('MediaItem','From:')) + self.AdvancedToLabel.setText(translate('MediaItem','To:')) + self.AdvancedClearLabel.setText(translate('MediaItem','Results:')) + self.AdvancedSearchButton.setText(translate('MediaItem','Search')) + self.QuickSearchComboBox.addItem(translate('MediaItem','Verse Search')) + self.QuickSearchComboBox.addItem(translate('MediaItem','Text Search')) + self.ClearQuickSearchComboBox.addItem(translate('MediaItem','Clear')) + self.ClearQuickSearchComboBox.addItem(translate('MediaItem','Keep')) + self.ClearAdvancedSearchComboBox.addItem(translate('MediaItem','Clear')) + self.ClearAdvancedSearchComboBox.addItem(translate('MediaItem','Keep')) def initialise(self): log.debug(u'bible manager initialise') @@ -363,8 +363,8 @@ class BibleMediaItem(MediaManagerItem): def onNoBookFound(self): QtGui.QMessageBox.critical(self, - self.trUtf8('No Book Found'), - self.trUtf8('No matching book could be found in this Bible.'), + translate('MediaItem','No Book Found'), + translate('MediaItem','No matching book could be found in this Bible.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok ) @@ -523,9 +523,9 @@ class BibleMediaItem(MediaManagerItem): bible_text = u'' if not service_item.title: service_item.title = u'%s %s' % (book, verse_text) - elif service_item.title.find(self.trUtf8(u'etc')) == -1: + elif service_item.title.find(translate('MediaItem',u'etc')) == -1: service_item.title = u'%s, %s' \ - % (service_item.title, self.trUtf8(u'etc')) + % (service_item.title, translate('MediaItem',u'etc')) if len(self.parent.settings_tab.bible_theme) == 0: service_item.theme = None else: @@ -574,7 +574,7 @@ class BibleMediaItem(MediaManagerItem): self.verses = self.parent.manager.get_verse_count(bible, book, 1) if self.verses == 0: self.AdvancedSearchButton.setEnabled(False) - self.AdvancedMessage.setText(self.trUtf8('Bible not fully loaded')) + self.AdvancedMessage.setText(translate('MediaItem','Bible not fully loaded')) else: self.AdvancedSearchButton.setEnabled(True) self.AdvancedMessage.setText(u'') diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 048b569d0..3b55b9b74 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -28,7 +28,7 @@ import logging from lxml import objectify from PyQt4 import QtCore -from openlp.core.lib import Receiver +from openlp.core.lib import Receiver, translate from db import BibleDB log = logging.getLogger(__name__) @@ -94,7 +94,7 @@ class OpenSongBible(BibleDB): ) Receiver.send_message(u'openlp_process_events') self.wizard.incrementProgressBar( - QtCore.QString('%s %s %s' % (self.trUtf8('Importing'),\ + QtCore.QString('%s %s %s' % (translate('OpenSong','Importing'),\ db_book.name, chapter.attrib[u'n']))) self.commit() except: diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index a59596f22..e84c9845b 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -26,7 +26,7 @@ import logging from forms import EditCustomForm -from openlp.core.lib import Plugin, build_icon, PluginStatus +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab log = logging.getLogger(__name__) @@ -67,7 +67,7 @@ class CustomPlugin(Plugin): self.remove_toolbox_item() def about(self): - about_text = self.trUtf8('Custom Plugin
This plugin ' + about_text = translate('CustomPlugin','Custom Plugin
This plugin ' 'allows slides to be displayed on the screen in the same way ' 'songs are. This plugin provides greater freedom over the ' 'songs plugin.
') diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index 83c21e7f3..b424e81e5 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from editcustomdialog import Ui_customEditDialog -from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver +from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate from openlp.plugins.custom.lib.models import CustomSlide log = logging.getLogger(__name__) @@ -47,7 +47,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.setupUi(self) # Connecting signals and slots self.previewButton = QtGui.QPushButton() - self.previewButton.setText(self.trUtf8('Save && Preview')) + self.previewButton.setText(translate('editCustomForm','Save && Preview')) self.buttonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.buttonBox, @@ -84,7 +84,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def onPreview(self, button): log.debug(u'onPreview') - if button.text() == unicode(self.trUtf8('Save && Preview')) \ + if button.text() == unicode(translate('editCustomForm','Save && Preview')) \ and self.saveCustom(): Receiver.send_message(u'custom_preview') @@ -147,7 +147,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def saveCustom(self): valid, message = self._validate() if not valid: - QtGui.QMessageBox.critical(self, self.trUtf8('Error'), message, + QtGui.QMessageBox.critical(self, translate('editCustomForm','Error'), message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return False sxml = SongXMLBuilder() @@ -263,12 +263,12 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def _validate(self): if len(self.TitleEdit.displayText()) == 0: self.TitleEdit.setFocus() - return False, self.trUtf8('You need to enter a title') + return False, translate('editCustomForm','You need to enter a title') # must have 1 slide if self.VerseListView.count() == 0: self.VerseTextEdit.setFocus() - return False, self.trUtf8('You need to enter a slide') + return False, translate('editCustomForm','You need to enter a slide') if self.VerseTextEdit.toPlainText(): self.VerseTextEdit.setFocus() - return False, self.trUtf8('You have unsaved data, please save or clear') + return False, translate('editCustomForm','You have unsaved data, please save or clear') return True, u'' diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 2b6cedfbf..b768bbcc5 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab +from openlp.core.lib import SettingsTab, translate class CustomTab(SettingsTab): """ @@ -36,7 +36,7 @@ class CustomTab(SettingsTab): def setupUi(self): self.setObjectName(u'CustomTab') - self.tabTitleVisible = self.trUtf8('Custom') + self.tabTitleVisible = translate('CustomTab','Custom') self.CustomLayout = QtGui.QFormLayout(self) self.CustomLayout.setObjectName(u'CustomLayout') self.CustomModeGroupBox = QtGui.QGroupBox(self) @@ -55,9 +55,9 @@ class CustomTab(SettingsTab): self.onDisplayFooterCheckBoxChanged) def retranslateUi(self): - self.CustomModeGroupBox.setTitle(self.trUtf8('Custom Display')) + self.CustomModeGroupBox.setTitle(translate('CustomTab','Custom Display')) self.DisplayFooterCheckBox.setText( - self.trUtf8('Display Footer')) + translate('CustomTab','Display Footer')) def onDisplayFooterCheckBoxChanged(self, check_state): self.displayFooter = False diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 599d73625..a6ba6af46 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \ - Receiver, ItemCapabilities + Receiver, ItemCapabilities, translate log = logging.getLogger(__name__) @@ -66,7 +66,7 @@ class CustomMediaItem(MediaManagerItem): QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8('Custom') + self.PluginNameVisible = translate('mediaItem','Custom') def requiredIcons(self): MediaManagerItem.requiredIcons(self) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index ec1a637e1..7bd8d2031 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -25,7 +25,7 @@ import logging -from openlp.core.lib import Plugin, build_icon, PluginStatus +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.images.lib import ImageMediaItem, ImageTab log = logging.getLogger(__name__) @@ -56,7 +56,7 @@ class ImagePlugin(Plugin): return ImageMediaItem(self, self.icon, self.name) def about(self): - about_text = self.trUtf8('Image Plugin
Allows images of ' + about_text = translate('ImagePlugin','Image Plugin
Allows images of ' 'all types to be displayed. If a number of images are selected ' 'together and presented on the live controller it is possible ' 'to turn them into a timed loop.From the plugin if the ' diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 346d28b16..e34bec2b0 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, Receiver +from openlp.core.lib import SettingsTab, Receiver, translate class ImageTab(SettingsTab): """ @@ -36,7 +36,7 @@ class ImageTab(SettingsTab): def setupUi(self): self.setObjectName(u'ImageTab') - self.tabTitleVisible = self.trUtf8('Images') + self.tabTitleVisible = translate('ImageTab','Images') self.ImageLayout = QtGui.QFormLayout(self) self.ImageLayout.setObjectName(u'ImageLayout') self.ImageSettingsGroupBox = QtGui.QGroupBox(self) @@ -63,9 +63,9 @@ class ImageTab(SettingsTab): QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) def retranslateUi(self): - self.ImageSettingsGroupBox.setTitle(self.trUtf8('Image Settings')) - self.TimeoutLabel.setText(self.trUtf8('Slide Loop Delay:')) - self.TimeoutSpinBox.setSuffix(self.trUtf8('sec')) + self.ImageSettingsGroupBox.setTitle(translate('ImageTab','Image Settings')) + self.TimeoutLabel.setText(translate('ImageTab','Slide Loop Delay:')) + self.TimeoutSpinBox.setSuffix(translate('ImageTab','sec')) def onTimeoutSpinBoxChanged(self): self.loop_delay = self.TimeoutSpinBox.value() diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 35151d86e..8c6cb550c 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -29,7 +29,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - contextMenuAction, ItemCapabilities, SettingsManager + contextMenuAction, ItemCapabilities, SettingsManager, translate from openlp.core.utils import AppLocation log = logging.getLogger(__name__) @@ -56,11 +56,11 @@ class ImageMediaItem(MediaManagerItem): MediaManagerItem.__init__(self, parent, icon, title) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8('Image') + self.PluginNameVisible = translate('MediaItem','Image') def retranslateUi(self): - self.OnNewPrompt = self.trUtf8('Select Image(s)') - self.OnNewFileMasks = self.trUtf8( + self.OnNewPrompt = translate('MediaItem','Select Image(s)') + self.OnNewFileMasks = translate('MediaItem', 'Images (*.jpg *.jpeg *.gif *.png *.bmp);; All files (*)') def requiredIcons(self): @@ -90,7 +90,7 @@ class ImageMediaItem(MediaManagerItem): self.ListView.addAction( contextMenuAction( self.ListView, u':/slides/slide_blank.png', - self.trUtf8('Replace Live Background'), + translate('MediaItem','Replace Live Background'), self.onReplaceClick)) def addEndHeaderBar(self): @@ -105,7 +105,7 @@ class ImageMediaItem(MediaManagerItem): self.ImageWidget.setObjectName(u'ImageWidget') self.blankButton = self.Toolbar.addToolbarButton( u'Replace Background', u':/slides/slide_blank.png', - self.trUtf8('Replace Live Background'), self.onReplaceClick, False) + translate('MediaItem','Replace Live Background'), self.onReplaceClick, False) # Add the song widget to the page layout self.PageLayout.addWidget(self.ImageWidget) @@ -143,7 +143,7 @@ class ImageMediaItem(MediaManagerItem): def generateSlideData(self, service_item, item=None): items = self.ListView.selectedIndexes() if items: - service_item.title = unicode(self.trUtf8('Image(s)')) + service_item.title = unicode(translate('MediaItem','Image(s)')) service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) @@ -161,8 +161,8 @@ class ImageMediaItem(MediaManagerItem): def onReplaceClick(self): if not self.ListView.selectedIndexes(): QtGui.QMessageBox.information(self, - self.trUtf8('No item selected'), - self.trUtf8('You must select one item')) + translate('MediaItem','No item selected'), + translate('MediaItem','You must select one item')) items = self.ListView.selectedIndexes() for item in items: bitem = self.ListView.item(item.row()) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 05175632d..af9cbb6e4 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -29,7 +29,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - ItemCapabilities, SettingsManager, contextMenuAction, Receiver + ItemCapabilities, SettingsManager, contextMenuAction, Receiver, translate log = logging.getLogger(__name__) @@ -58,11 +58,11 @@ class MediaMediaItem(MediaManagerItem): self.ServiceItemIconName = u':/media/media_video.png' def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8('Media') + self.PluginNameVisible = translate('MediaItem','Media') def retranslateUi(self): - self.OnNewPrompt = self.trUtf8('Select Media') - self.OnNewFileMasks = self.trUtf8('Videos (%s);;' + self.OnNewPrompt = translate('MediaItem','Select Media') + self.OnNewFileMasks = translate('MediaItem','Videos (%s);;' 'Audio (%s);;' 'All files (*)' % (self.parent.video_list, self.parent.audio_list)) @@ -78,7 +78,7 @@ class MediaMediaItem(MediaManagerItem): self.ListView.addAction( contextMenuAction( self.ListView, u':/slides/slide_blank.png', - self.trUtf8('Replace Live Background'), + translate('MediaItem','Replace Live Background'), self.onReplaceClick)) def addEndHeaderBar(self): @@ -93,7 +93,7 @@ class MediaMediaItem(MediaManagerItem): self.ImageWidget.setObjectName(u'ImageWidget') self.blankButton = self.Toolbar.addToolbarButton( u'Replace Background', u':/slides/slide_blank.png', - self.trUtf8('Replace Live Background'), self.onReplaceClick, False) + translate('MediaItem','Replace Live Background'), self.onReplaceClick, False) # Add the song widget to the page layout self.PageLayout.addWidget(self.ImageWidget) @@ -105,8 +105,8 @@ class MediaMediaItem(MediaManagerItem): self.background = True if not self.ListView.selectedIndexes(): QtGui.QMessageBox.information(self, - self.trUtf8('No item selected'), - self.trUtf8('You must select one item')) + translate('MediaItem','No item selected'), + translate('MediaItem','You must select one item')) items = self.ListView.selectedIndexes() for item in items: bitem = self.ListView.item(item.row()) @@ -119,7 +119,7 @@ class MediaMediaItem(MediaManagerItem): if item is None: return False filename = unicode((item.data(QtCore.Qt.UserRole)).toString()) - service_item.title = unicode(self.trUtf8('Media')) + service_item.title = unicode(translate('MediaItem','Media')) service_item.add_capability(ItemCapabilities.RequiresMedia) frame = u':/media/image_clapperboard.png' (path, name) = os.path.split(filename) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index bdf28c8a4..709066521 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -25,7 +25,7 @@ import logging -from openlp.core.lib import Plugin, build_icon, PluginStatus +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.media.lib import MediaMediaItem from PyQt4.phonon import Phonon @@ -76,6 +76,6 @@ class MediaPlugin(Plugin): return MediaMediaItem(self, self.icon, self.name) def about(self): - about_text = self.trUtf8('Media Plugin
This plugin ' + about_text = translate('MediaPlugin','Media Plugin
This plugin ' 'allows the playing of audio and video media') return about_text diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index cf25a76d3..462d1a924 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -29,7 +29,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - SettingsManager + SettingsManager, translate from openlp.core.utils import AppLocation from openlp.plugins.presentations.lib import MessageListener @@ -61,11 +61,11 @@ class PresentationMediaItem(MediaManagerItem): self.message_listener = MessageListener(self) def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8('Presentation') + self.PluginNameVisible = translate('MediaItem','Presentation') def retranslateUi(self): - self.OnNewPrompt = self.trUtf8('Select Presentation(s)') - self.Automatic = self.trUtf8('Automatic') + self.OnNewPrompt = translate('MediaItem','Select Presentation(s)') + self.Automatic = translate('MediaItem','Automatic') fileType = u'' for controller in self.controllers: if self.controllers[controller].enabled: @@ -75,7 +75,7 @@ class PresentationMediaItem(MediaManagerItem): if fileType.find(type) == -1: fileType += u'*%s ' % type self.parent.service_manager.supportedSuffixes(type) - self.OnNewFileMasks = self.trUtf8('Presentations (%s)' % fileType) + self.OnNewFileMasks = translate('MediaItem','Presentations (%s)' % fileType) def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -101,7 +101,7 @@ class PresentationMediaItem(MediaManagerItem): self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget) self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel') self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1) - self.DisplayTypeLabel.setText(self.trUtf8('Present using:')) + self.DisplayTypeLabel.setText(translate('MediaItem','Present using:')) # Add the Presentation widget to the page layout self.PageLayout.addWidget(self.PresentationWidget) @@ -134,7 +134,7 @@ class PresentationMediaItem(MediaManagerItem): (path, filename) = os.path.split(unicode(file)) if titles.count(filename) > 0: QtGui.QMessageBox.critical( - self, self.trUtf8('File exists'), self.trUtf8( + self, translate('MediaItem','File exists'), translate('MediaItem', 'A presentation with that filename already exists.'), QtGui.QMessageBox.Ok) else: diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index ebcbb3d7b..01854f8e6 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab +from openlp.core.lib import SettingsTab, translate class PresentationTab(SettingsTab): """ @@ -37,7 +37,7 @@ class PresentationTab(SettingsTab): def setupUi(self): self.setObjectName(u'PresentationTab') - self.tabTitleVisible = self.trUtf8('Presentations') + self.tabTitleVisible = translate('PresentationTab','Presentations') self.PresentationLayout = QtGui.QHBoxLayout(self) self.PresentationLayout.setSpacing(8) self.PresentationLayout.setMargin(8) @@ -88,12 +88,12 @@ class PresentationTab(SettingsTab): self.PresentationLayout.addWidget(self.PresentationRightWidget) def retranslateUi(self): - self.VerseDisplayGroupBox.setTitle(self.trUtf8('Available Controllers')) + self.VerseDisplayGroupBox.setTitle(translate('PresentationTab','Available Controllers')) for key in self.controllers: controller = self.controllers[key] checkbox = self.PresenterCheckboxes[controller.name] checkbox.setText( - u'%s %s' % (controller.name, self.trUtf8('available'))) + u'%s %s' % (controller.name, translate('PresentationTab','available'))) def load(self): for key in self.controllers: diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index f57235c9b..8ebf19250 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -26,7 +26,7 @@ import os import logging -from openlp.core.lib import Plugin, build_icon, PluginStatus +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.core.utils import AppLocation from openlp.plugins.presentations.lib import * @@ -108,7 +108,7 @@ class PresentationPlugin(Plugin): return False def about(self): - about_text = self.trUtf8('Presentation Plugin
Delivers ' + about_text = translate('PresentationPlugin','Presentation Plugin
Delivers ' 'the ability to show presentations using a number of different ' 'programs. The choice of available presentation programs is ' 'available to the user in a drop down box.') diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index abdda065f..c91bbfa72 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab +from openlp.core.lib import SettingsTab, translate class RemoteTab(SettingsTab): """ @@ -36,7 +36,7 @@ class RemoteTab(SettingsTab): def setupUi(self): self.setObjectName(u'RemoteTab') - self.tabTitleVisible = self.trUtf8('Remotes') + self.tabTitleVisible = translate('RemoteTab','Remotes') self.RemoteLayout = QtGui.QFormLayout(self) self.RemoteLayout.setObjectName(u'RemoteLayout') self.RemoteModeGroupBox = QtGui.QGroupBox(self) @@ -53,7 +53,7 @@ class RemoteTab(SettingsTab): 0, QtGui.QFormLayout.LabelRole, self.RemoteModeGroupBox) def retranslateUi(self): - self.RemoteModeGroupBox.setTitle(self.trUtf8('Remotes Receiver Port')) + self.RemoteModeGroupBox.setTitle(translate('RemoteTab','Remotes Receiver Port')) def load(self): self.RemotePortSpinBox.setValue( diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index bc1679fc9..a6b4ede63 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -25,7 +25,7 @@ import logging -from openlp.core.lib import Plugin +from openlp.core.lib import Plugin, translate from openlp.plugins.remotes.lib import RemoteTab, HttpServer log = logging.getLogger(__name__) @@ -69,7 +69,7 @@ class RemotesPlugin(Plugin): """ Information about this plugin """ - about_text = self.trUtf8('Remote Plugin
This plugin ' + about_text = translate('RemotePlugin','Remote Plugin
This plugin ' 'provides the ability to send messages to a running version of ' 'openlp on a different computer via a web browser or other app
' 'The Primary use for this would be to send alerts from a creche') diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index d1cb24761..b7046a6de 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -26,6 +26,7 @@ from PyQt4 import QtGui, QtCore from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog +from openlp.core.lib import translate class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): """ @@ -76,22 +77,22 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): def accept(self): if not self.FirstNameEdit.text(): QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('You need to type in the first name of the author.'), + self, translate('AuthorsForm','Error'), + translate('AuthorsForm','You need to type in the first name of the author.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.FirstNameEdit.setFocus() return False elif not self.LastNameEdit.text(): QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('You need to type in the last name of the author.'), + self, translate('AuthorsForm','Error'), + translate('AuthorsForm','You need to type in the last name of the author.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.LastNameEdit.setFocus() return False elif not self.DisplayEdit.text(): if QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('You haven\'t set a display name for the ' + self, translate('AuthorsForm','Error'), + translate('AuthorsForm','You haven\'t set a display name for the ' 'author, would you like me to combine the first and ' 'last names for you?'), QtGui.QMessageBox.StandardButtons( diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 144081c84..1c61458e0 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -28,7 +28,7 @@ import re from PyQt4 import QtCore, QtGui -from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver +from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate from openlp.plugins.songs.forms import EditVerseForm from openlp.plugins.songs.lib.models import Song from editsongdialog import Ui_EditSongDialog @@ -101,7 +101,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.QObject.connect(self.VerseOrderEdit, QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus) self.previewButton = QtGui.QPushButton() - self.previewButton.setText(self.trUtf8('Save && Preview')) + self.previewButton.setText(translate('EditSongForm','Save && Preview')) self.ButtonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.ButtonBox, @@ -460,27 +460,27 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if len(self.TitleEditItem.displayText()) == 0: self.SongTabWidget.setCurrentIndex(0) self.TitleEditItem.setFocus() - return False, self.trUtf8('You need to enter a song title.') + return False, translate('EditSongForm','You need to enter a song title.') if self.VerseListWidget.rowCount() == 0: self.SongTabWidget.setCurrentIndex(0) self.VerseListWidget.setFocus() - return False, self.trUtf8('You need to enter some verses.') + return False, translate('EditSongForm','You need to enter some verses.') if self.AuthorsListView.count() == 0: self.SongTabWidget.setCurrentIndex(1) self.AuthorsListView.setFocus() #split the verse list by space and mark lower case for testing - taglist = unicode(self.trUtf8(' bitped')) + taglist = unicode(translate('EditSongForm',' bitped')) for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '): if len(verse) > 1: - if (verse[0:1] == u'%s' % self.trUtf8('v') or - verse[0:1] == u'%s' % self.trUtf8('c')) \ + if (verse[0:1] == u'%s' % translate('EditSongForm','v') or + verse[0:1] == u'%s' % translate('EditSongForm','c')) \ and verse[1:].isdigit(): pass else: self.SongTabWidget.setCurrentIndex(0) self.VerseOrderEdit.setFocus() return False, \ - self.trUtf8('Invalid verse entry - Vx or Cx') + translate('EditSongForm','Invalid verse entry - Vx or Cx') else: if taglist.find(verse) > -1: pass @@ -488,7 +488,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.SongTabWidget.setCurrentIndex(0) self.VerseOrderEdit.setFocus() return False, \ - self.trUtf8(\ + translate('EditSongForm',\ 'Invalid verse entry, values must be I,B,T,P,E,O,Vx,Cx') return True, u'' @@ -524,7 +524,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): The Song is valid so as the plugin to add it to preview to see. """ log.debug(u'onPreview') - if button.text() == unicode(self.trUtf8('Save && Preview')) \ + if button.text() == unicode(translate('EditSongForm','Save && Preview')) \ and self.saveSong(): Receiver.send_message(u'songs_preview') @@ -542,7 +542,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): valid, message = self._validate_song() if not valid: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), message, + self, translate('EditSongForm','Error'), message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return False self.song.title = unicode(self.TitleEditItem.displayText()) diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index d345a82d7..5f3fffb59 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -26,6 +26,7 @@ from PyQt4 import QtGui from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog +from openlp.core.lib import translate class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): """ @@ -48,8 +49,8 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): def accept(self): if not self.NameEdit.text(): QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('You need to type in a book name!'), + self, translate('SongBookForm','Error'), + translate('SongBookForm','You need to type in a book name!'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.NameEdit.setFocus() return False diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index ff6b416c6..c44a49506 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from songimportwizard import Ui_SongImportWizard -from openlp.core.lib import Receiver, SettingsManager +from openlp.core.lib import Receiver, SettingsManager, translate #from openlp.core.utils import AppLocation, variant_to_unicode from openlp.plugins.songs.lib.manager import SongFormat @@ -104,8 +104,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): if source_format == SongFormat.OpenLyrics: if self.OpenLyricsFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, - self.trUtf8('No OpenLyrics Files Selected'), - self.trUtf8('You need to add at least one OpenLyrics ' + translate('SongImportForm','No OpenLyrics Files Selected'), + translate('SongImportForm','You need to add at least one OpenLyrics ' 'song file to import from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OpenLyricsAddButton.setFocus() @@ -113,8 +113,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): elif source_format == SongFormat.OpenSong: if self.OpenSongFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, - self.trUtf8('No OpenSong Files Selected'), - self.trUtf8('You need to add at least one OpenSong ' + translate('SongImportForm','No OpenSong Files Selected'), + translate('SongImportForm','You need to add at least one OpenSong ' 'song file to import from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OpenSongAddButton.setFocus() @@ -122,8 +122,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): elif source_format == SongFormat.CCLI: if self.CCLIFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, - self.trUtf8('No CCLI Files Selected'), - self.trUtf8('You need to add at least one CCLI file ' + translate('SongImportForm','No CCLI Files Selected'), + translate('SongImportForm','You need to add at least one CCLI file ' 'to import from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.CCLIAddButton.setFocus() @@ -131,8 +131,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): elif source_format == SongFormat.CSV: if self.CSVFilenameEdit.text().isEmpty(): QtGui.QMessageBox.critical(self, - self.trUtf8('No CSV File Selected'), - self.trUtf8('You need to specify a CSV file to import ' + translate('SongImportForm','No CSV File Selected'), + translate('SongImportForm','You need to specify a CSV file to import ' 'from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.CSVFilenameEdit.setFocus() @@ -184,7 +184,7 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): self.ImportProgressBar.setMinimum(0) self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setValue(0) - self.ImportProgressLabel.setText(self.trUtf8('Starting import...')) + self.ImportProgressLabel.setText(translate('SongImportForm','Starting import...')) Receiver.send_message(u'process_events') def performImport(self): @@ -235,10 +235,10 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): # self.manager.save_meta_data(license_version, license_version, # license_copyright, license_permission) # self.manager.reload_bibles() -# self.ImportProgressLabel.setText(self.trUtf8('Finished import.')) +# self.ImportProgressLabel.setText(translate('SongImportForm','Finished import.')) # else: # self.ImportProgressLabel.setText( -# self.trUtf8('Your Bible import failed.')) +# translate('SongImportForm','Your Bible import failed.')) # importer.delete() def postImport(self): diff --git a/openlp/plugins/songs/forms/songimportwizard.py b/openlp/plugins/songs/forms/songimportwizard.py index d0c8d9d92..508195f8b 100644 --- a/openlp/plugins/songs/forms/songimportwizard.py +++ b/openlp/plugins/songs/forms/songimportwizard.py @@ -25,6 +25,8 @@ from PyQt4 import QtCore, QtGui +from openlp.core.lib import translate + class Ui_SongImportWizard(object): def setupUi(self, SongImportWizard): SongImportWizard.setObjectName(u'SongImportWizard') @@ -224,32 +226,32 @@ class Ui_SongImportWizard(object): QtCore.QMetaObject.connectSlotsByName(SongImportWizard) def retranslateUi(self, SongImportWizard): - SongImportWizard.setWindowTitle(self.trUtf8('Song Import Wizard')) + SongImportWizard.setWindowTitle(translate('SongImportWizard','Song Import Wizard')) self.TitleLabel.setText( '%s' % \ - self.trUtf8('Welcome to the Song Import Wizard')) - self.InformationLabel.setText(self.trUtf8('This wizard will help you ' + translate('SongImportWizard','Welcome to the Song Import Wizard')) + self.InformationLabel.setText(translate('SongImportWizard','This wizard will help you ' 'to import songs from a variety of formats. Click the next button ' 'below to start the process by selecting a format to import from.')) - self.SourcePage.setTitle(self.trUtf8('Select Import Source')) - self.SourcePage.setSubTitle(self.trUtf8('Select the import format, ' + self.SourcePage.setTitle(translate('SongImportWizard','Select Import Source')) + self.SourcePage.setSubTitle(translate('SongImportWizard','Select the import format, ' 'and where to import from.')) - self.FormatLabel.setText(self.trUtf8('Format:')) - self.FormatComboBox.setItemText(0, self.trUtf8('OpenLyrics')) - self.FormatComboBox.setItemText(1, self.trUtf8('OpenSong')) - self.FormatComboBox.setItemText(2, self.trUtf8('CCLI')) - self.FormatComboBox.setItemText(3, self.trUtf8('CSV')) - self.OpenLyricsAddButton.setText(self.trUtf8('Add Files...')) - self.OpenLyricsRemoveButton.setText(self.trUtf8('Remove File(s)')) - self.OpenSongAddButton.setText(self.trUtf8('Add Files...')) - self.OpenSongRemoveButton.setText(self.trUtf8('Remove File(s)')) - self.CCLIAddButton.setText(self.trUtf8('Add Files...')) - self.CCLIRemoveButton.setText(self.trUtf8('Remove File(s)')) - self.CSVFilenameLabel.setText(self.trUtf8('Filename:')) - self.CSVBrowseButton.setText(self.trUtf8('Browse...')) - self.ImportPage.setTitle(self.trUtf8('Importing')) - self.ImportPage.setSubTitle(self.trUtf8('Please wait while your songs ' + self.FormatLabel.setText(translate('SongImportWizard','Format:')) + self.FormatComboBox.setItemText(0, translate('SongImportWizard','OpenLyrics')) + self.FormatComboBox.setItemText(1, translate('SongImportWizard','OpenSong')) + self.FormatComboBox.setItemText(2, translate('SongImportWizard','CCLI')) + self.FormatComboBox.setItemText(3, translate('SongImportWizard','CSV')) + self.OpenLyricsAddButton.setText(translate('SongImportWizard','Add Files...')) + self.OpenLyricsRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) + self.OpenSongAddButton.setText(translate('SongImportWizard','Add Files...')) + self.OpenSongRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) + self.CCLIAddButton.setText(translate('SongImportWizard','Add Files...')) + self.CCLIRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) + self.CSVFilenameLabel.setText(translate('SongImportWizard','Filename:')) + self.CSVBrowseButton.setText(translate('SongImportWizard','Browse...')) + self.ImportPage.setTitle(translate('SongImportWizard','Importing')) + self.ImportPage.setSubTitle(translate('SongImportWizard','Please wait while your songs ' 'are imported.')) - self.ImportProgressLabel.setText(self.trUtf8('Ready.')) - self.ImportProgressBar.setFormat(self.trUtf8('%p%')) + self.ImportProgressLabel.setText(translate('SongImportWizard','Ready.')) + self.ImportProgressBar.setFormat(translate('SongImportWizard','%p%')) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 1ea1d7f43..219c2e213 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -30,6 +30,7 @@ from songmaintenancedialog import Ui_SongMaintenanceDialog from authorsform import AuthorsForm from topicsform import TopicsForm from songbookform import SongBookForm +from openlp.core.lib import translate class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): """ @@ -139,8 +140,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetAuthors() else: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Couldn\'t add your author.')) + self, translate('SongMaintenanceForm','Error'), + translate('SongMaintenanceForm','Couldn\'t add your author.')) def onTopicAddButtonClick(self): if self.topicform.exec_(): @@ -150,8 +151,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetTopics() else: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Couldn\'t add your topic.')) + self, translate('SongMaintenanceForm','Error'), + translate('SongMaintenanceForm','Couldn\'t add your topic.')) def onBookAddButtonClick(self): if self.bookform.exec_(): @@ -162,8 +163,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetBooks() else: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Couldn\'t add your book.')) + self, translate('SongMaintenanceForm','Error'), + translate('SongMaintenanceForm','Couldn\'t add your book.')) def onAuthorEditButtonClick(self): author_id = self._getCurrentItemId(self.AuthorsListWidget) @@ -184,8 +185,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetAuthors() else: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Couldn\'t save your author.')) + self, translate('SongMaintenanceForm','Error'), + translate('SongMaintenanceForm','Couldn\'t save your author.')) def onTopicEditButtonClick(self): topic_id = self._getCurrentItemId(self.TopicsListWidget) @@ -198,8 +199,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetTopics() else: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Couldn\'t save your topic.')) + self, translate('SongMaintenanceForm','Error'), + translate('SongMaintenanceForm','Couldn\'t save your topic.')) def onBookEditButtonClick(self): book_id = self._getCurrentItemId(self.BooksListWidget) @@ -215,8 +216,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetBooks() else: QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('Couldn\'t save your book.')) + self, translate('SongMaintenanceForm','Error'), + translate('SongMaintenanceForm','Couldn\'t save your book.')) def onAuthorDeleteButtonClick(self): """ @@ -225,11 +226,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self._deleteItem( self.AuthorsListWidget, self.songmanager.get_author, self.songmanager.delete_author, self.resetAuthors, - self.trUtf8('Delete Author'), - self.trUtf8('Are you sure you want to delete the selected author?'), - self.trUtf8('This author can\'t be deleted, they are currently ' + translate('SongMaintenanceForm','Delete Author'), + translate('SongMaintenanceForm','Are you sure you want to delete the selected author?'), + translate('SongMaintenanceForm','This author can\'t be deleted, they are currently ' 'assigned to at least one song.'), - self.trUtf8('No author selected!')) + translate('SongMaintenanceForm','No author selected!')) def onTopicDeleteButtonClick(self): """ @@ -238,11 +239,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self._deleteItem( self.TopicsListWidget, self.songmanager.get_topic, self.songmanager.delete_topic, self.resetTopics, - self.trUtf8('Delete Topic'), - self.trUtf8('Are you sure you want to delete the selected topic?'), - self.trUtf8('This topic can\'t be deleted, it is currently ' + translate('SongMaintenanceForm','Delete Topic'), + translate('SongMaintenanceForm','Are you sure you want to delete the selected topic?'), + translate('SongMaintenanceForm','This topic can\'t be deleted, it is currently ' 'assigned to at least one song.'), - self.trUtf8('No topic selected!')) + translate('SongMaintenanceForm','No topic selected!')) def onBookDeleteButtonClick(self): """ @@ -251,8 +252,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self._deleteItem( self.BooksListWidget, self.songmanager.get_book, self.songmanager.delete_book, self.resetBooks, - self.trUtf8('Delete Book'), - self.trUtf8('Are you sure you want to delete the selected book?'), - self.trUtf8('This book can\'t be deleted, it is currently ' + translate('SongMaintenanceForm','Delete Book'), + translate('SongMaintenanceForm','Are you sure you want to delete the selected book?'), + translate('SongMaintenanceForm','This book can\'t be deleted, it is currently ' 'assigned to at least one song.'), - self.trUtf8('No book selected!')) + translate('SongMaintenanceForm','No book selected!')) diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index 42ef220f4..a3d9690d7 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -26,6 +26,7 @@ from PyQt4 import QtGui from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog +from openlp.core.lib import translate class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): """ @@ -47,8 +48,8 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): def accept(self): if not self.NameEdit.text(): QtGui.QMessageBox.critical( - self, self.trUtf8('Error'), - self.trUtf8('You need to type in a topic name!'), + self, translate('TopicsForm','Error'), + translate('TopicsForm','You need to type in a topic name!'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.NameEdit.setFocus() return False diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6bcfa9f68..1d1a96623 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, SongXMLParser, \ - BaseListWithDnD, Receiver, ItemCapabilities + BaseListWithDnD, Receiver, ItemCapabilities, translate from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ ImportWizardForm @@ -60,7 +60,7 @@ class SongMediaItem(MediaManagerItem): self.remoteSong = -1 def initPluginNameVisible(self): - self.PluginNameVisible = self.trUtf8('Song') + self.PluginNameVisible = translate('mediaItem','Song') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -69,8 +69,8 @@ class SongMediaItem(MediaManagerItem): def addEndHeaderBar(self): self.addToolbarSeparator() ## Song Maintenance Button ## - self.addToolbarButton(self.trUtf8('Song Maintenance'), - self.trUtf8('Maintain the lists of authors, topics and books'), + self.addToolbarButton(translate('mediaItem','Song Maintenance'), + translate('mediaItem','Maintain the lists of authors, topics and books'), ':/songs/song_maintenance.png', self.onSongMaintenanceClick) self.PageLayout.setSpacing(4) self.SearchLayout = QtGui.QFormLayout() @@ -139,15 +139,15 @@ class SongMediaItem(MediaManagerItem): QtCore.QVariant(u'False')).toBool() def retranslateUi(self): - self.SearchTextLabel.setText(self.trUtf8('Search:')) - self.SearchTypeLabel.setText(self.trUtf8('Type:')) - self.ClearTextButton.setText(self.trUtf8('Clear')) - self.SearchTextButton.setText(self.trUtf8('Search')) + self.SearchTextLabel.setText(translate('mediaItem','Search:')) + self.SearchTypeLabel.setText(translate('mediaItem','Type:')) + self.ClearTextButton.setText(translate('mediaItem','Clear')) + self.SearchTextButton.setText(translate('mediaItem','Search')) def initialise(self): - self.SearchTypeComboBox.addItem(self.trUtf8('Titles')) - self.SearchTypeComboBox.addItem(self.trUtf8('Lyrics')) - self.SearchTypeComboBox.addItem(self.trUtf8('Authors')) + self.SearchTypeComboBox.addItem(translate('mediaItem','Titles')) + self.SearchTypeComboBox.addItem(translate('mediaItem','Lyrics')) + self.SearchTypeComboBox.addItem(translate('mediaItem','Authors')) self.configUpdated() def onSearchTextButtonClick(self): @@ -203,7 +203,7 @@ class SongMediaItem(MediaManagerItem): self.ListView.clear() for author in searchresults: for song in author.songs: - song_detail = unicode(self.trUtf8('%s (%s)' % \ + song_detail = unicode(translate('mediaItem','%s (%s)' % \ (unicode(author.display_name), unicode(song.title)))) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) @@ -281,12 +281,12 @@ class SongMediaItem(MediaManagerItem): items = self.ListView.selectedIndexes() if items: if len(items) == 1: - del_message = self.trUtf8('Delete song?') + del_message = translate('mediaItem','Delete song?') else: del_message = unicode( - self.trUtf8('Delete %d songs?')) % len(items) + translate('mediaItem','Delete %d songs?')) % len(items) ans = QtGui.QMessageBox.question(self, - self.trUtf8('Delete Confirmation'), del_message, + translate('mediaItem','Delete Confirmation'), del_message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok| QtGui.QMessageBox.Cancel), QtGui.QMessageBox.Ok) @@ -367,7 +367,7 @@ class SongMediaItem(MediaManagerItem): raw_footer.append(author_list) raw_footer.append(song.copyright ) raw_footer.append(unicode( - self.trUtf8('CCLI Licence: ') + ccli)) + translate('mediaItem','CCLI Licence: ') + ccli)) service_item.raw_footer = raw_footer service_item.audit = [ song.title, author_audit, song.copyright, song.ccli_number diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 38bdd791d..327105554 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab +from openlp.core.lib import SettingsTab, translate class SongsTab(SettingsTab): """ @@ -36,7 +36,7 @@ class SongsTab(SettingsTab): def setupUi(self): self.setObjectName(u'SongsTab') - self.tabTitleVisible = self.trUtf8('Songs') + self.tabTitleVisible = translate('SongsTab','Songs') self.SongsLayout = QtGui.QFormLayout(self) self.SongsLayout.setObjectName(u'SongsLayout') self.SongsModeGroupBox = QtGui.QGroupBox(self) @@ -61,11 +61,11 @@ class SongsTab(SettingsTab): self.SongBarActiveCheckBoxChanged) def retranslateUi(self): - self.SongsModeGroupBox.setTitle(self.trUtf8('Songs Mode')) + self.SongsModeGroupBox.setTitle(translate('SongsTab','Songs Mode')) self.SearchAsTypeCheckBox.setText( - self.trUtf8('Enable search as you type')) + translate('SongsTab','Enable search as you type')) self.SongBarActiveCheckBox.setText( - self.trUtf8('Display Verses on Live Tool bar')) + translate('SongsTab','Display Verses on Live Tool bar')) def onSearchAsTypeCheckBoxChanged(self, check_state): self.song_search = False diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index ef0aa0949..06f3b5656 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver +from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, translate from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \ SofImport, OooImport @@ -150,7 +150,7 @@ class SongsPlugin(Plugin): def onImportSofItemClick(self): filenames = QtGui.QFileDialog.getOpenFileNames( - None, self.trUtf8('Open Songs of Fellowship file'), + None, translate('Songsplugin','Open Songs of Fellowship file'), u'', u'Songs of Fellowship file (*.rtf *.RTF)') try: for filename in filenames: @@ -170,14 +170,14 @@ class SongsPlugin(Plugin): def onImportOooItemClick(self): filenames = QtGui.QFileDialog.getOpenFileNames( - None, self.trUtf8('Open documents or presentations'), + None, translate('Songsplugin','Open documents or presentations'), u'', u'All Files(*.*)') oooimport = OooImport(self.manager) oooimport.import_docs(filenames) Receiver.send_message(u'songs_load_list') def about(self): - about_text = self.trUtf8('Song Plugin
' + about_text = translate('Songsplugin','Song Plugin
' 'This plugin allows songs to be managed and displayed.') return about_text diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index 207670709..a494dd49f 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -26,6 +26,7 @@ from PyQt4 import QtGui from songusagedeletedialog import Ui_SongUsageDeleteDialog +from openlp.core.lib import translate class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog): """ @@ -41,8 +42,8 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog): def accept(self): ret = QtGui.QMessageBox.question(self, - self.trUtf8('Delete Selected Song Usage Events?'), - self.trUtf8('Are you sure you want to delete selected Song Usage data?'), + translate('SongUsageDeleteForm','Delete Selected Song Usage Events?'), + translate('SongUsageDeleteForm','Are you sure you want to delete selected Song Usage data?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel), diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 21d6d29c5..7a39480b6 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -28,7 +28,7 @@ import os from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsManager +from openlp.core.lib import SettingsManager, translate from songusagedetaildialog import Ui_SongUsageDetailDialog @@ -61,7 +61,7 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): def defineOutputLocation(self): path = QtGui.QFileDialog.getExistingDirectory(self, - self.trUtf8('Output File Location'), + translate('SongUsageDetailForm','Output File Location'), SettingsManager.get_last_dir(self.parent.settingsSection, 1)) path = unicode(path) if path != u'': diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index 10899914c..c05562428 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, Receiver, build_icon +from openlp.core.lib import Plugin, Receiver, build_icon, translate from openlp.plugins.songusage.lib import SongUsageManager from openlp.plugins.songusage.forms import SongUsageDetailForm, \ SongUsageDeleteForm @@ -156,7 +156,7 @@ class SongUsagePlugin(Plugin): self.SongUsagedetailform.exec_() def about(self): - about_text = self.trUtf8('SongUsage Plugin
This plugin ' + about_text = translate('SongUsagePlugin','SongUsage Plugin
This plugin ' 'records the use of songs and when they have been used during ' 'a live service') return about_text From e88c05bd58c578d1f224f0497339613247536baf Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 11:52:11 +0200 Subject: [PATCH 02/17] Added unicon symbol to all arguments in the translate() function. And fixed missing "spaces" and other smal error regarding the coding standar --- openlp/core/ui/aboutform.py | 2 +- openlp/core/ui/amendthemeform.py | 12 +- openlp/core/ui/displaytab.py | 26 ++--- openlp/core/ui/generaltab.py | 42 ++++--- openlp/core/ui/mainwindow.py | 183 +++++++++++++++--------------- openlp/core/ui/servicemanager.py | 108 +++++++++++------- openlp/core/ui/slidecontroller.py | 74 +++++++----- openlp/core/ui/splashscreen.py | 2 +- openlp/core/ui/thememanager.py | 76 +++++++------ openlp/core/ui/themestab.py | 37 +++--- 10 files changed, 317 insertions(+), 245 deletions(-) diff --git a/openlp/core/ui/aboutform.py b/openlp/core/ui/aboutform.py index 97e286820..c5994a9ec 100644 --- a/openlp/core/ui/aboutform.py +++ b/openlp/core/ui/aboutform.py @@ -44,7 +44,7 @@ class AboutForm(QtGui.QDialog, Ui_AboutDialog): about_text = about_text.replace(u'', self.applicationVersion[u'version']) if self.applicationVersion[u'build']: - build_text = u' %s %s' % (translate('AboutForm','build'), + build_text = u' %s %s' % (translate(u'AboutForm', u'build'), self.applicationVersion[u'build']) else: build_text = u'' diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index fb21fb36b..34a24046a 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -210,8 +210,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def onImageToolButtonClicked(self): filename = QtGui.QFileDialog.getOpenFileName( - self, translate('AmendThemeForm',u'Open file')) - if filename: + self, translate(u'AmendThemeForm', u'Open file')) + if filename:0 self.ImageLineEdit.setText(filename) self.theme.background_filename = filename self.previewTheme() @@ -629,7 +629,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): if theme.background_type == u'solid': self.Color1PushButton.setStyleSheet( u'background-color: %s' % unicode(theme.background_color)) - self.Color1Label.setText(translate('AmendThemeForm','Background Color:')) + self.Color1Label.setText(translate(u'AmendThemeForm', u'Background Color:')) self.Color1Label.setVisible(True) self.Color1PushButton.setVisible(True) self.Color2Label.setVisible(False) @@ -644,8 +644,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): % unicode(theme.background_startColor)) self.Color2PushButton.setStyleSheet(u'background-color: %s' \ % unicode(theme.background_endColor)) - self.Color1Label.setText(translate('AmendThemeForm','First Color:')) - self.Color2Label.setText(translate('AmendThemeForm','Second Color:')) + self.Color1Label.setText(translate(u'AmendThemeForm', u'First Color:')) + self.Color2Label.setText(translate(u'AmendThemeForm', u'Second Color:')) self.Color1Label.setVisible(True) self.Color1PushButton.setVisible(True) self.Color2Label.setVisible(True) @@ -713,7 +713,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): log.debug(u'Page Length area height %s, metrics %s, lines %s' % (self.FontMainHeightSpinBox.value(), metrics.height(), page_length)) - page_length_text = unicode(translate('AmendThemeForm','Slide Height is %s rows')) + page_length_text = unicode(translate(u'AmendThemeForm', u'Slide Height is %s rows')) self.FontMainLinesPageLabel.setText(page_length_text % page_length) frame = self.thememanager.generateImage(self.theme) self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) diff --git a/openlp/core/ui/displaytab.py b/openlp/core/ui/displaytab.py index 026007d2b..6c970bda3 100644 --- a/openlp/core/ui/displaytab.py +++ b/openlp/core/ui/displaytab.py @@ -39,7 +39,7 @@ class DisplayTab(SettingsTab): SettingsTab.__init__(self, u'Display') def setupUi(self): - self.tabTitleVisible = translate('DisplayTab','Displays') + self.tabTitleVisible = translate(u'DisplayTab', u'Displays') self.layoutWidget = QtGui.QWidget(self) self.layoutWidget.setGeometry(QtCore.QRect(0, 40, 241, 79)) self.layoutWidget.setObjectName(u'layoutWidget') @@ -159,22 +159,22 @@ class DisplayTab(SettingsTab): self.onOverrideCheckBoxChanged) def retranslateUi(self): - self.setWindowTitle( translate('DisplayTab',u'Amend Display Settings')) - self.CurrentGroupBox.setTitle( translate('DisplayTab',u'Default Settings')) - self.XLabel.setText(translate('DisplayTab',u'X')) + self.setWindowTitle(translate(u'DisplayTab', u'Amend Display Settings')) + self.CurrentGroupBox.setTitle(translate(u'DisplayTab', u'Default Settings')) + self.XLabel.setText(translate(u'DisplayTab', u'X')) self.Xpos.setText(u'0') - self.YLabel.setText( translate('DisplayTab',u'Y')) + self.YLabel.setText(translate(u'DisplayTab', u'Y')) self.Ypos.setText(u'0') - self.HeightLabel.setText( translate('DisplayTab',u'Height')) + self.HeightLabel.setText(translate(u'DisplayTab', u'Height')) self.Height.setText(u'0') - self.WidthLabel.setText( translate('DisplayTab',u'Width')) + self.WidthLabel.setText(translate(u'DisplayTab', u'Width')) self.Width.setText(u'0') - self.CurrentGroupBox_2.setTitle( translate('DisplayTab',u'Amend Settings')) - self.XAmendLabel.setText( translate('DisplayTab',u'X')) - self.YAmendLabel.setText( translate('DisplayTab',u'Y')) - self.HeightAmendLabel.setText( translate('DisplayTab',u'Height')) - self.WidthAmendLabel.setText( translate('DisplayTab',u'Width')) - self.OverrideCheckBox.setText( translate('DisplayTab',u'Override Output Display')) + self.CurrentGroupBox_2.setTitle(translate(u'DisplayTab', u'Amend Settings')) + self.XAmendLabel.setText(translate(u'DisplayTab', u'X')) + self.YAmendLabel.setText(translate(u'DisplayTab', u'Y')) + self.HeightAmendLabel.setText(translate(u'DisplayTab', u'Height')) + self.WidthAmendLabel.setText(translate(u'DisplayTab', u'Width')) + self.OverrideCheckBox.setText(translate(u'DisplayTab', u'Override Output Display')) def load(self): settings = QtCore.QSettings() diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 2856b6558..ae63f739f 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -54,7 +54,7 @@ class GeneralTab(SettingsTab): def setupUi(self): self.setObjectName(u'GeneralTab') - self.tabTitleVisible = translate('GeneralTab','General') + self.tabTitleVisible = translate(u'GeneralTab', u'General') self.GeneralLayout = QtGui.QHBoxLayout(self) self.GeneralLayout.setSpacing(8) self.GeneralLayout.setMargin(8) @@ -177,25 +177,32 @@ class GeneralTab(SettingsTab): QtCore.SIGNAL(u'editingFinished()'), self.onPasswordEditLostFocus) def retranslateUi(self): - self.MonitorGroupBox.setTitle(translate('GeneralTab','Monitors')) + self.MonitorGroupBox.setTitle(translate(u'GeneralTab', u'Monitors')) self.MonitorLabel.setText( - translate('GeneralTab','Select monitor for output display:')) + translate(u'GeneralTab', u'Select monitor for output display:')) self.DisplayOnMonitorCheck.setText( - translate('GeneralTab','Display if a single screen')) - self.StartupGroupBox.setTitle(translate('GeneralTab','Application Startup')) - self.WarningCheckBox.setText(translate('GeneralTab','Show blank screen warning')) + translate(u'GeneralTab', u'Display if a single screen')) + self.StartupGroupBox.setTitle( + translate(u'GeneralTab', u'Application Startup')) + self.WarningCheckBox.setText( + translate(u'GeneralTab', u'Show blank screen warning')) self.AutoOpenCheckBox.setText( - translate('GeneralTab','Automatically open the last service')) - self.ShowSplashCheckBox.setText(translate('GeneralTab','Show the splash screen')) - self.SettingsGroupBox.setTitle(translate('GeneralTab','Application Settings')) + translate(u'GeneralTab', u'Automatically open the last service')) + self.ShowSplashCheckBox.setText( + translate(u'GeneralTab', u'Show the splash screen')) + self.SettingsGroupBox.setTitle( + translate(u'GeneralTab', u'Application Settings')) self.SaveCheckServiceCheckBox.setText( - translate('GeneralTab','Prompt to save Service before starting New')) + translate(u'GeneralTab', + u'Prompt to save Service before starting New')) self.AutoPreviewCheckBox.setText( - translate('GeneralTab','Preview Next Song from Service Manager')) - self.CCLIGroupBox.setTitle(translate('GeneralTab','CCLI Details')) - self.NumberLabel.setText(translate('GeneralTab','CCLI Number:')) - self.UsernameLabel.setText(translate('GeneralTab','SongSelect Username:')) - self.PasswordLabel.setText(translate('GeneralTab','SongSelect Password:')) + translate(u'GeneralTab', u'Preview Next Song from Service Manager')) + self.CCLIGroupBox.setTitle(translate(u'GeneralTab', u'CCLI Details')) + self.NumberLabel.setText(translate(u'GeneralTab', u'CCLI Number:')) + self.UsernameLabel.setText( + translate(u'GeneralTab', u'SongSelect Username:')) + self.PasswordLabel.setText( + translate(u'GeneralTab', u'SongSelect Password:')) def onMonitorComboBoxChanged(self): self.MonitorNumber = self.MonitorComboBox.currentIndex() @@ -231,10 +238,11 @@ class GeneralTab(SettingsTab): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) for screen in self.screens.screen_list: - screen_name = u'%s %d' % (translate('GeneralTab','Screen'), + screen_name = u'%s %d' % (translate(u'GeneralTab', u'Screen'), screen[u'number'] + 1) if screen[u'primary']: - screen_name = u'%s (%s)' % (screen_name, translate('GeneralTab','primary')) + screen_name = u'%s (%s)' % (screen_name, + translate(u'GeneralTab', u'primary')) self.MonitorComboBox.addItem(screen_name) # Get the configs self.Warning = settings.value( diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 716bfbabb..115af6f58 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -33,7 +33,8 @@ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, DisplayManager from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \ SettingsManager, PluginManager, Receiver, translate -from openlp.core.utils import check_latest_version, AppLocation, add_actions, LanguageManager +from openlp.core.utils import check_latest_version, AppLocation, add_actions, \ + LanguageManager log = logging.getLogger(__name__) @@ -352,111 +353,113 @@ class Ui_MainWindow(object): """ Set up the translation system """ - MainWindow.mainTitle = translate('MainWindow', 'OpenLP 2.0') - MainWindow.language = translate('MainWindow', 'English') - MainWindow.defaultThemeText = translate('MainWindow', - 'Default Theme: ') + MainWindow.mainTitle = translate(u'MainWindow', u'OpenLP 2.0') + MainWindow.language = translate(u'MainWindow', u'English') + MainWindow.defaultThemeText = translate(u'MainWindow', + u'Default Theme: ') MainWindow.setWindowTitle(MainWindow.mainTitle) - self.FileMenu.setTitle(translate('MainWindow', '&File')) - self.FileImportMenu.setTitle(translate('MainWindow', '&Import')) - self.FileExportMenu.setTitle(translate('MainWindow', '&Export')) - self.OptionsMenu.setTitle(translate('MainWindow', '&Options')) - self.OptionsViewMenu.setTitle(translate('MainWindow', '&View')) - self.ViewModeMenu.setTitle(translate('MainWindow', 'M&ode')) - self.OptionsLanguageMenu.setTitle(translate('MainWindow', + self.FileMenu.setTitle(translate(u'MainWindow', u'&File')) + self.FileImportMenu.setTitle(translate(u'MainWindow', u'&Import')) + self.FileExportMenu.setTitle(translate(u'MainWindow', u'&Export')) + self.OptionsMenu.setTitle(translate(u'MainWindow', u'&Options')) + self.OptionsViewMenu.setTitle(translate(u'MainWindow', u'&View')) + self.ViewModeMenu.setTitle(translate(u'MainWindow', u'M&ode')) + self.OptionsLanguageMenu.setTitle(translate(u'MainWindow', u'&Language')) - self.ToolsMenu.setTitle(translate('MainWindow', '&Tools')) - self.HelpMenu.setTitle(translate('MainWindow', '&Help')) + self.ToolsMenu.setTitle(translate(u'MainWindow', u'&Tools')) + self.HelpMenu.setTitle(translate(u'MainWindow', u'&Help')) self.MediaManagerDock.setWindowTitle( - translate('MainWindow', 'Media Manager')) + translate(u'MainWindow', u'Media Manager')) self.ServiceManagerDock.setWindowTitle( - translate('MainWindow', 'Service Manager')) + translate(u'MainWindow', u'Service Manager')) self.ThemeManagerDock.setWindowTitle( - translate('MainWindow', 'Theme Manager')) - self.FileNewItem.setText(translate('MainWindow', '&New')) - self.FileNewItem.setToolTip(translate('MainWindow', 'New Service')) + translate(u'MainWindow', u'Theme Manager')) + self.FileNewItem.setText(translate(u'MainWindow', u'&New')) + self.FileNewItem.setToolTip(translate(u'MainWindow', u'New Service')) self.FileNewItem.setStatusTip( - translate('MainWindow', 'Create a new Service')) - self.FileNewItem.setShortcut(translate('MainWindow', 'Ctrl+N')) - self.FileOpenItem.setText(translate('MainWindow', '&Open')) - self.FileOpenItem.setToolTip(translate('MainWindow', 'Open Service')) + translate(u'MainWindow', u'Create a new Service')) + self.FileNewItem.setShortcut(translate(u'MainWindow', u'Ctrl+N')) + self.FileOpenItem.setText(translate(u'MainWindow', u'&Open')) + self.FileOpenItem.setToolTip(translate(u'MainWindow', u'Open Service')) self.FileOpenItem.setStatusTip( - translate('MainWindow', 'Open an existing service')) - self.FileOpenItem.setShortcut(translate('MainWindow', 'Ctrl+O')) - self.FileSaveItem.setText(translate('MainWindow', '&Save')) - self.FileSaveItem.setToolTip(translate('MainWindow', 'Save Service')) + translate(u'MainWindow', u'Open an existing service')) + self.FileOpenItem.setShortcut(translate(u'MainWindow', u'Ctrl+O')) + self.FileSaveItem.setText(translate(u'MainWindow', u'&Save')) + self.FileSaveItem.setToolTip(translate(u'MainWindow', u'Save Service')) self.FileSaveItem.setStatusTip( - translate('MainWindow', 'Save the current service to disk')) - self.FileSaveItem.setShortcut(translate('MainWindow', 'Ctrl+S')) - self.FileSaveAsItem.setText(translate('MainWindow', 'Save &As...')) + translate(u'MainWindow', u'Save the current service to disk')) + self.FileSaveItem.setShortcut(translate(u'MainWindow', u'Ctrl+S')) + self.FileSaveAsItem.setText(translate(u'MainWindow', u'Save &As...')) self.FileSaveAsItem.setToolTip( - translate('MainWindow', 'Save Service As')) - self.FileSaveAsItem.setStatusTip(translate('MainWindow', - 'Save the current service under a new name')) - self.FileSaveAsItem.setShortcut(translate('MainWindow', 'F12')) - self.FileExitItem.setText(translate('MainWindow', 'E&xit')) - self.FileExitItem.setStatusTip(translate('MainWindow', 'Quit OpenLP')) - self.FileExitItem.setShortcut(translate('MainWindow', 'Alt+F4')) - self.ImportThemeItem.setText(translate('MainWindow', '&Theme')) - self.ImportLanguageItem.setText(translate('MainWindow', '&Language')) - self.ExportThemeItem.setText(translate('MainWindow', '&Theme')) - self.ExportLanguageItem.setText(translate('MainWindow', '&Language')) - self.actionLook_Feel.setText(translate('MainWindow', 'Look && &Feel')) - self.OptionsSettingsItem.setText(translate('MainWindow', '&Settings')) + translate(u'MainWindow', u'Save Service As')) + self.FileSaveAsItem.setStatusTip(translate(u'MainWindow', + u'Save the current service under a new name')) + self.FileSaveAsItem.setShortcut(translate(u'MainWindow', u'F12')) + self.FileExitItem.setText(translate(u'MainWindow', u'E&xit')) + self.FileExitItem.setStatusTip(translate(u'MainWindow', u'Quit OpenLP')) + self.FileExitItem.setShortcut(translate(u'MainWindow', u'Alt+F4')) + self.ImportThemeItem.setText(translate(u'MainWindow', u'&Theme')) + self.ImportLanguageItem.setText(translate(u'MainWindow', u'&Language')) + self.ExportThemeItem.setText(translate(u'MainWindow', u'&Theme')) + self.ExportLanguageItem.setText(translate(u'MainWindow', u'&Language')) + self.actionLook_Feel.setText(translate(u'MainWindow', u'Look && &Feel')) + self.OptionsSettingsItem.setText(translate(u'MainWindow', u'&Settings')) self.ViewMediaManagerItem.setText( - translate('MainWindow', '&Media Manager')) + translate(u'MainWindow', u'&Media Manager')) self.ViewMediaManagerItem.setToolTip( - translate('MainWindow', 'Toggle Media Manager')) - self.ViewMediaManagerItem.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Media Manager')) - self.ViewMediaManagerItem.setShortcut(translate('MainWindow', 'F8')) + translate(u'MainWindow', u'Toggle Media Manager')) + self.ViewMediaManagerItem.setStatusTip(translate(u'MainWindow', + u'Toggle the visibility of the Media Manager')) + self.ViewMediaManagerItem.setShortcut(translate(u'MainWindow', u'F8')) self.ViewThemeManagerItem.setText( - translate('MainWindow', '&Theme Manager')) + translate(u'MainWindow', u'&Theme Manager')) self.ViewThemeManagerItem.setToolTip( - translate('MainWindow', 'Toggle Theme Manager')) - self.ViewThemeManagerItem.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Theme Manager')) - self.ViewThemeManagerItem.setShortcut(translate('MainWindow', 'F10')) + translate(u'MainWindow', u'Toggle Theme Manager')) + self.ViewThemeManagerItem.setStatusTip(translate(u'MainWindow', + u'Toggle the visibility of the Theme Manager')) + self.ViewThemeManagerItem.setShortcut(translate(u'MainWindow', u'F10')) self.ViewServiceManagerItem.setText( - translate('MainWindow', '&Service Manager')) + translate(u'MainWindow', u'&Service Manager')) self.ViewServiceManagerItem.setToolTip( - translate('MainWindow', 'Toggle Service Manager')) - self.ViewServiceManagerItem.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Service Manager')) - self.ViewServiceManagerItem.setShortcut(translate('MainWindow', 'F9')) + translate(u'MainWindow', u'Toggle Service Manager')) + self.ViewServiceManagerItem.setStatusTip(translate(u'MainWindow', + u'Toggle the visibility of the Service Manager')) + self.ViewServiceManagerItem.setShortcut(translate(u'MainWindow', u'F9')) self.action_Preview_Panel.setText( - translate('MainWindow', '&Preview Panel')) + translate(u'MainWindow', u'&Preview Panel')) self.action_Preview_Panel.setToolTip( - translate('MainWindow', 'Toggle Preview Panel')) - self.action_Preview_Panel.setStatusTip(translate('MainWindow', - 'Toggle the visibility of the Preview Panel')) - self.action_Preview_Panel.setShortcut(translate('MainWindow', 'F11')) - self.PluginItem.setText(translate('MainWindow', '&Plugin List')) + translate(u'MainWindow', u'Toggle Preview Panel')) + self.action_Preview_Panel.setStatusTip(translate(u'MainWindow', + u'Toggle the visibility of the Preview Panel')) + self.action_Preview_Panel.setShortcut(translate(u'MainWindow', u'F11')) + self.PluginItem.setText(translate(u'MainWindow', u'&Plugin List')) self.PluginItem.setStatusTip( - translate('MainWindow', 'List the Plugins')) - self.PluginItem.setShortcut(translate('MainWindow', 'Alt+F7')) + translate(u'MainWindow', u'List the Plugins')) + self.PluginItem.setShortcut(translate(u'MainWindow', u'Alt+F7')) self.HelpDocumentationItem.setText( - translate('MainWindow', '&User Guide')) - self.HelpAboutItem.setText(translate('MainWindow', '&About')) + translate(u'MainWindow', u'&User Guide')) + self.HelpAboutItem.setText(translate(u'MainWindow', u'&About')) self.HelpAboutItem.setStatusTip( - translate('MainWindow', 'More information about OpenLP')) - self.HelpAboutItem.setShortcut(translate('MainWindow', 'Ctrl+F1')) - self.HelpOnlineHelpItem.setText(translate('MainWindow', '&Online Help')) - self.HelpWebSiteItem.setText(translate('MainWindow', '&Web Site')) + translate(u'MainWindow', u'More information about OpenLP')) + self.HelpAboutItem.setShortcut(translate(u'MainWindow', u'Ctrl+F1')) + self.HelpOnlineHelpItem.setText( + translate(u'MainWindow', u'&Online Help')) + self.HelpWebSiteItem.setText(translate(u'MainWindow', u'&Web Site')) #i18n - self.AutoLanguageItem.setText(translate('MainWindow', '&Auto Detect')) + self.AutoLanguageItem.setText(translate(u'MainWindow', u'&Auto Detect')) self.AutoLanguageItem.setStatusTip( - translate('MainWindow', 'Choose System language, if available')) + translate(u'MainWindow', u'Choose System language, if available')) for item in self.LanguageGroup.actions(): item.setText(item.objectName()) - item.setStatusTip(translate('MainWindow', - 'Set the interface language to %1').arg(item.objectName())) - self.ToolsAddToolItem.setText(translate('MainWindow', 'Add &Tool...')) + item.setStatusTip(translate(u'MainWindow', + u'Set the interface language to %1').arg(item.objectName())) + self.ToolsAddToolItem.setText(translate(u'MainWindow', u'Add &Tool...')) self.ToolsAddToolItem.setStatusTip( - translate('MainWindow', 'Add an application to the list of tools')) + translate(u'MainWindow', + u'Add an application to the list of tools')) self.action_Preview_Panel.setText( - translate('MainWindow', '&Preview Pane')) - self.ModeLiveItem.setText(translate('MainWindow', '&Live')) + translate(u'MainWindow', u'&Preview Pane')) + self.ModeLiveItem.setText(translate(u'MainWindow', u'&Live')) class MainWindow(QtGui.QMainWindow, Ui_MainWindow): @@ -616,11 +619,12 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): Triggered by delay thread. """ app_version = self.applicationVersion[u'full'] - version_text = unicode(translate('MainWindow','Version %s of OpenLP is now ' - 'available for download (you are currently running version %s).' - '\n\nYou can download the latest version from http://openlp.org')) + version_text = unicode(translate(u'MainWindow', u'Version %s of OpenLP ' + u'is now available for download (you are currently running version ' + u' %s). \n\nYou can download the latest version from ' + u'http://openlp.org')) QtGui.QMessageBox.question(self, - translate('MainWindow','OpenLP Version Updated'), + translate(u'MainWindow', u'OpenLP Version Updated'), version_text % (version, app_version), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) @@ -651,8 +655,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): and settings.value(u'blank warning', QtCore.QVariant(False)).toBool(): self.LiveController.onBlankDisplay(True) QtGui.QMessageBox.question(self, - translate('MainWindow','OpenLP Main Display Blanked'), - translate('MainWindow','The Main Display has been blanked out'), + translate(u'MainWindow', u'OpenLP Main Display Blanked'), + translate(u'MainWindow', + u'The Main Display has been blanked out'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) settings.endGroup() @@ -707,9 +712,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): """ if self.serviceNotSaved: ret = QtGui.QMessageBox.question(self, - translate('MainWindow','Save Changes to Service?'), - translate('MainWindow','Your service has changed. ' - 'Do you want to save those changes?'), + translate(u'MainWindow', u'Save Changes to Service?'), + translate(u'MainWindow', u'Your service has changed. ' + u'Do you want to save those changes?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Cancel | QtGui.QMessageBox.Discard | diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index c4f55c28f..d6e8aaa9c 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -114,21 +114,27 @@ class ServiceManager(QtGui.QWidget): # Create the top toolbar self.Toolbar = OpenLPToolbar(self) self.Toolbar.addToolbarButton( - translate('ServiceManager','New Service'), u':/general/general_new.png', - translate('ServiceManager','Create a new service'), self.onNewService) + translate(u'ServiceManager', u'New Service'), + u':/general/general_new.png', + translate(u'ServiceManager', u'Create a new service'), + self.onNewService) self.Toolbar.addToolbarButton( - translate('ServiceManager','Open Service'), u':/general/general_open.png', - translate('ServiceManager','Load an existing service'), self.onLoadService) + translate(u'ServiceManager', u'Open Service'), + u':/general/general_open.png', + translate(u'ServiceManager', u'Load an existing service'), + self.onLoadService) self.Toolbar.addToolbarButton( - translate('ServiceManager','Save Service'), u':/general/general_save.png', - translate('ServiceManager','Save this service'), self.onSaveService) + translate(u'ServiceManager', u'Save Service'), + u':/general/general_save.png', + translate(u'ServiceManager', u'Save this service'), + self.onSaveService) self.Toolbar.addSeparator() - self.ThemeLabel = QtGui.QLabel(translate('ServiceManager','Theme:'), + self.ThemeLabel = QtGui.QLabel(translate(u'ServiceManager', u'Theme:'), self) self.ThemeLabel.setMargin(3) self.Toolbar.addWidget(self.ThemeLabel) self.ThemeComboBox = QtGui.QComboBox(self.Toolbar) - self.ThemeComboBox.setToolTip(translate('ServiceManager', + self.ThemeComboBox.setToolTip(translate(u'ServiceManager', u'Select a theme for the service')) self.ThemeComboBox.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToContents) @@ -159,21 +165,29 @@ class ServiceManager(QtGui.QWidget): # Add the bottom toolbar self.OrderToolbar = OpenLPToolbar(self) self.OrderToolbar.addToolbarButton( - translate('ServiceManager','Move to &top'), u':/services/service_top.png', - translate('ServiceManager','Move to top'), self.onServiceTop) + translate(u'ServiceManager', u'Move to &top'), + u':/services/service_top.png', + translate(u'ServiceManager', u'Move to top'), self.onServiceTop) self.OrderToolbar.addToolbarButton( - translate('ServiceManager','Move &up'), u':/services/service_up.png', - translate('ServiceManager','Move up order'), self.onServiceUp) + translate(u'ServiceManager', u'Move &up'), + u':/services/service_up.png', + translate(u'ServiceManager', u'Move up order'), self.onServiceUp) self.OrderToolbar.addToolbarButton( - translate('ServiceManager','Move &down'), u':/services/service_down.png', - translate('ServiceManager','Move down order'), self.onServiceDown) + translate(u'ServiceManager', u'Move &down'), + u':/services/service_down.png', + translate(u'ServiceManager', u'Move down order'), + self.onServiceDown) self.OrderToolbar.addToolbarButton( - translate('ServiceManager','Move to &bottom'), u':/services/service_bottom.png', - translate('ServiceManager','Move to end'), self.onServiceEnd) + translate(u'ServiceManager', u'Move to &bottom'), + u':/services/service_bottom.png', + translate(u'ServiceManager', u'Move to end'), + self.onServiceEnd) self.OrderToolbar.addSeparator() self.OrderToolbar.addToolbarButton( - translate('ServiceManager','&Delete From Service'), u':/general/general_delete.png', - translate('ServiceManager','Delete From Service'), self.onDeleteFromService) + translate(u'ServiceManager', u'&Delete From Service'), + u':/general/general_delete.png', + translate(u'ServiceManager', u'Delete From Service'), + self.onDeleteFromService) self.Layout.addWidget(self.OrderToolbar) # Connect up our signals and slots QtCore.QObject.connect(self.ThemeComboBox, @@ -203,30 +217,38 @@ class ServiceManager(QtGui.QWidget): self.servicePath = AppLocation.get_section_data_path(u'servicemanager') #build the drag and drop context menu self.dndMenu = QtGui.QMenu() - self.newAction = self.dndMenu.addAction(translate('ServiceManager','&Add New Item')) + self.newAction = self.dndMenu.addAction( + translate(u'ServiceManager', u'&Add New Item')) self.newAction.setIcon(build_icon(u':/general/general_edit.png')) - self.addToAction = self.dndMenu.addAction(translate('ServiceManager','&Add to Selected Item')) + self.addToAction = self.dndMenu.addAction( + translate(u'ServiceManager', u'&Add to Selected Item')) self.addToAction.setIcon(build_icon(u':/general/general_edit.png')) #build the context menu self.menu = QtGui.QMenu() - self.editAction = self.menu.addAction(translate('ServiceManager','&Edit Item')) + self.editAction = self.menu.addAction( + translate(u'ServiceManager', u'&Edit Item')) self.editAction.setIcon(build_icon(u':/general/general_edit.png')) - self.maintainAction = self.menu.addAction(translate('ServiceManager','&Maintain Item')) + self.maintainAction = self.menu.addAction( + translate(u'ServiceManager', u'&Maintain Item')) self.maintainAction.setIcon(build_icon(u':/general/general_edit.png')) - self.notesAction = self.menu.addAction(translate('ServiceManager','&Notes')) + self.notesAction = self.menu.addAction( + translate(u'ServiceManager', u'&Notes')) self.notesAction.setIcon(build_icon(u':/services/service_notes.png')) self.deleteAction = self.menu.addAction( - translate('ServiceManager','&Delete From Service')) + translate(u'ServiceManager', u'&Delete From Service')) self.deleteAction.setIcon(build_icon(u':/general/general_delete.png')) self.sep1 = self.menu.addAction(u'') self.sep1.setSeparator(True) - self.previewAction = self.menu.addAction(translate('ServiceManager','&Preview Verse')) + self.previewAction = self.menu.addAction( + translate(u'ServiceManager', u'&Preview Verse')) self.previewAction.setIcon(build_icon(u':/general/general_preview.png')) - self.liveAction = self.menu.addAction(translate('ServiceManager','&Live Verse')) + self.liveAction = self.menu.addAction( + translate(u'ServiceManager', u'&Live Verse')) self.liveAction.setIcon(build_icon(u':/general/general_live.png')) self.sep2 = self.menu.addAction(u'') self.sep2.setSeparator(True) - self.themeMenu = QtGui.QMenu(translate('ServiceManager',u'&Change Item Theme')) + self.themeMenu = QtGui.QMenu( + translate(u'ServiceManager', u'&Change Item Theme')) self.menu.addMenu(self.themeMenu) def supportedSuffixes(self, suffix): @@ -458,9 +480,10 @@ class ServiceManager(QtGui.QWidget): self.parent.generalSettingsSection + u'/save prompt', QtCore.QVariant(False)).toBool(): ret = QtGui.QMessageBox.question(self, - translate('ServiceManager','Save Changes to Service?'), - translate('ServiceManager','Your service is unsaved, do you want to save ' - 'those changes before creating a new one?'), + translate(u'ServiceManager', u'Save Changes to Service?'), + translate(u'ServiceManager', + u'Your service is unsaved, do you want to save ' + u'those changes before creating a new one?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Cancel | QtGui.QMessageBox.Save), @@ -542,9 +565,9 @@ class ServiceManager(QtGui.QWidget): log.debug(u'onSaveService') if not quick or self.isNew: filename = QtGui.QFileDialog.getSaveFileName(self, - translate('ServiceManager',u'Save Service'), + translate(u'ServiceManager', u'Save Service'), SettingsManager.get_last_dir(self.parent.serviceSettingsSection), - translate('ServiceManager',u'OpenLP Service Files (*.osz)')) + translate(u'ServiceManager', u'OpenLP Service Files (*.osz)')) else: filename = SettingsManager.get_last_dir( self.parent.serviceSettingsSection) @@ -601,7 +624,7 @@ class ServiceManager(QtGui.QWidget): self.parent.serviceSettingsSection) else: filename = QtGui.QFileDialog.getOpenFileName( - self, translate('ServiceManager','Open Service'), + self, translate(u'ServiceManager', u'Open Service'), SettingsManager.get_last_dir( self.parent.serviceSettingsSection), u'Services (*.osz)') self.loadService(filename) @@ -614,9 +637,10 @@ class ServiceManager(QtGui.QWidget): """ if self.parent.serviceNotSaved: ret = QtGui.QMessageBox.question(self, - translate('ServiceManager','Save Changes to Service?'), - translate('ServiceManager','Your current service is unsaved, do you want to ' - 'save the changes before opening a new one?'), + translate(u'ServiceManager', u'Save Changes to Service?'), + translate(u'ServiceManager', + u'Your current service is unsaved, do you want to ' + u'save the changes before opening a new one?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Discard | QtGui.QMessageBox.Save), @@ -778,9 +802,9 @@ class ServiceManager(QtGui.QWidget): self.serviceItems[item][u'service_item'], count) else: QtGui.QMessageBox.critical(self, - translate('ServiceManager','Missing Display Handler'), - translate('ServiceManager','Your item cannot be displayed as ' - 'there is no handler to display it'), + translate(u'ServiceManager', u'Missing Display Handler'), + translate(u'ServiceManager', u'Your item cannot be displayed ' + u'as there is no handler to display it'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) @@ -814,9 +838,9 @@ class ServiceManager(QtGui.QWidget): self.serviceItems[item][u'service_item'], 0) else: QtGui.QMessageBox.critical(self, - translate('ServiceManager','Missing Display Handler'), - translate('ServiceManager','Your item cannot be displayed as ' - 'there is no handler to display it'), + translate(u'ServiceManager', u'Missing Display Handler'), + translate(u'ServiceManager', u'Your item cannot be displayed ' + u'as there is no handler to display it'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 581b23338..cc144ab24 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -127,11 +127,11 @@ class SlideController(QtGui.QWidget): # Type label for the top of the slide controller self.TypeLabel = QtGui.QLabel(self.Panel) if self.isLive: - self.TypeLabel.setText(translate('SlideController','Live')) + self.TypeLabel.setText(translate(u'SlideController', u'Live')) self.split = 1 self.typePrefix = u'live' else: - self.TypeLabel.setText(translate('SlideController','Preview')) + self.TypeLabel.setText(translate(u'SlideController', u'Preview')) self.split = 0 self.typePrefix = u'preview' self.TypeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') @@ -178,75 +178,92 @@ class SlideController(QtGui.QWidget): if self.isLive: self.Toolbar.addToolbarButton( u'First Slide', u':/slides/slide_first.png', - translate('SlideController','Move to first'), self.onSlideSelectedFirst) + translate(u'SlideController', u'Move to first'), + self.onSlideSelectedFirst) self.Toolbar.addToolbarButton( u'Previous Slide', u':/slides/slide_previous.png', - translate('SlideController','Move to previous'), self.onSlideSelectedPrevious) + translate(u'SlideController', u'Move to previous'), + self.onSlideSelectedPrevious) self.Toolbar.addToolbarButton( u'Next Slide', u':/slides/slide_next.png', - translate('SlideController','Move to next'), self.onSlideSelectedNext) + translate(u'SlideController', u'Move to next'), + self.onSlideSelectedNext) if self.isLive: self.Toolbar.addToolbarButton( u'Last Slide', u':/slides/slide_last.png', - translate('SlideController','Move to last'), self.onSlideSelectedLast) + translate(u'SlideController', u'Move to last'), + self.onSlideSelectedLast) if self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.blankButton = self.Toolbar.addToolbarButton( u'Blank Screen', u':/slides/slide_blank.png', - translate('SlideController','Blank Screen'), self.onBlankDisplay, True) + translate(u'SlideController', u'Blank Screen'), + self.onBlankDisplay, True) self.themeButton = self.Toolbar.addToolbarButton( u'Display Theme', u':/slides/slide_theme.png', - translate('SlideController','Theme Screen'), self.onThemeDisplay, True) + translate(u'SlideController', u'Theme Screen'), + self.onThemeDisplay, True) self.hideButton = self.Toolbar.addToolbarButton( u'Hide screen', u':/slides/slide_desktop.png', - translate('SlideController','Hide Screen'), self.onHideDisplay, True) + translate(u'SlideController', u'Hide Screen'), + self.onHideDisplay, True) if not self.isLive: self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( u'Go Live', u':/general/general_live.png', - translate('SlideController','Move to live'), self.onGoLive) + translate(u'SlideController', u'Move to live'), self.onGoLive) self.Toolbar.addToolbarSeparator(u'Close Separator') self.Toolbar.addToolbarButton( u'Edit Song', u':/general/general_edit.png', - translate('SlideController','Edit and re-preview Song'), self.onEditSong) + translate(u'SlideController', u'Edit and re-preview Song'), + self.onEditSong) if isLive: self.Toolbar.addToolbarSeparator(u'Loop Separator') self.Toolbar.addToolbarButton( u'Start Loop', u':/media/media_time.png', - translate('SlideController','Start continuous loop'), self.onStartLoop) + translate(u'SlideController', u'Start continuous loop'), + self.onStartLoop) self.Toolbar.addToolbarButton( u'Stop Loop', u':/media/media_stop.png', - translate('SlideController','Stop continuous loop'), self.onStopLoop) + translate(u'SlideController', u'Stop continuous loop'), + self.onStopLoop) self.DelaySpinBox = QtGui.QSpinBox() self.DelaySpinBox.setMinimum(1) self.DelaySpinBox.setMaximum(180) self.Toolbar.addToolbarWidget( u'Image SpinBox', self.DelaySpinBox) - self.DelaySpinBox.setSuffix(translate('SlideController','s')) + self.DelaySpinBox.setSuffix(translate(u'SlideController', u's')) self.DelaySpinBox.setToolTip( - translate('SlideController','Delay between slides in seconds')) + translate(u'SlideController', + u'Delay between slides in seconds')) self.ControllerLayout.addWidget(self.Toolbar) #Build a Media ToolBar self.Mediabar = OpenLPToolbar(self) self.Mediabar.addToolbarButton( u'Media Start', u':/slides/media_playback_start.png', - translate('SlideController','Start playing media'), self.onMediaPlay) + translate(u'SlideController', u'Start playing media'), + self.onMediaPlay) self.Mediabar.addToolbarButton( u'Media Pause', u':/slides/media_playback_pause.png', - translate('SlideController','Start playing media'), self.onMediaPause) + translate(u'SlideController', u'Start playing media'), + self.onMediaPause) self.Mediabar.addToolbarButton( u'Media Stop', u':/slides/media_playback_stop.png', - translate('SlideController','Start playing media'), self.onMediaStop) + translate(u'SlideController', u'Start playing media'), + self.onMediaStop) if self.isLive: self.blankButton = self.Mediabar.addToolbarButton( u'Blank Screen', u':/slides/slide_blank.png', - translate('SlideController','Blank Screen'), self.onBlankDisplay, True) + translate(u'SlideController', u'Blank Screen'), + self.onBlankDisplay, True) self.themeButton = self.Mediabar.addToolbarButton( u'Display Theme', u':/slides/slide_theme.png', - translate('SlideController','Theme Screen'), self.onThemeDisplay, True) + translate(u'SlideController', u'Theme Screen'), + self.onThemeDisplay, True) self.hideButton = self.Mediabar.addToolbarButton( u'Hide screen', u':/slides/slide_desktop.png', - translate('SlideController','Hide Screen'), self.onHideDisplay, True) + translate(u'SlideController', u'Hide Screen'), + self.onHideDisplay, True) if not self.isLive: self.seekSlider = Phonon.SeekSlider() self.seekSlider.setGeometry(QtCore.QRect(90, 260, 221, 24)) @@ -262,11 +279,11 @@ class SlideController(QtGui.QWidget): # Build the Song Toolbar if isLive: self.SongMenu = QtGui.QToolButton(self.Toolbar) - self.SongMenu.setText(translate('SlideController','Go to Verse')) + self.SongMenu.setText(translate(u'SlideController', u'Go to Verse')) self.SongMenu.setPopupMode(QtGui.QToolButton.InstantPopup) self.Toolbar.addToolbarWidget(u'Song Menu', self.SongMenu) - self.SongMenu.setMenu(QtGui.QMenu(translate('SlideController','Go to Verse'), - self.Toolbar)) + self.SongMenu.setMenu(QtGui.QMenu( + translate(u'SlideController', u'Go to Verse'), self.Toolbar)) self.Toolbar.makeWidgetsInvisible([u'Song Menu']) # Screen preview area self.PreviewFrame = QtGui.QFrame(self.Splitter) @@ -539,8 +556,8 @@ class SlideController(QtGui.QWidget): bits = frame[u'verseTag'].split(u':') tag = None #If verse handle verse number else tag only - if bits[0] == translate('SlideController','Verse') or \ - bits[0] == translate('SlideController','Chorus'): + if bits[0] == translate(u'SlideController', u'Verse') or \ + bits[0] == translate(u'SlideController', u'Chorus'): tag = u'%s\n%s' % (bits[0][0], bits[1][0:] ) tag1 = u'%s%s' % (bits[0][0], bits[1][0:] ) row = tag @@ -553,8 +570,9 @@ class SlideController(QtGui.QWidget): if self.isLive and frame[u'verseTag'] is not None: if tag1 not in self.slideList: self.slideList[tag1] = framenumber - self.SongMenu.menu().addAction(translate('SlideController',u'%s'%tag1), - self.onSongBarHandler) + self.SongMenu.menu().addAction( + translate(u'SlideController', u'%s'%tag1), + self.onSongBarHandler) item.setText(frame[u'text']) else: label = QtGui.QLabel() diff --git a/openlp/core/ui/splashscreen.py b/openlp/core/ui/splashscreen.py index f87bb84f6..10cea5a11 100644 --- a/openlp/core/ui/splashscreen.py +++ b/openlp/core/ui/splashscreen.py @@ -24,7 +24,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon class SplashScreen(object): def __init__(self, version): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index bbfbfa54f..cc13bf613 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -55,21 +55,25 @@ class ThemeManager(QtGui.QWidget): self.amendThemeForm = AmendThemeForm(self) self.Toolbar = OpenLPToolbar(self) self.Toolbar.addToolbarButton( - translate('ThemeManager','New Theme'), u':/themes/theme_new.png', - translate('ThemeManager','Create a new theme'), self.onAddTheme) + translate(u'ThemeManager', u'New Theme'), u':/themes/theme_new.png', + translate(u'ThemeManager', u'Create a new theme'), self.onAddTheme) self.Toolbar.addToolbarButton( - translate('ThemeManager','Edit Theme'), u':/themes/theme_edit.png', - translate('ThemeManager','Edit a theme'), self.onEditTheme) + translate(u'ThemeManager', u'Edit Theme'), + u':/themes/theme_edit.png', + translate(u'ThemeManager', u'Edit a theme'), self.onEditTheme) self.Toolbar.addToolbarButton( - translate('ThemeManager','Delete Theme'), u':/general/general_delete.png', - translate('ThemeManager','Delete a theme'), self.onDeleteTheme) + translate(u'ThemeManager', u'Delete Theme'), + u':/general/general_delete.png', + translate(u'ThemeManager', u'Delete a theme'), self.onDeleteTheme) self.Toolbar.addSeparator() self.Toolbar.addToolbarButton( - translate('ThemeManager','Import Theme'), u':/general/general_import.png', - translate('ThemeManager','Import a theme'), self.onImportTheme) + translate(u'ThemeManager', u'Import Theme'), + u':/general/general_import.png', + translate(u'ThemeManager', u'Import a theme'), self.onImportTheme) self.Toolbar.addToolbarButton( - translate('ThemeManager','Export Theme'), u':/general/general_export.png', - translate('ThemeManager','Export a theme'), self.onExportTheme) + translate(u'ThemeManager', u'Export Theme'), + u':/general/general_export.png', + translate(u'ThemeManager', u'Export a theme'), self.onExportTheme) self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar) self.Layout.addWidget(self.Toolbar) self.ThemeListWidget = QtGui.QListWidget(self) @@ -79,23 +83,23 @@ class ThemeManager(QtGui.QWidget): self.ThemeListWidget.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/themes/theme_edit.png', - translate('ThemeManager','Edit a theme'), self.onEditTheme)) + translate(u'ThemeManager', u'Edit a theme'), self.onEditTheme)) self.ThemeListWidget.addAction( contextMenuSeparator(self.ThemeListWidget)) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/general/general_delete.png', - translate('ThemeManager','Delete theme'), + translate(u'ThemeManager', u'Delete theme'), self.onDeleteTheme)) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/general/general_export.png', - translate('ThemeManager','Make Global'), + translate(u'ThemeManager', u'Make Global'), self.changeGlobalFromScreen)) self.ThemeListWidget.addAction( contextMenuAction(self.ThemeListWidget, u':/general/general_export.png', - translate('ThemeManager','Export theme'), + translate(u'ThemeManager', u'Export theme'), self.onExportTheme)) self.ThemeListWidget.addAction( contextMenuSeparator(self.ThemeListWidget)) @@ -128,7 +132,8 @@ class ThemeManager(QtGui.QWidget): self.ThemeListWidget.item(count).setText(newName) #Set the new name if themeName == newName: - name = u'%s (%s)' % (newName, translate('ThemeManager','default')) + name = u'%s (%s)' % (newName, + translate(u'ThemeManager', u'default')) self.ThemeListWidget.item(count).setText(name) def changeGlobalFromScreen(self, index = -1): @@ -145,7 +150,8 @@ class ThemeManager(QtGui.QWidget): if count == selected_row: self.global_theme = unicode( self.ThemeListWidget.item(count).text()) - name = u'%s (%s)' % (self.global_theme, translate('ThemeManager','default')) + name = u'%s (%s)' % (self.global_theme, + translate(u'ThemeManager', u'default')) self.ThemeListWidget.item(count).setText(name) QtCore.QSettings().setValue( self.settingsSection + u'/global theme', @@ -179,21 +185,25 @@ class ThemeManager(QtGui.QWidget): # should be the same unless default if theme != unicode(item.data(QtCore.Qt.UserRole).toString()): QtGui.QMessageBox.critical( - self, translate('ThemeManager','Error'), - translate('ThemeManager','You are unable to delete the default theme.'), + self, translate(u'ThemeManager', u'Error'), + translate(u'ThemeManager', + u'You are unable to delete the default theme.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) else: for plugin in self.parent.plugin_manager.plugins: if not plugin.can_delete_theme(theme): QtGui.QMessageBox.critical( - self, translate('ThemeManager','Error'), - translate('ThemeManager','Theme %s is use in %s plugin' % (theme, plugin.name)), + self, translate(u'ThemeManager', u'Error'), + translate(u'ThemeManager', + u'Theme %s is use in %s plugin' + % (theme, plugin.name)), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme: QtGui.QMessageBox.critical( self, translate('ThemeManager','Error'), - translate('ThemeManager','Theme %s is use by Service Manager' % theme), + translate(u'ThemeManager', + u'Theme %s is use by Service Manager' % theme), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return self.themelist.remove(theme) @@ -218,13 +228,14 @@ class ThemeManager(QtGui.QWidget): """ item = self.ThemeListWidget.currentItem() if item is None: - QtGui.QMessageBox.critical(self, translate('ThemeManager','Error'), - translate('ThemeManager','You have not selected a theme.'), + QtGui.QMessageBox.critical(self, + translate(u'ThemeManager', u'Error'), + translate(u'ThemeManager', u'You have not selected a theme.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return theme = unicode(item.data(QtCore.Qt.UserRole).toString()) path = QtGui.QFileDialog.getExistingDirectory(self, - unicode(translate('ThemeManager','Save Theme - (%s)')) % theme, + unicode(translate(u'ThemeManager', u'Save Theme - (%s)')) % theme, SettingsManager.get_last_dir(self.settingsSection, 1)) path = unicode(path) if path: @@ -247,7 +258,7 @@ class ThemeManager(QtGui.QWidget): def onImportTheme(self): files = QtGui.QFileDialog.getOpenFileNames( - self, translate('ThemeManager','Select Theme Import File'), + self, translate(u'ThemeManager', u'Select Theme Import File'), SettingsManager.get_last_dir(self.settingsSection), u'Theme (*.*)') log.info(u'New Themes %s', unicode(files)) if files: @@ -277,7 +288,7 @@ class ThemeManager(QtGui.QWidget): textName = os.path.splitext(name)[0] if textName == self.global_theme: name = u'%s (%s)' % (textName, - translate('ThemeManager','default')) + translate(u'ThemeManager', u'default')) else: name = textName thumb = os.path.join(self.thumbPath, u'%s.png' % textName) @@ -363,8 +374,8 @@ class ThemeManager(QtGui.QWidget): self.generateAndSaveImage(dir, themename, filexml) except: QtGui.QMessageBox.critical( - self, translate('ThemeManager','Error'), - translate('ThemeManager','File is not a valid theme.'), + self, translate(u'ThemeManager', u'Error'), + translate(u'ThemeManager', u'File is not a valid theme.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) log.exception(u'Importing theme from zip file failed %s' % filename) finally: @@ -446,9 +457,10 @@ class ThemeManager(QtGui.QWidget): if self.saveThemeName != name: if os.path.exists(theme_file): result = QtGui.QMessageBox.question( - self, translate('ThemeManager','Theme Exists'), - translate('ThemeManager','A theme with this name already exists, ' - 'would you like to overwrite it?'), + self, translate(u'ThemeManager', u'Theme Exists'), + translate(u'ThemeManager', + u'A theme with this name already exists, ' + u'would you like to overwrite it?'), (QtGui.QMessageBox.Yes | QtGui.QMessageBox.No), QtGui.QMessageBox.No) if result == QtGui.QMessageBox.Yes: @@ -504,7 +516,7 @@ class ThemeManager(QtGui.QWidget): def baseTheme(self): log.debug(u'base theme created') newtheme = ThemeXML() - newtheme.new_document(unicode(translate('ThemeManager','New Theme'))) + newtheme.new_document(unicode(translate(u'ThemeManager', u'New Theme'))) newtheme.add_background_solid(unicode(u'#000000')) newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'), unicode(30), u'False') diff --git a/openlp/core/ui/themestab.py b/openlp/core/ui/themestab.py index 8d3355448..5fd8d5119 100644 --- a/openlp/core/ui/themestab.py +++ b/openlp/core/ui/themestab.py @@ -37,7 +37,7 @@ class ThemesTab(SettingsTab): def setupUi(self): self.setObjectName(u'ThemesTab') - self.tabTitleVisible = translate('ThemesTab','Themes') + self.tabTitleVisible = translate(u'ThemesTab', u'Themes') self.ThemesTabLayout = QtGui.QHBoxLayout(self) self.ThemesTabLayout.setSpacing(8) self.ThemesTabLayout.setMargin(8) @@ -106,21 +106,26 @@ class ThemesTab(SettingsTab): QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): - self.GlobalGroupBox.setTitle(translate('ThemesTab','Global theme')) - self.LevelGroupBox.setTitle(translate('ThemesTab','Theme level')) - self.SongLevelRadioButton.setText(translate('ThemesTab','Song level')) - self.SongLevelLabel.setText(translate('ThemesTab','Use the theme from each song ' - 'in the database. If a song doesn\'t have a theme associated with ' - 'it, then use the service\'s theme. If the service doesn\'t have ' - 'a theme, then use the global theme.')) - self.ServiceLevelRadioButton.setText(translate('ThemesTab','Service level')) - self.ServiceLevelLabel.setText(translate('ThemesTab','Use the theme from the ' - 'service, overriding any of the individual songs\' themes. If the ' - 'service doesn\'t have a theme, then use the global theme.')) - self.GlobalLevelRadioButton.setText(translate('ThemesTab','Global level')) - self.GlobalLevelLabel.setText(translate('ThemesTab','Use the global theme, ' - 'overriding any themes associated with either the service or the ' - 'songs.')) + self.GlobalGroupBox.setTitle(translate(u'ThemesTab', u'Global theme')) + self.LevelGroupBox.setTitle(translate(u'ThemesTab', u'Theme level')) + self.SongLevelRadioButton.setText( + translate(u'ThemesTab', u'Song level')) + self.SongLevelLabel.setText( + translate(u'ThemesTab', u'Use the theme from each song ' + u'in the database. If a song doesn\'t have a theme associated with ' + u'it, then use the service\'s theme. If the service doesn\'t have ' + u'a theme, then use the global theme.')) + self.ServiceLevelRadioButton.setText( + translate(u'ThemesTab', u'Service level')) + self.ServiceLevelLabel.setText( + translate(u'ThemesTab', u'Use the theme from the service, ' + u'overriding any of the individual songs\' themes. If the ' + u'service doesn\'t have a theme, then use the global theme.')) + self.GlobalLevelRadioButton.setText( + translate(u'ThemesTab', u'Global level')) + self.GlobalLevelLabel.setText( + translate(u'ThemesTab', u'Use the global theme, overriding any ' + u'themes associated with either the service or the songs.')) def load(self): settings = QtCore.QSettings() From dc35faf1ae92f5cc470f87cfe029dbf56e9d962b Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 12:07:48 +0200 Subject: [PATCH 03/17] Fixed all errors from the feedback I got from IRC --- openlp/core/ui/slidecontroller.py | 2 +- openlp/core/ui/thememanager.py | 3 +-- openlp/plugins/alerts/lib/alertsmanager.py | 2 +- openlp/plugins/alerts/lib/alertstab.py | 2 +- openlp/plugins/bibles/bibleplugin.py | 2 +- openlp/plugins/songs/forms/authorsform.py | 3 ++- openlp/plugins/songs/forms/songbookform.py | 3 ++- openlp/plugins/songs/forms/topicsform.py | 3 ++- 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index cc144ab24..d85f8e7bd 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon from openlp.core.ui import HideMode from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \ -ItemCapabilities, translate + ItemCapabilities, translate log = logging.getLogger(__name__) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index cc13bf613..46f175b67 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -30,13 +30,12 @@ import logging from xml.etree.ElementTree import ElementTree, XML from PyQt4 import QtCore, QtGui -from openlp.core.lib import translate from openlp.core.ui import AmendThemeForm from openlp.core.theme import Theme from openlp.core.lib import OpenLPToolbar, contextMenuAction, \ ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \ - contextMenuSeparator, SettingsManager + contextMenuSeparator, SettingsManager, translate from openlp.core.utils import AppLocation log = logging.getLogger(__name__) diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index 61d805700..594ed3998 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver, translate log = logging.getLogger(__name__) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 80f776505..a4ba640dd 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab, translate class AlertsTab(SettingsTab): """ diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index 38bd7bbf5..d0ae71fbc 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon, PluginStatus, translate +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index b7046a6de..27ec33294 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -25,8 +25,9 @@ from PyQt4 import QtGui, QtCore -from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog from openlp.core.lib import translate +from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog + class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): """ diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index 5f3fffb59..e3dfb25d7 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -25,8 +25,9 @@ from PyQt4 import QtGui -from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog from openlp.core.lib import translate +from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog + class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): """ diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index a3d9690d7..1784fae16 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -25,8 +25,9 @@ from PyQt4 import QtGui -from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog from openlp.core.lib import translate +from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog + class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): """ From 7f2c1f04a558c53e61026912458149eabac480d2 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 13:05:35 +0200 Subject: [PATCH 04/17] Fixed all translate() function in the project (exept the one in plugin), by adding spaces and make sure on line is longer then 80 char and adding u' in front of all argument is translate() functions --- openlp/core/ui/aboutdialog.py | 21 ++- openlp/core/ui/amendthemedialog.py | 232 +++++++++++++++--------- openlp/core/ui/plugindialog.py | 20 +- openlp/core/ui/serviceitemeditdialog.py | 9 +- openlp/core/ui/servicenotedialog.py | 6 +- openlp/core/ui/settingsdialog.py | 2 +- openlp/core/utils/languagemanager.py | 6 +- 7 files changed, 184 insertions(+), 112 deletions(-) diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index fac8874f5..f31b214b6 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -114,8 +114,8 @@ class Ui_AboutDialog(object): QtCore.QMetaObject.connectSlotsByName(AboutDialog) def retranslateUi(self, AboutDialog): - AboutDialog.setWindowTitle(translate('AboutForm', 'About OpenLP')) - self.AboutTextEdit.setPlainText(translate('AboutForm', + AboutDialog.setWindowTitle(translate(u'AboutForm', u'About OpenLP')) + self.AboutTextEdit.setPlainText(translate(u'AboutForm', u 'OpenLP - Open Source Lyrics ' 'Projection\n' '\n' @@ -132,9 +132,10 @@ class Ui_AboutDialog(object): 'consider contributing by using the button below.' )) self.AboutNotebook.setTabText( - self.AboutNotebook.indexOf(self.AboutTab), translate('AboutForm', 'About')) - self.CreditsTextEdit.setPlainText(translate('AboutForm', - 'Project Lead\n' + self.AboutNotebook.indexOf(self.AboutTab), + translate(u'AboutForm', u'About')) + self.CreditsTextEdit.setPlainText(translate(u'AboutForm', + u'Project Lead\n' ' Raoul "superfly" Snyman\n' '\n' 'Developers\n' @@ -165,8 +166,8 @@ class Ui_AboutDialog(object): )) self.AboutNotebook.setTabText( self.AboutNotebook.indexOf(self.CreditsTab), - translate('AboutForm', 'Credits')) - self.LicenseTextEdit.setPlainText(translate('AboutForm', + translate(u'AboutForm', u'Credits')) + self.LicenseTextEdit.setPlainText(translate(u'AboutForm', 'Copyright \xa9 2004-2010 Raoul Snyman\n' 'Portions copyright \xa9 2004-2010 ' 'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, ' @@ -557,6 +558,6 @@ class Ui_AboutDialog(object): 'instead of this License.')) self.AboutNotebook.setTabText( self.AboutNotebook.indexOf(self.LicenseTab), - translate('AboutForm', 'License')) - self.ContributeButton.setText(translate('AboutForm', 'Contribute')) - self.CloseButton.setText(translate('AboutForm', 'Close')) + translate(u'AboutForm', u'License')) + self.ContributeButton.setText(translate(u'AboutForm', u'Contribute')) + self.CloseButton.setText(translate(u'AboutForm', u'Close')) diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 848f6ec72..636975726 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -603,95 +603,159 @@ class Ui_AmendThemeDialog(object): AmendThemeDialog.setTabOrder(self.HorizontalComboBox, self.VerticalComboBox) def retranslateUi(self, AmendThemeDialog): - AmendThemeDialog.setWindowTitle(translate('AmendThemeForm', 'Theme Maintenance')) - self.ThemeNameLabel.setText(translate('AmendThemeForm', 'Theme Name:')) - self.BackgroundLabel.setText(translate('AmendThemeForm', 'Background:')) - self.BackgroundComboBox.setItemText(0, translate('AmendThemeForm', 'Opaque')) - self.BackgroundComboBox.setItemText(1, translate('AmendThemeForm', 'Transparent')) - self.BackgroundTypeLabel.setText(translate('AmendThemeForm', 'Background Type:')) - self.BackgroundTypeComboBox.setItemText(0, translate('AmendThemeForm', 'Solid Color')) - self.BackgroundTypeComboBox.setItemText(1, translate('AmendThemeForm', 'Gradient')) - self.BackgroundTypeComboBox.setItemText(2, translate('AmendThemeForm', 'Image')) - self.Color1Label.setText(translate('AmendThemeForm', '')) - self.Color2Label.setText(translate('AmendThemeForm', '')) - self.ImageLabel.setText(translate('AmendThemeForm', 'Image:')) - self.GradientLabel.setText(translate('AmendThemeForm', 'Gradient :')) - self.GradientComboBox.setItemText(0, translate('AmendThemeForm', 'Horizontal')) - self.GradientComboBox.setItemText(1, translate('AmendThemeForm', 'Vertical')) - self.GradientComboBox.setItemText(2, translate('AmendThemeForm', 'Circular')) + AmendThemeDialog.setWindowTitle( + translate(u'AmendThemeForm', u'Theme Maintenance')) + self.ThemeNameLabel.setText( + translate(u'AmendThemeForm', u'Theme Name:')) + self.BackgroundLabel.setText( + translate(u'AmendThemeForm', u'Background:')) + self.BackgroundComboBox.setItemText(0, + translate(u'AmendThemeForm', u'Opaque')) + self.BackgroundComboBox.setItemText(1, + translate(u'AmendThemeForm', u'Transparent')) + self.BackgroundTypeLabel.setText( + translate(u'AmendThemeForm', u'Background Type:')) + self.BackgroundTypeComboBox.setItemText(0, + translate(u'AmendThemeForm', u'Solid Color')) + self.BackgroundTypeComboBox.setItemText(1, + translate(u'AmendThemeForm', u'Gradient')) + self.BackgroundTypeComboBox.setItemText(2, + translate(u'AmendThemeForm', u'Image')) + self.Color1Label.setText( + translate(u'AmendThemeForm', u'')) + self.Color2Label.setText(translate(u'AmendThemeForm', u'')) + self.ImageLabel.setText(translate(u'AmendThemeForm', u'Image:')) + self.GradientLabel.setText(translate(u'AmendThemeForm', u'Gradient :')) + self.GradientComboBox.setItemText(0, + translate(u'AmendThemeForm', u'Horizontal')) + self.GradientComboBox.setItemText(1, + translate(u'AmendThemeForm', u'Vertical')) + self.GradientComboBox.setItemText(2, + translate(u'AmendThemeForm', u'Circular')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.BackgroundTab), - translate('AmendThemeForm', 'Background')) - self.FontMainGroupBox.setTitle(translate('AmendThemeForm', 'Main Font')) - self.FontMainlabel.setText(translate('AmendThemeForm', 'Font:')) - self.FontMainColorLabel.setText(translate('AmendThemeForm', 'Font Color:')) - self.FontMainSize.setText(translate('AmendThemeForm', 'Size:')) - self.FontMainSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt')) - self.FontMainWrapIndentationLabel.setText(translate('AmendThemeForm', 'Wrap Indentation')) - self.FontMainWrapLineAdjustmentLabel.setText(translate('AmendThemeForm', 'Adjust Line Spacing')) - self.FontMainWeightComboBox.setItemText(0, translate('AmendThemeForm', 'Normal')) - self.FontMainWeightComboBox.setItemText(1, translate('AmendThemeForm', 'Bold')) - self.FontMainWeightComboBox.setItemText(2, translate('AmendThemeForm', 'Italics')) - self.FontMainWeightComboBox.setItemText(3, translate('AmendThemeForm', 'Bold/Italics')) - self.FontMainWeightLabel.setText(translate('AmendThemeForm', 'Font Weight:')) - self.MainLocationGroupBox.setTitle(translate('AmendThemeForm', 'Display Location')) - self.DefaultLocationLabel.setText(translate('AmendThemeForm', 'Use Default Location:')) - self.FontMainXLabel.setText(translate('AmendThemeForm', 'X Position:')) - self.FontMainYLabel.setText(translate('AmendThemeForm', 'Y Position:')) - self.FontMainWidthLabel.setText(translate('AmendThemeForm', 'Width:')) - self.FontMainHeightLabel.setText(translate('AmendThemeForm', 'Height:')) - self.FontMainXSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.FontMainYSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.FontMainWidthSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.FontMainHeightSpinBox.setSuffix(translate('AmendThemeForm', 'px')) + translate(u'AmendThemeForm', u'Background')) + self.FontMainGroupBox.setTitle( + translate(u'AmendThemeForm', u'Main Font')) + self.FontMainlabel.setText(translate(u'AmendThemeForm', u'Font:')) + self.FontMainColorLabel.setText( + translate(u'AmendThemeForm', u'Font Color:')) + self.FontMainSize.setText(translate(u'AmendThemeForm', u'Size:')) + self.FontMainSizeSpinBox.setSuffix(translate(u'AmendThemeForm', u'pt')) + self.FontMainWrapIndentationLabel.setText( + translate(u'AmendThemeForm', u'Wrap Indentation')) + self.FontMainWrapLineAdjustmentLabel.setText( + translate(u'AmendThemeForm', u'Adjust Line Spacing')) + self.FontMainWeightComboBox.setItemText(0, + translate(u'AmendThemeForm', u'Normal')) + self.FontMainWeightComboBox.setItemText(1, + translate(u'AmendThemeForm', u'Bold')) + self.FontMainWeightComboBox.setItemText(2, + translate(u'AmendThemeForm', u'Italics')) + self.FontMainWeightComboBox.setItemText(3, + translate(u'AmendThemeForm', u'Bold/Italics')) + self.FontMainWeightLabel.setText( + translate(u'AmendThemeForm', u'Font Weight:')) + self.MainLocationGroupBox.setTitle( + translate(u'AmendThemeForm', u'Display Location')) + self.DefaultLocationLabel.setText( + translate(u'AmendThemeForm', u'Use Default Location:')) + self.FontMainXLabel.setText( + translate(u'AmendThemeForm', u'X Position:')) + self.FontMainYLabel.setText( + translate(u'AmendThemeForm', u'Y Position:')) + self.FontMainWidthLabel.setText( + translate(u'AmendThemeForm', u'Width:')) + self.FontMainHeightLabel.setText( + translate(u'AmendThemeForm', u'Height:')) + self.FontMainXSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.FontMainYSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.FontMainWidthSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.FontMainHeightSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.FontMainTab), - translate('AmendThemeForm', 'Font Main')) - self.FooterFontGroupBox.setTitle(translate('AmendThemeForm', 'Footer Font')) - self.FontFooterLabel.setText(translate('AmendThemeForm', 'Font:')) - self.FontFooterColorLabel.setText(translate('AmendThemeForm', 'Font Color:')) - self.FontFooterSizeLabel.setText(translate('AmendThemeForm', 'Size:')) - self.FontFooterSizeSpinBox.setSuffix(translate('AmendThemeForm', 'pt')) - self.FontFooterWeightComboBox.setItemText(0, translate('AmendThemeForm', 'Normal')) - self.FontFooterWeightComboBox.setItemText(1, translate('AmendThemeForm', 'Bold')) - self.FontFooterWeightComboBox.setItemText(2, translate('AmendThemeForm', 'Italics')) - self.FontFooterWeightComboBox.setItemText(3, translate('AmendThemeForm', 'Bold/Italics')) - self.FontFooterWeightLabel.setText(translate('AmendThemeForm', 'Font Weight:')) - self.LocationFooterGroupBox.setTitle(translate('AmendThemeForm', 'Display Location')) - self.FontFooterDefaultLabel.setText(translate('AmendThemeForm', 'Use Default Location:')) - self.FontFooterXLabel.setText(translate('AmendThemeForm', 'X Position:')) - self.FontFooterYLabel.setText(translate('AmendThemeForm', 'Y Position:')) - self.FontFooterWidthLabel.setText(translate('AmendThemeForm', 'Width:')) - self.FontFooterHeightLabel.setText(translate('AmendThemeForm', 'Height:')) - self.FontFooterXSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.FontFooterYSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.FontFooterWidthSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.FontFooterHeightSpinBox.setSuffix(translate('AmendThemeForm', 'px')) + translate(u'AmendThemeForm', u'Font Main')) + self.FooterFontGroupBox.setTitle( + translate(u'AmendThemeForm', u'Footer Font')) + self.FontFooterLabel.setText(translate(u'AmendThemeForm', u'Font:')) + self.FontFooterColorLabel.setText( + translate(u'AmendThemeForm', u'Font Color:')) + self.FontFooterSizeLabel.setText(translate(u'AmendThemeForm', u'Size:')) + self.FontFooterSizeSpinBox.setSuffix(translate(u'AmendThemeForm', u'pt')) + self.FontFooterWeightComboBox.setItemText(0, + translate(u'AmendThemeForm', u'Normal')) + self.FontFooterWeightComboBox.setItemText(1, + translate(u'AmendThemeForm', u'Bold')) + self.FontFooterWeightComboBox.setItemText(2, + translate(u'AmendThemeForm', u'Italics')) + self.FontFooterWeightComboBox.setItemText(3, + translate(u'AmendThemeForm', u'Bold/Italics')) + self.FontFooterWeightLabel.setText( + translate(u'AmendThemeForm', u'Font Weight:')) + self.LocationFooterGroupBox.setTitle( + translate(u'AmendThemeForm', u'Display Location')) + self.FontFooterDefaultLabel.setText( + translate(u'AmendThemeForm', u'Use Default Location:')) + self.FontFooterXLabel.setText( + translate(u'AmendThemeForm', u'X Position:')) + self.FontFooterYLabel.setText( + translate(u'AmendThemeForm', u'Y Position:')) + self.FontFooterWidthLabel.setText( + translate(u'AmendThemeForm', u'Width:')) + self.FontFooterHeightLabel.setText( + translate(u'AmendThemeForm', u'Height:')) + self.FontFooterXSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) + self.FontFooterYSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) + self.FontFooterWidthSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) + self.FontFooterHeightSpinBox.setSuffix( + translate(u'AmendThemeForm', u'px')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.FontFooterTab), - translate('AmendThemeForm', 'Font Footer')) - self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline')) - self.OutlineSpinBoxLabel.setText(translate('AmendThemeForm', 'Outline Size:')) - self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.OutlineColorLabel.setText(translate('AmendThemeForm', 'Outline Color:')) - self.OutlineEnabledLabel.setText(translate('AmendThemeForm', 'Show Outline:')) - self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow')) - self.ShadowSpinBoxLabel.setText(translate('AmendThemeForm', 'Shadow Size:')) - self.ShadowSpinBox.setSuffix(translate('AmendThemeForm', 'px')) - self.ShadowColorLabel.setText(translate('AmendThemeForm', 'Shadow Color:')) - self.ShadowEnabledLabel.setText(translate('AmendThemeForm', 'Show Shadow:')) - self.AlignmentGroupBox.setTitle(translate('AmendThemeForm', 'Alignment')) - self.HorizontalLabel.setText(translate('AmendThemeForm', 'Horizontal Align:')) - self.HorizontalComboBox.setItemText(0, translate('AmendThemeForm', 'Left')) - self.HorizontalComboBox.setItemText(1, translate('AmendThemeForm', 'Right')) - self.HorizontalComboBox.setItemText(2, translate('AmendThemeForm', 'Center')) - self.VerticalLabel.setText(translate('AmendThemeForm', 'Vertical Align:')) - self.VerticalComboBox.setItemText(0, translate('AmendThemeForm', 'Top')) - self.VerticalComboBox.setItemText(1, translate('AmendThemeForm', 'Middle')) - self.VerticalComboBox.setItemText(2, translate('AmendThemeForm', 'Bottom')) - self.TransitionGroupBox.setTitle(translate('AmendThemeForm', 'Slide Transition')) - self.SlideTransitionCheckedBoxLabel.setText(translate('AmendThemeForm', 'Transition Active:')) + translate(u'AmendThemeForm', u'Font Footer')) + self.OutlineGroupBox.setTitle(translate(u'AmendThemeForm', u'Outline')) + self.OutlineSpinBoxLabel.setText( + translate(u'AmendThemeForm', u'Outline Size:')) + self.OutlineSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.OutlineColorLabel.setText( + translate(u'AmendThemeForm', u'Outline Color:')) + self.OutlineEnabledLabel.setText( + translate(u'AmendThemeForm', u'Show Outline:')) + self.ShadowGroupBox.setTitle( + translate(u'AmendThemeForm', u'Shadow')) + self.ShadowSpinBoxLabel.setText( + translate(u'AmendThemeForm', u'Shadow Size:')) + self.ShadowSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.ShadowColorLabel.setText( + translate(u'AmendThemeForm', u'Shadow Color:')) + self.ShadowEnabledLabel.setText( + translate(u'AmendThemeForm', u'Show Shadow:')) + self.AlignmentGroupBox.setTitle( + translate(u'AmendThemeForm', u'Alignment')) + self.HorizontalLabel.setText( + translate(u'AmendThemeForm', u'Horizontal Align:')) + self.HorizontalComboBox.setItemText(0, + translate(u'AmendThemeForm', u'Left')) + self.HorizontalComboBox.setItemText(1, + translate(u'AmendThemeForm', u'Right')) + self.HorizontalComboBox.setItemText(2, + translate(u'AmendThemeForm', u'Center')) + self.VerticalLabel.setText( + translate(u'AmendThemeForm', u'Vertical Align:')) + self.VerticalComboBox.setItemText(0, + translate(u'AmendThemeForm', u'Top')) + self.VerticalComboBox.setItemText(1, + translate(u'AmendThemeForm', u'Middle')) + self.VerticalComboBox.setItemText(2, + translate(u'AmendThemeForm', u'Bottom')) + self.TransitionGroupBox.setTitle( + translate(u'AmendThemeForm', u'Slide Transition')) + self.SlideTransitionCheckedBoxLabel.setText( + translate(u'AmendThemeForm', u'Transition Active:')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.OtherOptionsTab), - translate('AmendThemeForm', 'Other Options')) - self.PreviewGroupBox.setTitle(translate('AmendThemeForm', 'Preview')) + translate(u'AmendThemeForm', u'Other Options')) + self.PreviewGroupBox.setTitle(translate(u'AmendThemeForm', u'Preview')) diff --git a/openlp/core/ui/plugindialog.py b/openlp/core/ui/plugindialog.py index e9c205e20..f0112dac9 100644 --- a/openlp/core/ui/plugindialog.py +++ b/openlp/core/ui/plugindialog.py @@ -99,11 +99,15 @@ class Ui_PluginViewDialog(object): QtCore.QMetaObject.connectSlotsByName(PluginViewDialog) def retranslateUi(self, PluginViewDialog): - PluginViewDialog.setWindowTitle(translate('PluginForm', 'Plugin List')) - self.PluginInfoGroupBox.setTitle(translate('PluginForm', 'Plugin Details')) - self.VersionLabel.setText(translate('PluginForm', 'Version:')) - self.VersionNumberLabel.setText(translate('PluginForm', 'TextLabel')) - self.AboutLabel.setText(translate('PluginForm', 'About:')) - self.StatusLabel.setText(translate('PluginForm', 'Status:')) - self.StatusComboBox.setItemText(0, translate('PluginForm', 'Active')) - self.StatusComboBox.setItemText(1, translate('PluginForm', 'Inactive')) + PluginViewDialog.setWindowTitle( + translate(u'PluginForm', u'Plugin List')) + self.PluginInfoGroupBox.setTitle( + translate(u'PluginForm', u'Plugin Details')) + self.VersionLabel.setText( + translate(u'PluginForm', u'Version:')) + self.VersionNumberLabel.setText(translate(u'PluginForm', u'TextLabel')) + self.AboutLabel.setText(translate(u'PluginForm', u'About:')) + self.StatusLabel.setText(translate(u'PluginForm', u'Status:')) + self.StatusComboBox.setItemText(0, translate(u'PluginForm', u'Active')) + self.StatusComboBox.setItemText(1, + translate(u'PluginForm', u'Inactive')) diff --git a/openlp/core/ui/serviceitemeditdialog.py b/openlp/core/ui/serviceitemeditdialog.py index 467c2aed8..855cae4fa 100644 --- a/openlp/core/ui/serviceitemeditdialog.py +++ b/openlp/core/ui/serviceitemeditdialog.py @@ -67,8 +67,9 @@ class Ui_ServiceItemEditDialog(object): QtCore.QMetaObject.connectSlotsByName(ServiceItemEditDialog) def retranslateUi(self, ServiceItemEditDialog): - ServiceItemEditDialog.setWindowTitle(translate('ServiceItemEditForm', 'Service Item Maintenance')) - self.upButton.setText(translate('ServiceItemEditForm', 'Up')) - self.deleteButton.setText(translate('ServiceItemEditForm', 'Delete')) - self.downButton.setText(translate('ServiceItemEditForm', 'Down')) + ServiceItemEditDialog.setWindowTitle( + translate(u'ServiceItemEditForm', u'Service Item Maintenance')) + self.upButton.setText(translate(u'ServiceItemEditForm', u'Up')) + self.deleteButton.setText(translate(u'ServiceItemEditForm', u'Delete')) + self.downButton.setText(translate(u'ServiceItemEditForm', u'Down')) diff --git a/openlp/core/ui/servicenotedialog.py b/openlp/core/ui/servicenotedialog.py index b21adce8d..4bf2ee531 100644 --- a/openlp/core/ui/servicenotedialog.py +++ b/openlp/core/ui/servicenotedialog.py @@ -39,7 +39,8 @@ class Ui_ServiceNoteEdit(object): self.textEdit.setObjectName(u'textEdit') self.verticalLayout.addWidget(self.textEdit) self.buttonBox = QtGui.QDialogButtonBox(self.widget) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setStandardButtons( + QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) self.buttonBox.setObjectName(u'buttonBox') self.verticalLayout.addWidget(self.buttonBox) @@ -47,4 +48,5 @@ class Ui_ServiceNoteEdit(object): QtCore.QMetaObject.connectSlotsByName(ServiceNoteEdit) def retranslateUi(self, ServiceNoteEdit): - ServiceNoteEdit.setWindowTitle(translate('ServiceNoteForm', 'Service Item Notes')) + ServiceNoteEdit.setWindowTitle( + translate(u'ServiceNoteForm', u'Service Item Notes')) diff --git a/openlp/core/ui/settingsdialog.py b/openlp/core/ui/settingsdialog.py index 66501e380..c5874b84c 100644 --- a/openlp/core/ui/settingsdialog.py +++ b/openlp/core/ui/settingsdialog.py @@ -60,4 +60,4 @@ class Ui_SettingsDialog(object): QtCore.QMetaObject.connectSlotsByName(SettingsDialog) def retranslateUi(self, SettingsDialog): - SettingsDialog.setWindowTitle(translate('SettingsForm', 'Settings')) + SettingsDialog.setWindowTitle(translate(u'SettingsForm', u'Settings')) diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 8be408d17..8621095ab 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -89,9 +89,9 @@ class LanguageManager(object): u'general/language', QtCore.QVariant(language)) log.info(u'Language file: \'%s\' written to conf file' % language) QtGui.QMessageBox.information(None, - translate('LanguageManager', 'Language'), - translate('LanguageManager', - 'After restart new Language settings will be used.')) + translate(u'LanguageManager', u'Language'), + translate(u'LanguageManager', + u'After restart new Language settings will be used.')) @staticmethod def init_qm_list(): From 2c1f1f9455a98270ddeb4ffe41796f88b673045b Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 13:34:35 +0200 Subject: [PATCH 05/17] Fixed translate() funtion in alertsplugin --- openlp/plugins/alerts/alertsplugin.py | 9 +++-- openlp/plugins/alerts/forms/alertdialog.py | 27 +++++++++----- openlp/plugins/alerts/forms/alertform.py | 4 +-- openlp/plugins/alerts/lib/alertsmanager.py | 3 +- openlp/plugins/alerts/lib/alertstab.py | 41 ++++++++++++++-------- 5 files changed, 55 insertions(+), 29 deletions(-) diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 024791bf2..4236182f4 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -63,8 +63,10 @@ class alertsPlugin(Plugin): AlertIcon = build_icon(u':/tools/tools_alert.png') self.toolsAlertItem.setIcon(AlertIcon) self.toolsAlertItem.setObjectName(u'toolsAlertItem') - self.toolsAlertItem.setText(translate('AlertsPlugin','&Alert')) - self.toolsAlertItem.setStatusTip(translate('AlertsPlugin','Show an alert message')) + self.toolsAlertItem.setText( + translate('AlertsPlugin.AlertsPlugin', u'&Alert')) + self.toolsAlertItem.setStatusTip( + translate('AlertsPlugin.AlertsPlugin', u'Show an alert message')) self.toolsAlertItem.setShortcut(u'F7') self.service_manager.parent.ToolsMenu.addAction(self.toolsAlertItem) QtCore.QObject.connect(self.toolsAlertItem, @@ -92,6 +94,7 @@ class alertsPlugin(Plugin): self.alertForm.exec_() def about(self): - about_text = translate('AlertsPlugin','Alerts Plugin
This plugin ' + about_text = translate('AlertsPlugin.AlertsPlugin', + u'Alerts Plugin
This plugin ' 'controls the displaying of alerts on the presentations screen') return about_text diff --git a/openlp/plugins/alerts/forms/alertdialog.py b/openlp/plugins/alerts/forms/alertdialog.py index 2dc117655..8fff3007c 100644 --- a/openlp/plugins/alerts/forms/alertdialog.py +++ b/openlp/plugins/alerts/forms/alertdialog.py @@ -134,13 +134,22 @@ class Ui_AlertDialog(object): AlertDialog.setTabOrder(self.DisplayCloseButton, self.CloseButton) def retranslateUi(self, AlertDialog): - AlertDialog.setWindowTitle(translate('AlertForm', 'Alert Message')) - self.AlertEntryLabel.setText(translate('AlertForm', 'Alert &text:')) - self.AlertParameter.setText(translate('AlertForm', '&Parameter(s):')) - self.NewButton.setText(translate('AlertForm', '&New')) - self.SaveButton.setText(translate('AlertForm', '&Save')) - self.DeleteButton.setText(translate('AlertForm', '&Delete')) - self.DisplayButton.setText(translate('AlertForm', 'Displ&ay')) - self.DisplayCloseButton.setText(translate('AlertForm', 'Display && Cl&ose')) - self.CloseButton.setText(translate('AlertForm', '&Close')) + AlertDialog.setWindowTitle( + translate(u'AlertsPlugin.AlertForm', u'Alert Message')) + self.AlertEntryLabel.setText( + translate(u'AlertsPlugin.AlertForm', u'Alert &text:')) + self.AlertParameter.setText( + translate(u'AlertsPlugin.AlertForm', u'&Parameter(s):')) + self.NewButton.setText( + translate(u'AlertsPlugin.AlertForm', u'&New')) + self.SaveButton.setText( + translate(u'AlertsPlugin.AlertForm', u'&Save')) + self.DeleteButton.setText( + translate(u'AlertsPlugin.AlertForm', u'&Delete')) + self.DisplayButton.setText( + translate(u'AlertsPlugin.AlertForm', u'Displ&ay')) + self.DisplayCloseButton.setText( + translate(u'AlertsPlugin.AlertForm', u'Display && Cl&ose')) + self.CloseButton.setText( + translate(u'AlertsPlugin.AlertForm', u'&Close')) diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 995152e00..83afe986b 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -102,8 +102,8 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): def onNewClick(self): if len(self.AlertTextEdit.text()) == 0: QtGui.QMessageBox.information(self, - translate('AlertForm','Item selected to Add'), - translate('AlertForm','Missing data')) + translate(u'AlertsPlugin.AlertForm', u'Item selected to Add'), + translate(u'AlertsPlugin.AlertForm', u'Missing data')) else: alert = AlertItem() alert.text = unicode(self.AlertTextEdit.text()) diff --git a/openlp/plugins/alerts/lib/alertsmanager.py b/openlp/plugins/alerts/lib/alertsmanager.py index 594ed3998..6b5212d44 100644 --- a/openlp/plugins/alerts/lib/alertsmanager.py +++ b/openlp/plugins/alerts/lib/alertsmanager.py @@ -93,7 +93,8 @@ class AlertsManager(QtCore.QObject): self.alertList.append(text) if self.timer_id != 0: Receiver.send_message(u'maindisplay_status_text', - translate('AlertsManager',u'Alert message created and delayed')) + translate(u'AlertsPlugin.AlertsManager', + u'Alert message created and delayed')) return Receiver.send_message(u'maindisplay_status_text', u'') self.generateAlert() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index a4ba640dd..9e6e98489 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -38,7 +38,7 @@ class AlertsTab(SettingsTab): def setupUi(self): self.setObjectName(u'AlertsTab') - self.tabTitleVisible = translate('AlertsTab','Alerts') + self.tabTitleVisible = translate(u'AlertsPlugin.AlertsTab', u'Alerts') self.AlertsLayout = QtGui.QHBoxLayout(self) self.AlertsLayout.setSpacing(8) self.AlertsLayout.setMargin(8) @@ -186,19 +186,32 @@ class AlertsTab(SettingsTab): QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged) def retranslateUi(self): - self.FontGroupBox.setTitle(translate('AlertsTab','Font')) - self.FontLabel.setText(translate('AlertsTab','Font Name:')) - self.FontColorLabel.setText(translate('AlertsTab','Font Color:')) - self.BackgroundColorLabel.setText(translate('AlertsTab','Background Color:')) - self.FontSizeLabel.setText(translate('AlertsTab','Font Size:')) - self.FontSizeSpinBox.setSuffix(translate('AlertsTab','pt')) - self.TimeoutLabel.setText(translate('AlertsTab','Alert timeout:')) - self.TimeoutSpinBox.setSuffix(translate('AlertsTab','s')) - self.LocationLabel.setText(translate('AlertsTab','Location:')) - self.PreviewGroupBox.setTitle(translate('AlertsTab','Preview')) - self.FontPreview.setText(translate('AlertsTab','openlp.org')) - self.LocationComboBox.setItemText(0, translate('AlertsTab','Top')) - self.LocationComboBox.setItemText(1, translate('AlertsTab','Bottom')) + self.FontGroupBox.setTitle( + translate(u'AlertsPlugin.AlertsTab', u'Font')) + self.FontLabel.setText( + translate(u'AlertsPlugin.AlertsTab', u'Font Name:')) + self.FontColorLabel.setText( + translate(u'AlertsPlugin.AlertsTab', u'Font Color:')) + self.BackgroundColorLabel.setText( + translate(u'AlertsPlugin.AlertsTab', u'Background Color:')) + self.FontSizeLabel.setText( + translate(u'AlertsPlugin.AlertsTab', u'Font Size:')) + self.FontSizeSpinBox.setSuffix( + translate(u'AlertsPlugin.AlertsTab', u'pt')) + self.TimeoutLabel.setText( + translate(u'AlertsPlugin.AlertsTab', u'Alert timeout:')) + self.TimeoutSpinBox.setSuffix( + translate(u'AlertsPlugin.AlertsTab', u's')) + self.LocationLabel.setText( + translate(u'AlertsPlugin.AlertsTab', u'Location:')) + self.PreviewGroupBox.setTitle( + translate(u'AlertsPlugin.AlertsTab', u'Preview')) + self.FontPreview.setText( + translate(u'AlertsPlugin.AlertsTab', u'openlp.org')) + self.LocationComboBox.setItemText(0, + translate(u'AlertsPlugin.AlertsTab', u'Top')) + self.LocationComboBox.setItemText(1, + translate(u'AlertsPlugin.AlertsTab', u'Bottom')) def onBackgroundColorButtonClicked(self): self.bg_color = QtGui.QColorDialog.getColor( From 0788937721a57c2454c41242353d3fc548189932 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 13:49:39 +0200 Subject: [PATCH 06/17] Fixed translate() function in BiblesPlugin --- openlp/plugins/bibles/bibleplugin.py | 7 +- .../plugins/bibles/forms/bibleimportwizard.py | 96 ++++++++++++------- .../plugins/bibles/forms/importwizardform.py | 54 ++++++----- openlp/plugins/bibles/lib/biblestab.py | 45 +++++---- openlp/plugins/bibles/lib/mediaitem.py | 54 +++++------ openlp/plugins/bibles/lib/opensong.py | 3 +- 6 files changed, 157 insertions(+), 102 deletions(-) diff --git a/openlp/plugins/bibles/bibleplugin.py b/openlp/plugins/bibles/bibleplugin.py index d0ae71fbc..ca018cabd 100644 --- a/openlp/plugins/bibles/bibleplugin.py +++ b/openlp/plugins/bibles/bibleplugin.py @@ -88,9 +88,10 @@ class BiblePlugin(Plugin): self.media_item.onImportClick() def about(self): - about_text = translate('BiblePlugin','Bible Plugin
This ' - 'plugin allows bible verses from different sources to be ' - 'displayed on the screen during the service.') + about_text = translate(u'BiblesPlugin.BiblePlugin', + u'Bible Plugin
This ' + u'plugin allows bible verses from different sources to be ' + u'displayed on the screen during the service.') return about_text def can_delete_theme(self, theme): diff --git a/openlp/plugins/bibles/forms/bibleimportwizard.py b/openlp/plugins/bibles/forms/bibleimportwizard.py index c2aa2dde4..48fef9bf0 100644 --- a/openlp/plugins/bibles/forms/bibleimportwizard.py +++ b/openlp/plugins/bibles/forms/bibleimportwizard.py @@ -308,49 +308,79 @@ class Ui_BibleImportWizard(object): QtCore.QMetaObject.connectSlotsByName(BibleImportWizard) def retranslateUi(self, BibleImportWizard): - BibleImportWizard.setWindowTitle(translate('ImportWizardForm', 'Bible Import Wizard')) + BibleImportWizard.setWindowTitle( + translate(u'BiblesPlugin.ImportWizardForm', u'Bible Import Wizard')) self.TitleLabel.setText( u'%s' % \ - translate('ImportWizardForm', 'Welcome to the Bible Import Wizard')) + translate(u'BiblesPlugin.ImportWizardForm', + u'Welcome to the Bible Import Wizard')) self.InformationLabel.setText( - translate('ImportWizardForm', 'This wizard will help you to import Bibles from a ' - 'variety of formats. Click the next button below to start the ' - 'process by selecting a format to import from.')) - self.SelectPage.setTitle(translate('ImportWizardForm', 'Select Import Source')) + translate(u'BiblesPlugin.ImportWizardForm', + u'This wizard will help you to import Bibles from a ' + u'variety of formats. Click the next button below to start the ' + u'process by selecting a format to import from.')) + self.SelectPage.setTitle(translate(u'BiblesPlugin.ImportWizardForm', + u'Select Import Source')) self.SelectPage.setSubTitle( - translate('ImportWizardForm', 'Select the import format, and where to import from.')) - self.FormatLabel.setText(translate('ImportWizardForm', 'Format:')) - self.FormatComboBox.setItemText(0, translate('ImportWizardForm', 'OSIS')) - self.FormatComboBox.setItemText(1, translate('ImportWizardForm', 'CSV')) - self.FormatComboBox.setItemText(2, translate('ImportWizardForm', 'OpenSong')) - self.FormatComboBox.setItemText(3, translate('ImportWizardForm', 'Web Download')) - self.OsisLocationLabel.setText(translate('ImportWizardForm', 'File Location:')) - self.BooksLocationLabel.setText(translate('ImportWizardForm', 'Books Location:')) - self.VerseLocationLabel.setText(translate('ImportWizardForm', 'Verse Location:')) - self.OpenSongFileLabel.setText(translate('ImportWizardForm', 'Bible Filename:')) - self.LocationLabel.setText(translate('ImportWizardForm', 'Location:')) - self.LocationComboBox.setItemText(0, translate('ImportWizardForm', 'Crosswalk')) - self.LocationComboBox.setItemText(1, translate('ImportWizardForm', 'BibleGateway')) - self.BibleLabel.setText(translate('ImportWizardForm', 'Bible:')) + translate(u'BiblesPlugin.ImportWizardForm', + u'Select the import format, and where to import from.')) + self.FormatLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Format:')) + self.FormatComboBox.setItemText(0, + translate(u'BiblesPlugin.ImportWizardForm', u'OSIS')) + self.FormatComboBox.setItemText(1, + translate(u'BiblesPlugin.ImportWizardForm', u'CSV')) + self.FormatComboBox.setItemText(2, + translate(u'BiblesPlugin.ImportWizardForm', u'OpenSong')) + self.FormatComboBox.setItemText(3, + translate(u'BiblesPlugin.ImportWizardForm', u'Web Download')) + self.OsisLocationLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'File Location:')) + self.BooksLocationLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Books Location:')) + self.VerseLocationLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Verse Location:')) + self.OpenSongFileLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Bible Filename:')) + self.LocationLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Location:')) + self.LocationComboBox.setItemText(0, + translate(u'BiblesPlugin.ImportWizardForm', u'Crosswalk')) + self.LocationComboBox.setItemText(1, + translate(u'BiblesPlugin.ImportWizardForm', u'BibleGateway')) + self.BibleLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Bible:')) self.WebDownloadTabWidget.setTabText( self.WebDownloadTabWidget.indexOf(self.DownloadOptionsTab), - translate('ImportWizardForm', 'Download Options')) - self.AddressLabel.setText(translate('ImportWizardForm', 'Server:')) - self.UsernameLabel.setText(translate('ImportWizardForm', 'Username:')) - self.PasswordLabel.setText(translate('ImportWizardForm', 'Password:')) + translate(u'BiblesPlugin.ImportWizardForm', u'Download Options')) + self.AddressLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Server:')) + self.UsernameLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Username:')) + self.PasswordLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Password:')) self.WebDownloadTabWidget.setTabText( self.WebDownloadTabWidget.indexOf(self.ProxyServerTab), - translate('ImportWizardForm', 'Proxy Server (Optional)')) - self.LicenseDetailsPage.setTitle(translate('ImportWizardForm', 'License Details')) + translate(u'BiblesPlugin.ImportWizardForm', + u'Proxy Server (Optional)')) + self.LicenseDetailsPage.setTitle( + translate(u'BiblesPlugin.ImportWizardForm', u'License Details')) self.LicenseDetailsPage.setSubTitle( - translate('ImportWizardForm', 'Set up the Bible\'s license details.')) - self.VersionNameLabel.setText(translate('ImportWizardForm', 'Version Name:')) - self.CopyrightLabel.setText(translate('ImportWizardForm', 'Copyright:')) - self.PermissionLabel.setText(translate('ImportWizardForm', 'Permission:')) - self.ImportPage.setTitle(translate('ImportWizardForm', 'Importing')) + translate(u'BiblesPlugin.ImportWizardForm', + u'Set up the Bible\'s license details.')) + self.VersionNameLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Version Name:')) + self.CopyrightLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Copyright:')) + self.PermissionLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Permission:')) + self.ImportPage.setTitle( + translate(u'BiblesPlugin.ImportWizardForm', u'Importing')) self.ImportPage.setSubTitle( - translate('ImportWizardForm', 'Please wait while your Bible is imported.')) - self.ImportProgressLabel.setText(translate('ImportWizardForm', 'Ready.')) + translate(u'BiblesPlugin.ImportWizardForm', + u'Please wait while your Bible is imported.')) + self.ImportProgressLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Ready.')) self.ImportProgressBar.setFormat(u'%p%') diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 84ed345f4..00ecce6d5 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -123,8 +123,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): if self.field(u'source_format').toInt()[0] == BibleFormat.OSIS: if self.field(u'osis_location').toString() == u'': QtGui.QMessageBox.critical(self, - translate('ImportWizardForm','Invalid Bible Location'), - translate('ImportWizardForm','You need to specify a file to import your ' + translate(u'BiblesPlugin.ImportWizardForm', u'Invalid Bible Location'), + translate(u'BiblesPlugin.ImportWizardForm', u'You need to specify a file to import your ' 'Bible from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OSISLocationEdit.setFocus() @@ -132,16 +132,16 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): elif self.field(u'source_format').toInt()[0] == BibleFormat.CSV: if self.field(u'csv_booksfile').toString() == u'': QtGui.QMessageBox.critical(self, - translate('ImportWizardForm','Invalid Books File'), - translate('ImportWizardForm','You need to specify a file with books of ' + translate(u'BiblesPlugin.ImportWizardForm', u'Invalid Books File'), + translate(u'BiblesPlugin.ImportWizardForm', u'You need to specify a file with books of ' 'the Bible to use in the import.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.BooksLocationEdit.setFocus() return False elif self.field(u'csv_versefile').toString() == u'': QtGui.QMessageBox.critical(self, - translate('ImportWizardForm','Invalid Verse File'), - translate('ImportWizardForm','You need to specify a file of Bible ' + translate(u'BiblesPlugin.ImportWizardForm', u'Invalid Verse File'), + translate(u'BiblesPlugin.ImportWizardForm', u'You need to specify a file of Bible ' 'verses to import.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.CsvVerseLocationEdit.setFocus() @@ -149,8 +149,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): elif self.field(u'source_format').toInt()[0] == BibleFormat.OpenSong: if self.field(u'opensong_file').toString() == u'': QtGui.QMessageBox.critical(self, - translate('ImportWizardForm','Invalid OpenSong Bible'), - translate('ImportWizardForm','You need to specify an OpenSong Bible ' + translate(u'BiblesPlugin.ImportWizardForm', u'Invalid OpenSong Bible'), + translate(u'BiblesPlugin.ImportWizardForm', u'You need to specify an OpenSong Bible ' 'file to import.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OpenSongFileEdit.setFocus() @@ -162,16 +162,16 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): license_copyright = variant_to_unicode(self.field(u'license_copyright')) if license_version == u'': QtGui.QMessageBox.critical(self, - translate('ImportWizardForm','Empty Version Name'), - translate('ImportWizardForm','You need to specify a version name for your ' + translate(u'BiblesPlugin.ImportWizardForm', u'Empty Version Name'), + translate(u'BiblesPlugin.ImportWizardForm', u'You need to specify a version name for your ' 'Bible.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.VersionNameEdit.setFocus() return False elif license_copyright == u'': QtGui.QMessageBox.critical(self, - translate('ImportWizardForm','Empty Copyright'), - translate('ImportWizardForm','You need to set a copyright for your Bible! ' + translate(u'BiblesPlugin.ImportWizardForm', u'Empty Copyright'), + translate(u'BiblesPlugin.ImportWizardForm', u'You need to set a copyright for your Bible! ' 'Bibles in the Public Domain need to be marked as ' 'such.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) @@ -179,8 +179,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): return False elif self.manager.exists(license_version): QtGui.QMessageBox.critical(self, - translate('ImportWizardForm','Bible Exists'), - translate('ImportWizardForm','This Bible already exists! Please import ' + translate(u'BiblesPlugin.ImportWizardForm', u'Bible Exists'), + translate(u'BiblesPlugin.ImportWizardForm', u'This Bible already exists! Please import ' 'a different Bible or first delete the existing one.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.VersionNameEdit.setFocus() @@ -200,34 +200,40 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): """ self.BibleComboBox.clear() for bible in self.web_bible_list[index].keys(): - self.BibleComboBox.addItem(unicode(translate('ImportWizardForm',bible))) + self.BibleComboBox.addItem(unicode( + translate(u'BiblesPlugin.ImportWizardForm', bible))) def onOsisFileButtonClicked(self): """ Show the file open dialog for the OSIS file. """ - self.getFileName(translate('ImportWizardForm','Open OSIS File'), + self.getFileName( + translate(u'BiblesPlugin.ImportWizardForm', u'Open OSIS File'), self.OSISLocationEdit) def onBooksFileButtonClicked(self): """ Show the file open dialog for the books CSV file. """ - self.getFileName(translate('ImportWizardForm','Open Books CSV File'), + self.getFileName( + translate(u'BiblesPlugin.ImportWizardForm', u'Open Books CSV File'), self.BooksLocationEdit) def onCsvVersesFileButtonClicked(self): """ Show the file open dialog for the verses CSV file. """ - self.getFileName(translate('ImportWizardForm','Open Verses CSV File'), + self.getFileName( + translate(u'BiblesPlugin.ImportWizardForm', + u'Open Verses CSV File'), self.CsvVerseLocationEdit) def onOpenSongBrowseButtonClicked(self): """ Show the file open dialog for the OpenSong file. """ - self.getFileName(translate('ImportWizardForm','Open OpenSong Bible'), + self.getFileName( + translate(u'BiblesPlugin.ImportWizardForm', u'Open OpenSong Bible'), self.OpenSongFileEdit) def onCancelButtonClicked(self, checked): @@ -362,7 +368,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.ImportProgressBar.setMinimum(0) self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setValue(0) - self.ImportProgressLabel.setText(translate('ImportWizardForm','Starting import...')) + self.ImportProgressLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', u'Starting import...')) Receiver.send_message(u'openlp_process_events') def performImport(self): @@ -416,10 +423,13 @@ class ImportWizardForm(QtGui.QWizard, Ui_BibleImportWizard): self.manager.save_meta_data(license_version, license_version, license_copyright, license_permission) self.manager.reload_bibles() - self.ImportProgressLabel.setText(translate('ImportWizardForm','Finished import.')) + self.ImportProgressLabel.setText( + translate(u'BiblesPlugin.ImportWizardForm', + u'Finished import.')) else: self.ImportProgressLabel.setText( - translate('ImportWizardForm','Your Bible import failed.')) + translate(u'BiblesPlugin.ImportWizardForm', + u'Your Bible import failed.')) importer.delete() def postImport(self): diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 549adb818..c01ba8c8d 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -45,7 +45,7 @@ class BiblesTab(SettingsTab): def setupUi(self): self.setObjectName(u'BiblesTab') - self.tabTitleVisible = translate('BiblesTab','Bibles') + self.tabTitleVisible = translate(u'BiblesPlugin,BiblesTab', u'Bibles') self.BibleLayout = QtGui.QHBoxLayout(self) self.BibleLayout.setSpacing(8) self.BibleLayout.setMargin(8) @@ -149,22 +149,35 @@ class BiblesTab(SettingsTab): QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList) def retranslateUi(self): - self.VerseDisplayGroupBox.setTitle(translate('BiblesTab','Verse Display')) + self.VerseDisplayGroupBox.setTitle( + translate(u'BiblesPlugin,BiblesTab', u'Verse Display')) self.NewChaptersCheckBox.setText( - translate('BiblesTab','Only show new chapter numbers')) - self.LayoutStyleLabel.setText(translate('BiblesTab','Layout Style:')) - self.DisplayStyleLabel.setText(translate('BiblesTab','Display Style:')) - self.BibleThemeLabel.setText(translate('BiblesTab','Bible Theme:')) - self.LayoutStyleComboBox.setItemText(0, translate('BiblesTab','verse per slide')) - self.LayoutStyleComboBox.setItemText(1, translate('BiblesTab','verse per line')) - self.LayoutStyleComboBox.setItemText(2, translate('BiblesTab','continuous')) - self.DisplayStyleComboBox.setItemText(0, translate('BiblesTab','No brackets')) - self.DisplayStyleComboBox.setItemText(1, translate('BiblesTab','( and )')) - self.DisplayStyleComboBox.setItemText(2, translate('BiblesTab','{ and }')) - self.DisplayStyleComboBox.setItemText(3, translate('BiblesTab','[ and ]')) - self.ChangeNoteLabel.setText(translate('BiblesTab', - 'Note:\nChanges don\'t affect verses already in the service')) - self.BibleDualCheckBox.setText(translate('BiblesTab','Display Dual Bible Verses')) + translate(u'BiblesPlugin,BiblesTab', + u'Only show new chapter numbers')) + self.LayoutStyleLabel.setText( + translate(u'BiblesPlugin,BiblesTab', u'Layout Style:')) + self.DisplayStyleLabel.setText( + translate(u'BiblesPlugin,BiblesTab', u'Display Style:')) + self.BibleThemeLabel.setText( + translate(u'BiblesPlugin,BiblesTab', u'Bible Theme:')) + self.LayoutStyleComboBox.setItemText(0, + translate(u'BiblesPlugin,BiblesTab', u'verse per slide')) + self.LayoutStyleComboBox.setItemText(1, + translate(u'BiblesPlugin,BiblesTab', u'verse per line')) + self.LayoutStyleComboBox.setItemText(2, + translate(u'BiblesPlugin,BiblesTab', u'continuous')) + self.DisplayStyleComboBox.setItemText(0, + translate(u'BiblesPlugin,BiblesTab', u'No brackets')) + self.DisplayStyleComboBox.setItemText(1, + translate(u'BiblesPlugin,BiblesTab', u'( and )')) + self.DisplayStyleComboBox.setItemText(2, + translate(u'BiblesPlugin,BiblesTab', u'{ and }')) + self.DisplayStyleComboBox.setItemText(3, + translate(u'BiblesPlugin,BiblesTab', u'[ and ]')) + self.ChangeNoteLabel.setText(translate(u'BiblesPlugin.BiblesTab', + u'Note:\nChanges don\'t affect verses already in the service')) + self.BibleDualCheckBox.setText( + translate(u'BiblesPlugin,BiblesTab', u'Display Dual Bible Verses')) def onBibleThemeComboBoxChanged(self): self.bible_theme = self.BibleThemeComboBox.currentText() diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 24c4d42e0..47518ac85 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -71,7 +71,7 @@ class BibleMediaItem(MediaManagerItem): return unicode(obj) def initPluginNameVisible(self): - self.PluginNameVisible = translate('MediaItem','Bible') + self.PluginNameVisible = translate(u'BiblesPlugin,MediaItem', u'Bible') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -147,7 +147,7 @@ class BibleMediaItem(MediaManagerItem): self.QuickMessage = QtGui.QLabel(self.QuickTab) self.QuickMessage.setObjectName(u'QuickMessage') self.QuickLayout.addWidget(self.QuickMessage, 6, 0, 1, 3) - self.SearchTabWidget.addTab(self.QuickTab, translate('MediaItem','Quick')) + self.SearchTabWidget.addTab(self.QuickTab, translate(u'BiblesPlugin,MediaItem', u'Quick')) QuickSpacerItem = QtGui.QSpacerItem(20, 35, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.QuickLayout.addItem(QuickSpacerItem, 6, 2, 1, 1) @@ -231,7 +231,7 @@ class BibleMediaItem(MediaManagerItem): self.AdvancedMessage = QtGui.QLabel(self.AdvancedTab) self.AdvancedMessage.setObjectName(u'AdvancedMessage') self.AdvancedLayout.addWidget(self.AdvancedMessage, 8, 0, 1, 3) - self.SearchTabWidget.addTab(self.AdvancedTab, translate('MediaItem','Advanced')) + self.SearchTabWidget.addTab(self.AdvancedTab, translate(u'BiblesPlugin,MediaItem', u'Advanced')) # Add the search tab widget to the page layout self.PageLayout.addWidget(self.SearchTabWidget) # Combo Boxes @@ -289,27 +289,27 @@ class BibleMediaItem(MediaManagerItem): def retranslateUi(self): log.debug(u'retranslateUi') - self.QuickVersionLabel.setText(translate('MediaItem','Version:')) - self.QuickSecondVersionLabel.setText(translate('MediaItem','Dual:')) - self.QuickSearchLabel.setText(translate('MediaItem','Search Type:')) - self.QuickSearchLabel.setText(translate('MediaItem','Find:')) - self.QuickSearchButton.setText(translate('MediaItem','Search')) - self.QuickClearLabel.setText(translate('MediaItem','Results:')) - self.AdvancedVersionLabel.setText(translate('MediaItem','Version:')) - self.AdvancedSecondBibleLabel.setText(translate('MediaItem','Dual:')) - self.AdvancedBookLabel.setText(translate('MediaItem','Book:')) - self.AdvancedChapterLabel.setText(translate('MediaItem','Chapter:')) - self.AdvancedVerseLabel.setText(translate('MediaItem','Verse:')) - self.AdvancedFromLabel.setText(translate('MediaItem','From:')) - self.AdvancedToLabel.setText(translate('MediaItem','To:')) - self.AdvancedClearLabel.setText(translate('MediaItem','Results:')) - self.AdvancedSearchButton.setText(translate('MediaItem','Search')) - self.QuickSearchComboBox.addItem(translate('MediaItem','Verse Search')) - self.QuickSearchComboBox.addItem(translate('MediaItem','Text Search')) - self.ClearQuickSearchComboBox.addItem(translate('MediaItem','Clear')) - self.ClearQuickSearchComboBox.addItem(translate('MediaItem','Keep')) - self.ClearAdvancedSearchComboBox.addItem(translate('MediaItem','Clear')) - self.ClearAdvancedSearchComboBox.addItem(translate('MediaItem','Keep')) + self.QuickVersionLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Version:')) + self.QuickSecondVersionLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Dual:')) + self.QuickSearchLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Search Type:')) + self.QuickSearchLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Find:')) + self.QuickSearchButton.setText(translate(u'BiblesPlugin,MediaItem', u'Search')) + self.QuickClearLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Results:')) + self.AdvancedVersionLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Version:')) + self.AdvancedSecondBibleLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Dual:')) + self.AdvancedBookLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Book:')) + self.AdvancedChapterLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Chapter:')) + self.AdvancedVerseLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Verse:')) + self.AdvancedFromLabel.setText(translate(u'BiblesPlugin,MediaItem', u'From:')) + self.AdvancedToLabel.setText(translate(u'BiblesPlugin,MediaItem', u'To:')) + self.AdvancedClearLabel.setText(translate(u'BiblesPlugin,MediaItem', u'Results:')) + self.AdvancedSearchButton.setText(translate(u'BiblesPlugin,MediaItem', u'Search')) + self.QuickSearchComboBox.addItem(translate(u'BiblesPlugin,MediaItem', u'Verse Search')) + self.QuickSearchComboBox.addItem(translate(u'BiblesPlugin,MediaItem', u'Text Search')) + self.ClearQuickSearchComboBox.addItem(translate(u'BiblesPlugin,MediaItem', u'Clear')) + self.ClearQuickSearchComboBox.addItem(translate(u'BiblesPlugin,MediaItem', u'Keep')) + self.ClearAdvancedSearchComboBox.addItem(translate(u'BiblesPlugin,MediaItem', u'Clear')) + self.ClearAdvancedSearchComboBox.addItem(translate(u'BiblesPlugin,MediaItem', u'Keep')) def initialise(self): log.debug(u'bible manager initialise') @@ -363,8 +363,8 @@ class BibleMediaItem(MediaManagerItem): def onNoBookFound(self): QtGui.QMessageBox.critical(self, - translate('MediaItem','No Book Found'), - translate('MediaItem','No matching book could be found in this Bible.'), + translate(u'BiblesPlugin,MediaItem', u'No Book Found'), + translate(u'BiblesPlugin,MediaItem', u'No matching book could be found in this Bible.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok), QtGui.QMessageBox.Ok ) @@ -574,7 +574,7 @@ class BibleMediaItem(MediaManagerItem): self.verses = self.parent.manager.get_verse_count(bible, book, 1) if self.verses == 0: self.AdvancedSearchButton.setEnabled(False) - self.AdvancedMessage.setText(translate('MediaItem','Bible not fully loaded')) + self.AdvancedMessage.setText(translate(u'BiblesPlugin,MediaItem', u'Bible not fully loaded')) else: self.AdvancedSearchButton.setEnabled(True) self.AdvancedMessage.setText(u'') diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 3b55b9b74..3160d4b87 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -94,7 +94,8 @@ class OpenSongBible(BibleDB): ) Receiver.send_message(u'openlp_process_events') self.wizard.incrementProgressBar( - QtCore.QString('%s %s %s' % (translate('OpenSong','Importing'),\ + QtCore.QString('%s %s %s' % ( + translate(u'BiblesPlugin.Opensong', u'Importing'),\ db_book.name, chapter.attrib[u'n']))) self.commit() except: From febb743acd2b78d53c793298a8f9dda948b683a6 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 15:26:42 +0200 Subject: [PATCH 07/17] Fixed all translate() function in ImagePlugin --- openlp/plugins/custom/customplugin.py | 9 +-- .../plugins/custom/forms/editcustomdialog.py | 63 +++++++++++++------ openlp/plugins/custom/forms/editcustomform.py | 18 ++++-- openlp/plugins/custom/lib/customtab.py | 7 ++- openlp/plugins/custom/lib/mediaitem.py | 2 +- openlp/plugins/images/imageplugin.py | 15 ++--- openlp/plugins/images/lib/imagetab.py | 11 ++-- openlp/plugins/images/lib/mediaitem.py | 21 ++++--- 8 files changed, 92 insertions(+), 54 deletions(-) diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index e84c9845b..f0d8202a2 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -67,10 +67,11 @@ class CustomPlugin(Plugin): self.remove_toolbox_item() def about(self): - about_text = translate('CustomPlugin','Custom Plugin
This plugin ' - 'allows slides to be displayed on the screen in the same way ' - 'songs are. This plugin provides greater freedom over the ' - 'songs plugin.
') + about_text = translate(u'CustomPlugin.CustomPlugin', + u'Custom Plugin
This plugin ' + u'allows slides to be displayed on the screen in the same way ' + u'songs are. This plugin provides greater freedom over the ' + u'songs plugin.
') return about_text def can_delete_theme(self, theme): diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 57497ebaf..35b6a5f98 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -153,23 +153,46 @@ class Ui_customEditDialog(object): customEditDialog.setTabOrder(self.DownButton, self.ThemeComboBox) def retranslateUi(self, customEditDialog): - customEditDialog.setWindowTitle(translate('EditCustomForm', 'Edit Custom Slides')) - self.UpButton.setToolTip(translate('EditCustomForm', 'Move slide Up 1')) - self.DownButton.setToolTip(translate('EditCustomForm', 'Move slide down 1')) - self.TitleLabel.setText(translate('EditCustomForm', 'Title:')) - self.AddButton.setText(translate('EditCustomForm', 'Add New')) - self.AddButton.setToolTip(translate('EditCustomForm', 'Add new slide at bottom')) - self.EditButton.setText(translate('EditCustomForm', 'Edit')) - self.EditButton.setToolTip(translate('EditCustomForm', 'Edit selected slide')) - self.EditAllButton.setText(translate('EditCustomForm', 'Edit All')) - self.EditAllButton.setToolTip(translate('EditCustomForm', 'Edit all slides')) - self.SaveButton.setText(translate('EditCustomForm', 'Save')) - self.SaveButton.setToolTip(translate('EditCustomForm', 'Replace edited slide')) - self.DeleteButton.setText(translate('EditCustomForm', 'Delete')) - self.DeleteButton.setToolTip(translate('EditCustomForm', 'Delete selected slide')) - self.ClearButton.setText(translate('EditCustomForm', 'Clear')) - self.ClearButton.setToolTip(translate('EditCustomForm', 'Clear edit area')) - self.SplitButton.setText(translate('EditCustomForm', 'Split Slide')) - self.SplitButton.setToolTip(translate('EditCustomForm', 'Add slide split')) - self.ThemeLabel.setText(translate('EditCustomForm', 'Theme:')) - self.CreditLabel.setText(translate('EditCustomForm', 'Credits:')) + customEditDialog.setWindowTitle(translate(u'CustomPlugin.EditCustomForm', + u'Edit Custom Slides')) + self.UpButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm' + u'CustomPlugin.EditCustomForm', + u'Move slide Up 1')) + self.DownButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', u'Move slide down 1')) + self.TitleLabel.setText( + translate(u'CustomPlugin.EditCustomForm', u'Title:')) + self.AddButton.setText( + translate(u'CustomPlugin.EditCustomForm', u'Add New')) + self.AddButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', + u'Add new slide at bottom')) + self.EditButton.setText( + translate(u'CustomPlugin.EditCustomForm', u'Edit')) + self.EditButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', u'Edit selected slide')) + self.EditAllButton.setText( + translate(u'CustomPlugin.EditCustomForm', u'Edit All')) + self.EditAllButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', u'Edit all slides')) + self.SaveButton.setText( + translate(u'CustomPlugin.EditCustomForm', u'Save')) + self.SaveButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', u'Replace edited slide')) + self.DeleteButton.setText( + translate(u'CustomPlugin.EditCustomForm', u'Delete')) + self.DeleteButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', u'Delete selected slide')) + self.ClearButton.setText( + translate(u'CustomPlugin.EditCustomForm', u'Clear')) + self.ClearButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', u'Clear edit area')) + self.SplitButton.setText( + translate(u'CustomPlugin.EditCustomForm', u'Split Slide')) + self.SplitButton.setToolTip( + translate(u'CustomPlugin.EditCustomForm', u'Add slide split')) + self.ThemeLabel.setText( + translate(u'CustomPlugin.EditCustomForm', u'Theme:')) + self.CreditLabel.setText( + translate(u'CustomPlugin.EditCustomForm', u'Credits:')) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index b424e81e5..bbd8f0fed 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -47,7 +47,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): self.setupUi(self) # Connecting signals and slots self.previewButton = QtGui.QPushButton() - self.previewButton.setText(translate('editCustomForm','Save && Preview')) + self.previewButton.setText(translate(u'CustomPlugin.EditCustomForm', + u'Save && Preview')) self.buttonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.buttonBox, @@ -84,7 +85,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def onPreview(self, button): log.debug(u'onPreview') - if button.text() == unicode(translate('editCustomForm','Save && Preview')) \ + if button.text() == unicode(translate(u'CustomPlugin.EditCustomForm', + u'Save && Preview')) \ and self.saveCustom(): Receiver.send_message(u'custom_preview') @@ -147,7 +149,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def saveCustom(self): valid, message = self._validate() if not valid: - QtGui.QMessageBox.critical(self, translate('editCustomForm','Error'), message, + QtGui.QMessageBox.critical(self, + translate(u'CustomPlugin.EditCustomForm', u'Error'), message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return False sxml = SongXMLBuilder() @@ -263,12 +266,15 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def _validate(self): if len(self.TitleEdit.displayText()) == 0: self.TitleEdit.setFocus() - return False, translate('editCustomForm','You need to enter a title') + return False, translate(u'CustomPlugin.EditCustomForm', + u'You need to enter a title') # must have 1 slide if self.VerseListView.count() == 0: self.VerseTextEdit.setFocus() - return False, translate('editCustomForm','You need to enter a slide') + return False, translate(u'CustomPlugin.EditCustomForm', + u'You need to enter a slide') if self.VerseTextEdit.toPlainText(): self.VerseTextEdit.setFocus() - return False, translate('editCustomForm','You have unsaved data, please save or clear') + return False, translate(u'CustomPlugin.editCustomForm', + u'You have unsaved data, please save or clear') return True, u'' diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index b768bbcc5..6f1ac86f1 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -36,7 +36,7 @@ class CustomTab(SettingsTab): def setupUi(self): self.setObjectName(u'CustomTab') - self.tabTitleVisible = translate('CustomTab','Custom') + self.tabTitleVisible = translate(u'CustomPlugin.CustomTab', u'Custom') self.CustomLayout = QtGui.QFormLayout(self) self.CustomLayout.setObjectName(u'CustomLayout') self.CustomModeGroupBox = QtGui.QGroupBox(self) @@ -55,9 +55,10 @@ class CustomTab(SettingsTab): self.onDisplayFooterCheckBoxChanged) def retranslateUi(self): - self.CustomModeGroupBox.setTitle(translate('CustomTab','Custom Display')) + self.CustomModeGroupBox.setTitle(translate(u'CustomPlugin.CustomTab', + u'Custom Display')) self.DisplayFooterCheckBox.setText( - translate('CustomTab','Display Footer')) + translate(u'CustomPlugin.CustomTab', u'Display Footer')) def onDisplayFooterCheckBoxChanged(self, check_state): self.displayFooter = False diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index a6ba6af46..2c828dd08 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -66,7 +66,7 @@ class CustomMediaItem(MediaManagerItem): QtCore.SIGNAL(u'custom_preview'), self.onPreviewClick) def initPluginNameVisible(self): - self.PluginNameVisible = translate('mediaItem','Custom') + self.PluginNameVisible = translate(u'CustomPlugin.MediaItem', u'Custom') def requiredIcons(self): MediaManagerItem.requiredIcons(self) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 7bd8d2031..038558a22 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -56,11 +56,12 @@ class ImagePlugin(Plugin): return ImageMediaItem(self, self.icon, self.name) def about(self): - about_text = translate('ImagePlugin','Image Plugin
Allows images of ' - 'all types to be displayed. If a number of images are selected ' - 'together and presented on the live controller it is possible ' - 'to turn them into a timed loop.From the plugin if the ' - 'Override background is chosen and an image is selected ' - 'any songs which are rendered will use the selected image from ' - 'the background instead of the one provied by the theme.
') + about_text = translate(u'ImagePlugin.ImagePlugin', u'Image Plugin' + u'
Allows images of all types to be displayed. If a number ' + u'of images are selected together and presented on the live ' + u'controller it is possible to turn them into a timed loop.' + u'From the plugin if the Override background is chosen and ' + u'an image is selected any songs which are rendered will use the ' + u'selected image from the background instead of the one provied by ' + u'the theme.
') return about_text diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index e34bec2b0..24706d60e 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -36,7 +36,7 @@ class ImageTab(SettingsTab): def setupUi(self): self.setObjectName(u'ImageTab') - self.tabTitleVisible = translate('ImageTab','Images') + self.tabTitleVisible = translate(u'ImagePlugin.ImageTab', u'Images') self.ImageLayout = QtGui.QFormLayout(self) self.ImageLayout.setObjectName(u'ImageLayout') self.ImageSettingsGroupBox = QtGui.QGroupBox(self) @@ -63,9 +63,12 @@ class ImageTab(SettingsTab): QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) def retranslateUi(self): - self.ImageSettingsGroupBox.setTitle(translate('ImageTab','Image Settings')) - self.TimeoutLabel.setText(translate('ImageTab','Slide Loop Delay:')) - self.TimeoutSpinBox.setSuffix(translate('ImageTab','sec')) + self.ImageSettingsGroupBox.setTitle( + translate(u'ImagePlugin.ImageTab', u'Image Settings')) + self.TimeoutLabel.setText( + translate(u'ImagePlugin.ImageTab', u'Slide Loop Delay:')) + self.TimeoutSpinBox.setSuffix( + translate(u'ImagePlugin.ImageTab', u'sec')) def onTimeoutSpinBoxChanged(self): self.loop_delay = self.TimeoutSpinBox.value() diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 8c6cb550c..a6f9880a9 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -56,12 +56,13 @@ class ImageMediaItem(MediaManagerItem): MediaManagerItem.__init__(self, parent, icon, title) def initPluginNameVisible(self): - self.PluginNameVisible = translate('MediaItem','Image') + self.PluginNameVisible = translate(u'ImagePlugin.MediaItem', u'Image') def retranslateUi(self): - self.OnNewPrompt = translate('MediaItem','Select Image(s)') - self.OnNewFileMasks = translate('MediaItem', - 'Images (*.jpg *.jpeg *.gif *.png *.bmp);; All files (*)') + self.OnNewPrompt = translate(u'ImagePlugin.MediaItem', + u'Select Image(s)') + self.OnNewFileMasks = translate(u'ImagePlugin.MediaItem', + u'Images (*.jpg *.jpeg *.gif *.png *.bmp);; All files (*)') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -90,7 +91,7 @@ class ImageMediaItem(MediaManagerItem): self.ListView.addAction( contextMenuAction( self.ListView, u':/slides/slide_blank.png', - translate('MediaItem','Replace Live Background'), + translate(u'ImagePlugin.MediaItem', u'Replace Live Background'), self.onReplaceClick)) def addEndHeaderBar(self): @@ -105,7 +106,8 @@ class ImageMediaItem(MediaManagerItem): self.ImageWidget.setObjectName(u'ImageWidget') self.blankButton = self.Toolbar.addToolbarButton( u'Replace Background', u':/slides/slide_blank.png', - translate('MediaItem','Replace Live Background'), self.onReplaceClick, False) + translate(u'ImagePlugin.MediaItem', u'Replace Live Background'), + self.onReplaceClick, False) # Add the song widget to the page layout self.PageLayout.addWidget(self.ImageWidget) @@ -143,7 +145,8 @@ class ImageMediaItem(MediaManagerItem): def generateSlideData(self, service_item, item=None): items = self.ListView.selectedIndexes() if items: - service_item.title = unicode(translate('MediaItem','Image(s)')) + service_item.title = unicode( + translate(u'ImagePlugin.MediaItem', u'Image(s)')) service_item.add_capability(ItemCapabilities.AllowsMaintain) service_item.add_capability(ItemCapabilities.AllowsPreview) service_item.add_capability(ItemCapabilities.AllowsLoop) @@ -161,8 +164,8 @@ class ImageMediaItem(MediaManagerItem): def onReplaceClick(self): if not self.ListView.selectedIndexes(): QtGui.QMessageBox.information(self, - translate('MediaItem','No item selected'), - translate('MediaItem','You must select one item')) + translate(u'ImagePlugin.MediaItem', u'No item selected'), + translate(u'ImagePlugin.MediaItem', u'You must select one item')) items = self.ListView.selectedIndexes() for item in items: bitem = self.ListView.item(item.row()) From 4571e808baf554d7ab19bc5264d0a2049dd408df Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 15:30:57 +0200 Subject: [PATCH 08/17] Fixed translate() function in MediaPlugin --- openlp/plugins/media/lib/mediaitem.py | 25 +++++++++++++++---------- openlp/plugins/media/mediaplugin.py | 5 +++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index af9cbb6e4..715aecc60 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -58,13 +58,14 @@ class MediaMediaItem(MediaManagerItem): self.ServiceItemIconName = u':/media/media_video.png' def initPluginNameVisible(self): - self.PluginNameVisible = translate('MediaItem','Media') + self.PluginNameVisible = translate(u'MediaPlugin.MediaItem', u'Media') def retranslateUi(self): - self.OnNewPrompt = translate('MediaItem','Select Media') - self.OnNewFileMasks = translate('MediaItem','Videos (%s);;' - 'Audio (%s);;' - 'All files (*)' % (self.parent.video_list, self.parent.audio_list)) + self.OnNewPrompt = translate(u'MediaPlugin.MediaItem', u'Select Media') + self.OnNewFileMasks = translate(u'MediaPlugin.MediaItem', + u'Videos (%s);;' + u'Audio (%s);;' + u'All files (*)' % (self.parent.video_list, self.parent.audio_list)) def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -78,7 +79,7 @@ class MediaMediaItem(MediaManagerItem): self.ListView.addAction( contextMenuAction( self.ListView, u':/slides/slide_blank.png', - translate('MediaItem','Replace Live Background'), + translate(u'MediaPlugin.MediaItem', u'Replace Live Background'), self.onReplaceClick)) def addEndHeaderBar(self): @@ -93,7 +94,8 @@ class MediaMediaItem(MediaManagerItem): self.ImageWidget.setObjectName(u'ImageWidget') self.blankButton = self.Toolbar.addToolbarButton( u'Replace Background', u':/slides/slide_blank.png', - translate('MediaItem','Replace Live Background'), self.onReplaceClick, False) + translate(u'MediaPlugin.MediaItem', u'Replace Live Background'), + self.onReplaceClick, False) # Add the song widget to the page layout self.PageLayout.addWidget(self.ImageWidget) @@ -105,8 +107,10 @@ class MediaMediaItem(MediaManagerItem): self.background = True if not self.ListView.selectedIndexes(): QtGui.QMessageBox.information(self, - translate('MediaItem','No item selected'), - translate('MediaItem','You must select one item')) + translate(u'MediaPlugin.MediaItem', + u'No item selected'), + translate(u'MediaPlugin.MediaItem', + u'You must select one item')) items = self.ListView.selectedIndexes() for item in items: bitem = self.ListView.item(item.row()) @@ -119,7 +123,8 @@ class MediaMediaItem(MediaManagerItem): if item is None: return False filename = unicode((item.data(QtCore.Qt.UserRole)).toString()) - service_item.title = unicode(translate('MediaItem','Media')) + service_item.title = unicode( + translate(u'MediaPlugin.MediaItem', u'Media')) service_item.add_capability(ItemCapabilities.RequiresMedia) frame = u':/media/image_clapperboard.png' (path, name) = os.path.split(filename) diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 709066521..6405d844d 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -76,6 +76,7 @@ class MediaPlugin(Plugin): return MediaMediaItem(self, self.icon, self.name) def about(self): - about_text = translate('MediaPlugin','Media Plugin
This plugin ' - 'allows the playing of audio and video media') + about_text = translate(u'MediaPlugin.MediaPlugin', + u'Media Plugin
This plugin ' + u'allows the playing of audio and video media') return about_text From 3c096b4d0aba715b2e04665e14fe59d55cb56117 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 15:42:24 +0200 Subject: [PATCH 09/17] Fixed translate() function in PresentationPlugin --- openlp/plugins/presentations/lib/mediaitem.py | 21 ++++++++++++------- .../presentations/lib/presentationtab.py | 10 ++++++--- .../presentations/presentationplugin.py | 9 ++++---- 3 files changed, 26 insertions(+), 14 deletions(-) diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 462d1a924..91dc6aed5 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -61,11 +61,14 @@ class PresentationMediaItem(MediaManagerItem): self.message_listener = MessageListener(self) def initPluginNameVisible(self): - self.PluginNameVisible = translate('MediaItem','Presentation') + self.PluginNameVisible = translate(u'PresentationPlugin.MediaItem', + u'Presentation') def retranslateUi(self): - self.OnNewPrompt = translate('MediaItem','Select Presentation(s)') - self.Automatic = translate('MediaItem','Automatic') + self.OnNewPrompt = translate(u'PresentationPlugin.MediaItem', + u'Select Presentation(s)') + self.Automatic = translate(u'PresentationPlugin.MediaItem', + u'Automatic') fileType = u'' for controller in self.controllers: if self.controllers[controller].enabled: @@ -75,7 +78,8 @@ class PresentationMediaItem(MediaManagerItem): if fileType.find(type) == -1: fileType += u'*%s ' % type self.parent.service_manager.supportedSuffixes(type) - self.OnNewFileMasks = translate('MediaItem','Presentations (%s)' % fileType) + self.OnNewFileMasks = translate(u'PresentationPlugin.MediaItem', + u'Presentations (%s)' % fileType) def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -101,7 +105,8 @@ class PresentationMediaItem(MediaManagerItem): self.DisplayTypeLabel = QtGui.QLabel(self.PresentationWidget) self.DisplayTypeLabel.setObjectName(u'SearchTypeLabel') self.DisplayLayout.addWidget(self.DisplayTypeLabel, 0, 0, 1, 1) - self.DisplayTypeLabel.setText(translate('MediaItem','Present using:')) + self.DisplayTypeLabel.setText( + translate(u'PresentationPlugin.MediaItem', u'Present using:')) # Add the Presentation widget to the page layout self.PageLayout.addWidget(self.PresentationWidget) @@ -134,8 +139,10 @@ class PresentationMediaItem(MediaManagerItem): (path, filename) = os.path.split(unicode(file)) if titles.count(filename) > 0: QtGui.QMessageBox.critical( - self, translate('MediaItem','File exists'), translate('MediaItem', - 'A presentation with that filename already exists.'), + self, translate(u'PresentationPlugin.MediaItem', + u'File exists'), + translate(u'PresentationPlugin.MediaItem', + u'A presentation with that filename already exists.'), QtGui.QMessageBox.Ok) else: icon = None diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 01854f8e6..89546e039 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -37,7 +37,8 @@ class PresentationTab(SettingsTab): def setupUi(self): self.setObjectName(u'PresentationTab') - self.tabTitleVisible = translate('PresentationTab','Presentations') + self.tabTitleVisible = translate(u'PresentationPlugin.PresentationTab', + u'Presentations') self.PresentationLayout = QtGui.QHBoxLayout(self) self.PresentationLayout.setSpacing(8) self.PresentationLayout.setMargin(8) @@ -88,12 +89,15 @@ class PresentationTab(SettingsTab): self.PresentationLayout.addWidget(self.PresentationRightWidget) def retranslateUi(self): - self.VerseDisplayGroupBox.setTitle(translate('PresentationTab','Available Controllers')) + self.VerseDisplayGroupBox.setTitle( + translate(u'PresentationPlugin.PresentationTab', + u'Available Controllers')) for key in self.controllers: controller = self.controllers[key] checkbox = self.PresenterCheckboxes[controller.name] checkbox.setText( - u'%s %s' % (controller.name, translate('PresentationTab','available'))) + u'%s %s' % (controller.name, + translate(u'PresentationPlugin.PresentationTab', u'available'))) def load(self): for key in self.controllers: diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 8ebf19250..036e8fc42 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -108,9 +108,10 @@ class PresentationPlugin(Plugin): return False def about(self): - about_text = translate('PresentationPlugin','Presentation Plugin
Delivers ' - 'the ability to show presentations using a number of different ' - 'programs. The choice of available presentation programs is ' - 'available to the user in a drop down box.') + about_text = translate(u'PresentationPlugin.PresentationPlugin', + u'Presentation Plugin
Delivers ' + u'the ability to show presentations using a number of different ' + u'programs. The choice of available presentation programs is ' + u'available to the user in a drop down box.') return about_text From 5e64814133d5471429225c07f6a49b724ce81540 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 15:44:07 +0200 Subject: [PATCH 10/17] Fixed translate() function in RemotePlugin --- openlp/plugins/remotes/lib/remotetab.py | 5 +++-- openlp/plugins/remotes/remoteplugin.py | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/remotes/lib/remotetab.py b/openlp/plugins/remotes/lib/remotetab.py index c91bbfa72..1f91002fb 100644 --- a/openlp/plugins/remotes/lib/remotetab.py +++ b/openlp/plugins/remotes/lib/remotetab.py @@ -36,7 +36,7 @@ class RemoteTab(SettingsTab): def setupUi(self): self.setObjectName(u'RemoteTab') - self.tabTitleVisible = translate('RemoteTab','Remotes') + self.tabTitleVisible = translate(u'RemotePlugin.RemoteTab', u'Remotes') self.RemoteLayout = QtGui.QFormLayout(self) self.RemoteLayout.setObjectName(u'RemoteLayout') self.RemoteModeGroupBox = QtGui.QGroupBox(self) @@ -53,7 +53,8 @@ class RemoteTab(SettingsTab): 0, QtGui.QFormLayout.LabelRole, self.RemoteModeGroupBox) def retranslateUi(self): - self.RemoteModeGroupBox.setTitle(translate('RemoteTab','Remotes Receiver Port')) + self.RemoteModeGroupBox.setTitle( + translate(u'RemotePlugin.RemoteTab', u'Remotes Receiver Port')) def load(self): self.RemotePortSpinBox.setValue( diff --git a/openlp/plugins/remotes/remoteplugin.py b/openlp/plugins/remotes/remoteplugin.py index a6b4ede63..e3d68a9a3 100644 --- a/openlp/plugins/remotes/remoteplugin.py +++ b/openlp/plugins/remotes/remoteplugin.py @@ -69,8 +69,9 @@ class RemotesPlugin(Plugin): """ Information about this plugin """ - about_text = translate('RemotePlugin','Remote Plugin
This plugin ' - 'provides the ability to send messages to a running version of ' - 'openlp on a different computer via a web browser or other app
' - 'The Primary use for this would be to send alerts from a creche') + about_text = translate(u'RemotePlugin.RemotePlugin', + u'Remote Plugin
This plugin ' + u'provides the ability to send messages to a running version of ' + u'openlp on a different computer via a web browser or other app
' + u'The Primary use for this would be to send alerts from a creche') return about_text From 6e1ef3cc707d41c638cf74f0844f3a6aa5741acb Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 16:22:00 +0200 Subject: [PATCH 11/17] Fixed translate() function in songsPlugin and songusagePlugin --- openlp/plugins/songs/forms/authorsdialog.py | 12 ++- openlp/plugins/songs/forms/authorsform.py | 19 +++-- openlp/plugins/songs/forms/editsongdialog.py | 76 ++++++++++++------- openlp/plugins/songs/forms/editsongform.py | 30 +++++--- openlp/plugins/songs/forms/editversedialog.py | 30 +++++--- .../plugins/songs/forms/openlpexportdialog.py | 56 +++++++++----- .../plugins/songs/forms/openlpimportdialog.py | 57 +++++++++----- .../songs/forms/opensongexportdialog.py | 54 ++++++++----- .../songs/forms/opensongimportdialog.py | 18 +++-- openlp/plugins/songs/forms/songbookdialog.py | 8 +- openlp/plugins/songs/forms/songbookform.py | 5 +- openlp/plugins/songs/forms/songimportform.py | 38 ++++++---- .../plugins/songs/forms/songimportwizard.py | 75 +++++++++++------- .../songs/forms/songmaintenancedialog.py | 39 ++++++---- .../songs/forms/songmaintenanceform.py | 72 +++++++++++------- openlp/plugins/songs/forms/topicsdialog.py | 6 +- openlp/plugins/songs/forms/topicsform.py | 5 +- openlp/plugins/songs/lib/mediaitem.py | 43 +++++++---- openlp/plugins/songs/lib/songimport.py | 4 +- openlp/plugins/songs/lib/songstab.py | 9 ++- openlp/plugins/songs/songsplugin.py | 11 ++- .../songusage/forms/songusagedeletedialog.py | 3 +- .../songusage/forms/songusagedeleteform.py | 6 +- .../songusage/forms/songusagedetaildialog.py | 13 +++- .../songusage/forms/songusagedetailform.py | 3 +- openlp/plugins/songusage/songusageplugin.py | 7 +- 26 files changed, 454 insertions(+), 245 deletions(-) diff --git a/openlp/plugins/songs/forms/authorsdialog.py b/openlp/plugins/songs/forms/authorsdialog.py index dbd7af077..082b1133d 100644 --- a/openlp/plugins/songs/forms/authorsdialog.py +++ b/openlp/plugins/songs/forms/authorsdialog.py @@ -74,7 +74,11 @@ class Ui_AuthorsDialog(object): QtCore.QMetaObject.connectSlotsByName(AuthorsDialog) def retranslateUi(self, AuthorsDialog): - AuthorsDialog.setWindowTitle(translate('AuthorsForm', 'Author Maintenance')) - self.DisplayLabel.setText(translate('AuthorsForm', 'Display name:')) - self.FirstNameLabel.setText(translate('AuthorsForm', 'First name:')) - self.LastNameLabel.setText(translate('AuthorsForm', 'Last name:')) + AuthorsDialog.setWindowTitle( + translate(u'SongsPlugin.AuthorsForm', u'Author Maintenance')) + self.DisplayLabel.setText( + translate(u'SongsPlugin.AuthorsForm', u'Display name:')) + self.FirstNameLabel.setText( + translate(u'SongsPlugin.AuthorsForm', u'First name:')) + self.LastNameLabel.setText( + translate(u'SongsPlugin.AuthorsForm', u'Last name:')) diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 27ec33294..04d0f8c28 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -78,24 +78,27 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): def accept(self): if not self.FirstNameEdit.text(): QtGui.QMessageBox.critical( - self, translate('AuthorsForm','Error'), - translate('AuthorsForm','You need to type in the first name of the author.'), + self, translate(u'SongsPlugin.AuthorsForm', u'Error'), + translate(u'SongsPlugin.AuthorsForm', + u'You need to type in the first name of the author.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.FirstNameEdit.setFocus() return False elif not self.LastNameEdit.text(): QtGui.QMessageBox.critical( - self, translate('AuthorsForm','Error'), - translate('AuthorsForm','You need to type in the last name of the author.'), + self, translate(u'SongsPlugin.AuthorsForm', u'Error'), + translate(u'SongsPlugin.AuthorsForm', + u'You need to type in the last name of the author.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.LastNameEdit.setFocus() return False elif not self.DisplayEdit.text(): if QtGui.QMessageBox.critical( - self, translate('AuthorsForm','Error'), - translate('AuthorsForm','You haven\'t set a display name for the ' - 'author, would you like me to combine the first and ' - 'last names for you?'), + self, translate(u'SongsPlugin.AuthorsForm', u'Error'), + translate(u'SongsPlugin.AuthorsForm', + u'You haven\'t set a display name for the ' + u'author, would you like me to combine the first and ' + u'last names for you?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) ) == QtGui.QMessageBox.Yes: diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index a6f2f5b56..a5a525acb 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -423,36 +423,60 @@ class Ui_EditSongDialog(object): EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox) def retranslateUi(self, EditSongDialog): - EditSongDialog.setWindowTitle(translate('EditSongForm', 'Song Editor')) - self.TitleLabel.setText(translate('EditSongForm', 'Title:')) - self.AlternativeTitleLabel.setText(translate('EditSongForm', 'Alternative Title:')) - self.LyricsLabel.setText(translate('EditSongForm', 'Lyrics:')) - self.VerseOrderLabel.setText(translate('EditSongForm', 'Verse Order:')) - self.VerseAddButton.setText(translate('EditSongForm', 'Add')) - self.VerseEditButton.setText(translate('EditSongForm', 'Edit')) - self.VerseEditAllButton.setText(translate('EditSongForm', 'Edit All')) - self.VerseDeleteButton.setText(translate('EditSongForm', 'Delete')) + EditSongDialog.setWindowTitle( + translate(u'SongsPlugin.EditSongForm', u'Song Editor')) + self.TitleLabel.setText( + translate(u'SongsPlugin.EditSongForm', u'Title:')) + self.AlternativeTitleLabel.setText( + translate(u'SongsPlugin.EditSongForm', u'Alternative Title:')) + self.LyricsLabel.setText( + translate(u'SongsPlugin.EditSongForm', u'Lyrics:')) + self.VerseOrderLabel.setText( + translate(u'SongsPlugin.EditSongForm', u'Verse Order:')) + self.VerseAddButton.setText( + translate(u'SongsPlugin.EditSongForm', u'Add')) + self.VerseEditButton.setText( + translate(u'SongsPlugin.EditSongForm', u'Edit')) + self.VerseEditAllButton.setText( + translate(u'SongsPlugin.EditSongForm', u'Edit All')) + self.VerseDeleteButton.setText( + translate(u'SongsPlugin.EditSongForm', u'Delete')) self.SongTabWidget.setTabText( self.SongTabWidget.indexOf(self.LyricsTab), - translate('EditSongForm', 'Title && Lyrics')) - self.AuthorsGroupBox.setTitle(translate('EditSongForm', 'Authors')) - self.AuthorAddButton.setText(translate('EditSongForm', '&Add to Song')) - self.AuthorRemoveButton.setText(translate('EditSongForm', '&Remove')) + translate(u'SongsPlugin.EditSongForm', u'Title && Lyrics')) + self.AuthorsGroupBox.setTitle( + translate(u'SongsPlugin.EditSongForm', u'Authors')) + self.AuthorAddButton.setText( + translate(u'SongsPlugin.EditSongForm', u'&Add to Song')) + self.AuthorRemoveButton.setText( + translate(u'SongsPlugin.EditSongForm', u'&Remove')) self.MaintenanceButton.setText( - translate('EditSongForm', '&Manage Authors, Topics, Books')) - self.TopicGroupBox.setTitle(translate('EditSongForm', 'Topic')) - self.TopicAddButton.setText(translate('EditSongForm', 'A&dd to Song')) - self.TopicRemoveButton.setText(translate('EditSongForm', 'R&emove')) - self.SongBookGroup.setTitle(translate('EditSongForm', 'Song Book')) + translate(u'SongsPlugin.EditSongForm', + u'&Manage Authors, Topics, Books')) + self.TopicGroupBox.setTitle( + translate(u'SongsPlugin.EditSongForm', u'Topic')) + self.TopicAddButton.setText( + translate(u'SongsPlugin.EditSongForm', u'A&dd to Song')) + self.TopicRemoveButton.setText( + translate(u'SongsPlugin.EditSongForm', u'R&emove')) + self.SongBookGroup.setTitle( + translate(u'SongsPlugin.EditSongForm', u'Song Book')) self.SongTabWidget.setTabText( self.SongTabWidget.indexOf(self.AuthorsTab), - translate('EditSongForm', 'Authors, Topics && Book')) - self.ThemeGroupBox.setTitle(translate('EditSongForm', 'Theme')) - self.ThemeAddButton.setText(translate('EditSongForm', 'Add a Theme')) - self.CopyrightGroupBox.setTitle(translate('EditSongForm', 'Copyright Information')) - self.CopyrightInsertButton.setText(translate('EditSongForm', u'\xa9')) - self.CCLILabel.setText(translate('EditSongForm', 'CCLI Number:')) - self.CommentsGroupBox.setTitle(translate('EditSongForm', 'Comments')) + translate(u'SongsPlugin.EditSongForm', u'Authors, Topics && Book')) + self.ThemeGroupBox.setTitle( + translate(u'SongsPlugin.EditSongForm', u'Theme')) + self.ThemeAddButton.setText( + translate(u'SongsPlugin.EditSongForm', u'Add a Theme')) + self.CopyrightGroupBox.setTitle( + translate(u'SongsPlugin.EditSongForm', u'Copyright Information')) + self.CopyrightInsertButton.setText( + translate('EditSongForm', u'\xa9')) + self.CCLILabel.setText( + translate(u'SongsPlugin.EditSongForm', u'CCLI Number:')) + self.CommentsGroupBox.setTitle( + translate(u'SongsPlugin.EditSongForm', u'Comments')) self.SongTabWidget.setTabText( self.SongTabWidget.indexOf(self.ThemeTab), - translate('EditSongForm', 'Theme, Copyright Info && Comments')) + translate(u'SongsPlugin.EditSongForm', + u'Theme, Copyright Info && Comments')) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 1c61458e0..7c258387d 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -101,7 +101,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): QtCore.QObject.connect(self.VerseOrderEdit, QtCore.SIGNAL(u'lostFocus()'), self.onVerseOrderEditLostFocus) self.previewButton = QtGui.QPushButton() - self.previewButton.setText(translate('EditSongForm','Save && Preview')) + self.previewButton.setText( + translate(u'SongsPlugin.EditSongForm', u'Save && Preview')) self.ButtonBox.addButton( self.previewButton, QtGui.QDialogButtonBox.ActionRole) QtCore.QObject.connect(self.ButtonBox, @@ -460,27 +461,32 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if len(self.TitleEditItem.displayText()) == 0: self.SongTabWidget.setCurrentIndex(0) self.TitleEditItem.setFocus() - return False, translate('EditSongForm','You need to enter a song title.') + return False, translate(u'SongsPlugin.EditSongForm', + u'You need to enter a song title.') if self.VerseListWidget.rowCount() == 0: self.SongTabWidget.setCurrentIndex(0) self.VerseListWidget.setFocus() - return False, translate('EditSongForm','You need to enter some verses.') + return False, translate(u'SongsPlugin.EditSongForm', + u'You need to enter some verses.') if self.AuthorsListView.count() == 0: self.SongTabWidget.setCurrentIndex(1) self.AuthorsListView.setFocus() #split the verse list by space and mark lower case for testing - taglist = unicode(translate('EditSongForm',' bitped')) + taglist = unicode(translate(u'SongsPlugin.EditSongForm', u' bitped')) for verse in unicode(self.VerseOrderEdit.text()).lower().split(u' '): if len(verse) > 1: - if (verse[0:1] == u'%s' % translate('EditSongForm','v') or - verse[0:1] == u'%s' % translate('EditSongForm','c')) \ + if (verse[0:1] == u'%s' % translate(u'SongsPlugin.EditSongForm', + u'v') or + verse[0:1] == u'%s' % translate(u'SongsPlugin.EditSongForm', + u'c')) \ and verse[1:].isdigit(): pass else: self.SongTabWidget.setCurrentIndex(0) self.VerseOrderEdit.setFocus() return False, \ - translate('EditSongForm','Invalid verse entry - Vx or Cx') + translate(u'SongsPlugin.EditSongForm', + u'Invalid verse entry - Vx or Cx') else: if taglist.find(verse) > -1: pass @@ -488,8 +494,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.SongTabWidget.setCurrentIndex(0) self.VerseOrderEdit.setFocus() return False, \ - translate('EditSongForm',\ - 'Invalid verse entry, values must be I,B,T,P,E,O,Vx,Cx') + translate(u'SongsPlugin.EditSongForm',\ + u'Invalid verse entry, values must be ' + u'I,B,T,P,E,O,Vx,Cx') return True, u'' def onTitleEditItemLostFocus(self): @@ -524,7 +531,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): The Song is valid so as the plugin to add it to preview to see. """ log.debug(u'onPreview') - if button.text() == unicode(translate('EditSongForm','Save && Preview')) \ + if button.text() == unicode( + translate(u'SongsPlugin.EditSongForm', u'Save && Preview')) \ and self.saveSong(): Receiver.send_message(u'songs_preview') @@ -542,7 +550,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): valid, message = self._validate_song() if not valid: QtGui.QMessageBox.critical( - self, translate('EditSongForm','Error'), message, + self, translate(u'SongsPlugin.EditSongForm', u'Error'), message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) return False self.song.title = unicode(self.TitleEditItem.displayText()) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index d7a059215..81db6303d 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -90,15 +90,25 @@ class Ui_EditVerseDialog(object): QtCore.QMetaObject.connectSlotsByName(EditVerseDialog) def retranslateUi(self, EditVerseDialog): - EditVerseDialog.setWindowTitle(translate('EditVerseForm', 'Edit Verse')) - self.VerseTypeLabel.setText(translate('EditVerseForm', 'Verse Type:')) - self.VerseTypeComboBox.setItemText(0, translate('EditVerseForm', 'Verse')) - self.VerseTypeComboBox.setItemText(1, translate('EditVerseForm', 'Chorus')) - self.VerseTypeComboBox.setItemText(2, translate('EditVerseForm', 'Bridge')) - self.VerseTypeComboBox.setItemText(3, translate('EditVerseForm', 'Pre-Chorus')) - self.VerseTypeComboBox.setItemText(4, translate('EditVerseForm', 'Intro')) - self.VerseTypeComboBox.setItemText(5, translate('EditVerseForm', 'Ending')) - self.VerseTypeComboBox.setItemText(6, translate('EditVerseForm', 'Other')) - self.InsertButton.setText(translate('EditVerseForm', 'Insert')) + EditVerseDialog.setWindowTitle( + translate(u'SongsPlugin.EditVerseForm', u'Edit Verse')) + self.VerseTypeLabel.setText( + translate(u'SongsPlugin.EditVerseForm', u'Verse Type:')) + self.VerseTypeComboBox.setItemText(0, + translate(u'SongsPlugin.EditVerseForm', u'Verse')) + self.VerseTypeComboBox.setItemText(1, + translate(u'SongsPlugin.EditVerseForm', u'Chorus')) + self.VerseTypeComboBox.setItemText(2, + translate(u'SongsPlugin.EditVerseForm', u'Bridge')) + self.VerseTypeComboBox.setItemText(3, + translate(u'SongsPlugin.EditVerseForm', u'Pre-Chorus')) + self.VerseTypeComboBox.setItemText(4, + translate(u'SongsPlugin.EditVerseForm', u'Intro')) + self.VerseTypeComboBox.setItemText(5, + translate(u'SongsPlugin.EditVerseForm', u'Ending')) + self.VerseTypeComboBox.setItemText(6, + translate(u'SongsPlugin.EditVerseForm', u'Other')) + self.InsertButton.setText( + translate(u'SongsPlugin.EditVerseForm', u'Insert')) diff --git a/openlp/plugins/songs/forms/openlpexportdialog.py b/openlp/plugins/songs/forms/openlpexportdialog.py index 2046f2f95..bf8d06349 100644 --- a/openlp/plugins/songs/forms/openlpexportdialog.py +++ b/openlp/plugins/songs/forms/openlpexportdialog.py @@ -286,21 +286,41 @@ class Ui_OpenLPExportDialog(object): QtCore.QMetaObject.connectSlotsByName(OpenLPExportDialog) def retranslateUi(self, OpenLPExportDialog): - OpenLPExportDialog.setWindowTitle(translate('OpenLPExportForm', 'openlp.org Song Exporter')) - self.ExportFileLabel.setText(translate('OpenLPExportForm', 'Select openlp.org export filename:')) - self.ExportListLabel.setText(translate('OpenLPExportForm', 'Full Song List')) - self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title')) - self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author')) - self.ExportSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All')) - self.ExportFilterComboBox.setItemText(0, translate('OpenLPExportForm', 'Lyrics')) - self.ExportFilterComboBox.setItemText(1, translate('OpenLPExportForm', 'Title')) - self.ExportFilterComboBox.setItemText(2, translate('OpenLPExportForm', 'Author')) - self.SelectedListLabel.setText(translate('OpenLPExportForm', 'Song Export List')) - self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPExportForm', 'Song Title')) - self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPExportForm', 'Author')) - self.SelectedSelectAllPushButton.setText(translate('OpenLPExportForm', 'Select All')) - self.SelectedRemoveSelectedButton.setText(translate('OpenLPExportForm', 'Remove Selected')) - self.ProgressGroupBox.setTitle(translate('OpenLPExportForm', 'Progress:')) - self.ProgressLabel.setText(translate('OpenLPExportForm', 'Ready to export')) - self.ExportPushButton.setText(translate('OpenLPExportForm', 'Export')) - self.ClosePushButton.setText(translate('OpenLPExportForm', 'Close')) + OpenLPExportDialog.setWindowTitle( + translate(u'SongsPlugin.OpenLPExportForm', + u'openlp.org Song Exporter')) + self.ExportFileLabel.setText( + translate(u'SongsPlugin.OpenLPExportForm', + u'Select openlp.org export filename:')) + self.ExportListLabel.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Full Song List')) + self.ExportListTable.horizontalHeaderItem(0).setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Song Title')) + self.ExportListTable.horizontalHeaderItem(1).setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Author')) + self.ExportSelectAllPushButton.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Select All')) + self.ExportFilterComboBox.setItemText(0, + translate(u'SongsPlugin.OpenLPExportForm', u'Lyrics')) + self.ExportFilterComboBox.setItemText(1, + translate(u'SongsPlugin.OpenLPExportForm', u'Title')) + self.ExportFilterComboBox.setItemText(2, + translate(u'SongsPlugin.OpenLPExportForm', u'Author')) + self.SelectedListLabel.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Song Export List')) + self.SelectedListTable.horizontalHeaderItem(0).setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Song Title')) + self.SelectedListTable.horizontalHeaderItem(1).setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Author')) + self.SelectedSelectAllPushButton.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Select All')) + self.SelectedRemoveSelectedButton.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Remove Selected')) + self.ProgressGroupBox.setTitle( + translate(u'SongsPlugin.OpenLPExportForm', u'Progress:')) + self.ProgressLabel.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Ready to export')) + self.ExportPushButton.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Export')) + self.ClosePushButton.setText( + translate(u'SongsPlugin.OpenLPExportForm', u'Close')) diff --git a/openlp/plugins/songs/forms/openlpimportdialog.py b/openlp/plugins/songs/forms/openlpimportdialog.py index 8080b5a25..87366d442 100644 --- a/openlp/plugins/songs/forms/openlpimportdialog.py +++ b/openlp/plugins/songs/forms/openlpimportdialog.py @@ -286,21 +286,42 @@ class Ui_OpenLPImportDialog(object): QtCore.QMetaObject.connectSlotsByName(OpenLPImportDialog) def retranslateUi(self, OpenLPImportDialog): - OpenLPImportDialog.setWindowTitle(translate('OpenLPImportForm', 'openlp.org Song Importer')) - self.ImportFileLabel.setText(translate('OpenLPImportForm', 'Select openlp.org songfile to import:')) - self.ImportListLabel.setText(translate('OpenLPImportForm', 'Import File Song List')) - self.ImportListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title')) - self.ImportListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author')) - self.ImportSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All')) - self.ImportFilterComboBox.setItemText(0, translate('OpenLPImportForm', 'Lyrics')) - self.ImportFilterComboBox.setItemText(1, translate('OpenLPImportForm', 'Title')) - self.ImportFilterComboBox.setItemText(2, translate('OpenLPImportForm', 'Author')) - self.SelectedListLabel.setText(translate('OpenLPImportForm', 'Song Import List')) - self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenLPImportForm', 'Song Title')) - self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenLPImportForm', 'Author')) - self.SelectedSelectAllPushButton.setText(translate('OpenLPImportForm', 'Select All')) - self.SelectedRemoveSelectedButton.setText(translate('OpenLPImportForm', 'Remove Selected')) - self.ProgressGroupBox.setTitle(translate('OpenLPImportForm', 'Progress:')) - self.ProgressLabel.setText(translate('OpenLPImportForm', 'Ready to import')) - self.ImportPushButton.setText(translate('OpenLPImportForm', 'Import')) - self.ClosePushButton.setText(translate('OpenLPImportForm', 'Close')) + OpenLPImportDialog.setWindowTitle( + translate(u'SongsPlugin.OpenLPImportForm', + u'openlp.org Song Importer')) + self.ImportFileLabel.setText( + translate(u'SongsPlugin.OpenLPImportForm', + u'Select openlp.org songfile to import:')) + self.ImportListLabel.setText( + translate(u'SongsPlugin.OpenLPImportForm', + u'Import File Song List')) + self.ImportListTable.horizontalHeaderItem(0).setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Song Title')) + self.ImportListTable.horizontalHeaderItem(1).setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Author')) + self.ImportSelectAllPushButton.setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Select All')) + self.ImportFilterComboBox.setItemText(0, + translate(u'SongsPlugin.OpenLPImportForm', u'Lyrics')) + self.ImportFilterComboBox.setItemText(1, + translate(u'SongsPlugin.OpenLPImportForm', u'Title')) + self.ImportFilterComboBox.setItemText(2, + translate(u'SongsPlugin.OpenLPImportForm', u'Author')) + self.SelectedListLabel.setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Song Import List')) + self.SelectedListTable.horizontalHeaderItem(0).setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Song Title')) + self.SelectedListTable.horizontalHeaderItem(1).setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Author')) + self.SelectedSelectAllPushButton.setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Select All')) + self.SelectedRemoveSelectedButton.setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Remove Selected')) + self.ProgressGroupBox.setTitle( + translate(u'SongsPlugin.OpenLPImportForm', u'Progress:')) + self.ProgressLabel.setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Ready to import')) + self.ImportPushButton.setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Import')) + self.ClosePushButton.setText( + translate(u'SongsPlugin.OpenLPImportForm', u'Close')) diff --git a/openlp/plugins/songs/forms/opensongexportdialog.py b/openlp/plugins/songs/forms/opensongexportdialog.py index 1821145ee..8e92879f0 100644 --- a/openlp/plugins/songs/forms/opensongexportdialog.py +++ b/openlp/plugins/songs/forms/opensongexportdialog.py @@ -286,21 +286,39 @@ class Ui_OpenSongExportDialog(object): QtCore.QMetaObject.connectSlotsByName(OpenSongExportDialog) def retranslateUi(self, OpenSongExportDialog): - OpenSongExportDialog.setWindowTitle(translate('OpenSongExportForm', 'OpenSong Song Exporter')) - self.ExportFileLabel.setText(translate('OpenSongExportForm', 'Select OpenSong song folder:')) - self.ExportListLabel.setText(translate('OpenSongExportForm', 'Full Song List')) - self.ExportListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title')) - self.ExportListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author')) - self.ExportSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All')) - self.ExportFilterComboBox.setItemText(0, translate('OpenSongExportForm', 'Lyrics')) - self.ExportFilterComboBox.setItemText(1, translate('OpenSongExportForm', 'Title')) - self.ExportFilterComboBox.setItemText(2, translate('OpenSongExportForm', 'Author')) - self.SelectedListLabel.setText(translate('OpenSongExportForm', 'Song Export List')) - self.SelectedListTable.horizontalHeaderItem(0).setText(translate('OpenSongExportForm', 'Song Title')) - self.SelectedListTable.horizontalHeaderItem(1).setText(translate('OpenSongExportForm', 'Author')) - self.SelectedSelectAllPushButton.setText(translate('OpenSongExportForm', 'Select All')) - self.SelectedRemoveSelectedButton.setText(translate('OpenSongExportForm', 'Remove Selected')) - self.ProgressGroupBox.setTitle(translate('OpenSongExportForm', 'Progress:')) - self.ProgressLabel.setText(translate('OpenSongExportForm', 'Ready to export')) - self.ExportPushButton.setText(translate('OpenSongExportForm', 'Export')) - self.ClosePushButton.setText(translate('OpenSongExportForm', 'Close')) + OpenSongExportDialog.setWindowTitle( + translate(u'SongsPlugin.OpenSongExportForm', u'OpenSong Song Exporter')) + self.ExportFileLabel.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Select OpenSong song folder:')) + self.ExportListLabel.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Full Song List')) + self.ExportListTable.horizontalHeaderItem(0).setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Song Title')) + self.ExportListTable.horizontalHeaderItem(1).setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Author')) + self.ExportSelectAllPushButton.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Select All')) + self.ExportFilterComboBox.setItemText(0, + translate(u'SongsPlugin.OpenSongExportForm', u'Lyrics')) + self.ExportFilterComboBox.setItemText(1, + translate(u'SongsPlugin.OpenSongExportForm', u'Title')) + self.ExportFilterComboBox.setItemText(2, + translate(u'SongsPlugin.OpenSongExportForm', u'Author')) + self.SelectedListLabel.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Song Export List')) + self.SelectedListTable.horizontalHeaderItem(0).setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Song Title')) + self.SelectedListTable.horizontalHeaderItem(1).setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Author')) + self.SelectedSelectAllPushButton.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Select All')) + self.SelectedRemoveSelectedButton.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Remove Selected')) + self.ProgressGroupBox.setTitle( + translate(u'SongsPlugin.OpenSongExportForm', u'Progress:')) + self.ProgressLabel.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Ready to export')) + self.ExportPushButton.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Export')) + self.ClosePushButton.setText( + translate(u'SongsPlugin.OpenSongExportForm', u'Close')) diff --git a/openlp/plugins/songs/forms/opensongimportdialog.py b/openlp/plugins/songs/forms/opensongimportdialog.py index 9091e08ad..46b135eae 100644 --- a/openlp/plugins/songs/forms/opensongimportdialog.py +++ b/openlp/plugins/songs/forms/opensongimportdialog.py @@ -101,9 +101,15 @@ class Ui_OpenSongImportDialog(object): QtCore.QMetaObject.connectSlotsByName(OpenSongImportDialog) def retranslateUi(self, OpenSongImportDialog): - OpenSongImportDialog.setWindowTitle(translate('OpenSongImportForm', 'OpenSong Song Importer')) - self.ImportFileLabel.setText(translate('OpenSongImportForm', 'OpenSong Folder:')) - self.ProgressGroupBox.setTitle(translate('OpenSongImportForm', 'Progress:')) - self.ProgressLabel.setText(translate('OpenSongImportForm', 'Ready to import')) - self.ImportPushButton.setText(translate('OpenSongImportForm', 'Import')) - self.ClosePushButton.setText(translate('OpenSongImportForm', 'Close')) + OpenSongImportDialog.setWindowTitle( + translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Song Importer')) + self.ImportFileLabel.setText( + translate(u'SongsPlugin.OpenSongImportForm', u'OpenSong Folder:')) + self.ProgressGroupBox.setTitle( + translate(u'SongsPlugin.OpenSongImportForm', u'Progress:')) + self.ProgressLabel.setText( + translate(u'SongsPlugin.OpenSongImportForm', u'Ready to import')) + self.ImportPushButton.setText( + translate(u'SongsPlugin.OpenSongImportForm', u'Import')) + self.ClosePushButton.setText( + translate(u'SongsPlugin.OpenSongImportForm', u'Close')) diff --git a/openlp/plugins/songs/forms/songbookdialog.py b/openlp/plugins/songs/forms/songbookdialog.py index 3122ed21b..06e27d04e 100644 --- a/openlp/plugins/songs/forms/songbookdialog.py +++ b/openlp/plugins/songs/forms/songbookdialog.py @@ -66,6 +66,8 @@ class Ui_SongBookDialog(object): QtCore.QMetaObject.connectSlotsByName(SongBookDialog) def retranslateUi(self, SongBookDialog): - SongBookDialog.setWindowTitle(translate('SongBookForm', 'Edit Book')) - self.NameLabel.setText(translate('SongBookForm', 'Name:')) - self.PublisherLabel.setText(translate('SongBookForm', 'Publisher:')) + SongBookDialog.setWindowTitle( + translate(u'SongsPlugin.SongBookForm', u'Edit Book')) + self.NameLabel.setText(translate(u'SongsPlugin.SongBookForm', u'Name:')) + self.PublisherLabel.setText( + translate(u'SongsPlugin.SongBookForm', u'Publisher:')) diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index e3dfb25d7..ad85990f0 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -50,8 +50,9 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): def accept(self): if not self.NameEdit.text(): QtGui.QMessageBox.critical( - self, translate('SongBookForm','Error'), - translate('SongBookForm','You need to type in a book name!'), + self, translate(u'SongsPlugin.SongBookForm', u'Error'), + translate(u'SongsPlugin.SongBookForm', + u'You need to type in a book name!'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.NameEdit.setFocus() return False diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index c44a49506..75659da70 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -104,36 +104,43 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): if source_format == SongFormat.OpenLyrics: if self.OpenLyricsFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, - translate('SongImportForm','No OpenLyrics Files Selected'), - translate('SongImportForm','You need to add at least one OpenLyrics ' - 'song file to import from.'), + translate(u'SongsPlugin.SongImportForm', + u'No OpenLyrics Files Selected'), + translate(u'SongsPlugin.SongImportForm', + u'You need to add at least one OpenLyrics ' + u'song file to import from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OpenLyricsAddButton.setFocus() return False elif source_format == SongFormat.OpenSong: if self.OpenSongFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, - translate('SongImportForm','No OpenSong Files Selected'), - translate('SongImportForm','You need to add at least one OpenSong ' - 'song file to import from.'), + translate(u'SongsPlugin.SongImportForm', + u'No OpenSong Files Selected'), + translate(u'SongsPlugin.SongImportForm', + u'You need to add at least one OpenSong ' + u'song file to import from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.OpenSongAddButton.setFocus() return False elif source_format == SongFormat.CCLI: if self.CCLIFileListWidget.count() == 0: QtGui.QMessageBox.critical(self, - translate('SongImportForm','No CCLI Files Selected'), - translate('SongImportForm','You need to add at least one CCLI file ' - 'to import from.'), + translate(u'SongsPlugin.SongImportForm', + u'No CCLI Files Selected'), + translate(u'SongsPlugin.SongImportForm', + u'You need to add at least one CCLI file ' + u'to import from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.CCLIAddButton.setFocus() return False elif source_format == SongFormat.CSV: if self.CSVFilenameEdit.text().isEmpty(): QtGui.QMessageBox.critical(self, - translate('SongImportForm','No CSV File Selected'), - translate('SongImportForm','You need to specify a CSV file to import ' - 'from.'), + translate(u'SongsPlugin.SongImportForm', + u'No CSV File Selected'), + translate(u'SongsPlugin.SongImportForm', + u'You need to specify a CSV file to import from.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.CSVFilenameEdit.setFocus() return False @@ -184,7 +191,8 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): self.ImportProgressBar.setMinimum(0) self.ImportProgressBar.setMaximum(1188) self.ImportProgressBar.setValue(0) - self.ImportProgressLabel.setText(translate('SongImportForm','Starting import...')) + self.ImportProgressLabel.setText( + translate(u'SongsPlugin.SongImportForm', u'Starting import...')) Receiver.send_message(u'process_events') def performImport(self): @@ -235,10 +243,10 @@ class ImportWizardForm(QtGui.QWizard, Ui_SongImportWizard): # self.manager.save_meta_data(license_version, license_version, # license_copyright, license_permission) # self.manager.reload_bibles() -# self.ImportProgressLabel.setText(translate('SongImportForm','Finished import.')) +# self.ImportProgressLabel.setText(translate(u'SongsPlugin.SongImportForm', u'Finished import.')) # else: # self.ImportProgressLabel.setText( -# translate('SongImportForm','Your Bible import failed.')) +# translate(u'SongsPlugin.SongImportForm', u'Your Bible import failed.')) # importer.delete() def postImport(self): diff --git a/openlp/plugins/songs/forms/songimportwizard.py b/openlp/plugins/songs/forms/songimportwizard.py index 508195f8b..0556d1665 100644 --- a/openlp/plugins/songs/forms/songimportwizard.py +++ b/openlp/plugins/songs/forms/songimportwizard.py @@ -226,32 +226,55 @@ class Ui_SongImportWizard(object): QtCore.QMetaObject.connectSlotsByName(SongImportWizard) def retranslateUi(self, SongImportWizard): - SongImportWizard.setWindowTitle(translate('SongImportWizard','Song Import Wizard')) + SongImportWizard.setWindowTitle( + translate(u'SongsPlugin.SongImportWizard', u'Song Import Wizard')) self.TitleLabel.setText( '%s' % \ - translate('SongImportWizard','Welcome to the Song Import Wizard')) - self.InformationLabel.setText(translate('SongImportWizard','This wizard will help you ' - 'to import songs from a variety of formats. Click the next button ' - 'below to start the process by selecting a format to import from.')) - self.SourcePage.setTitle(translate('SongImportWizard','Select Import Source')) - self.SourcePage.setSubTitle(translate('SongImportWizard','Select the import format, ' - 'and where to import from.')) - self.FormatLabel.setText(translate('SongImportWizard','Format:')) - self.FormatComboBox.setItemText(0, translate('SongImportWizard','OpenLyrics')) - self.FormatComboBox.setItemText(1, translate('SongImportWizard','OpenSong')) - self.FormatComboBox.setItemText(2, translate('SongImportWizard','CCLI')) - self.FormatComboBox.setItemText(3, translate('SongImportWizard','CSV')) - self.OpenLyricsAddButton.setText(translate('SongImportWizard','Add Files...')) - self.OpenLyricsRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) - self.OpenSongAddButton.setText(translate('SongImportWizard','Add Files...')) - self.OpenSongRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) - self.CCLIAddButton.setText(translate('SongImportWizard','Add Files...')) - self.CCLIRemoveButton.setText(translate('SongImportWizard','Remove File(s)')) - self.CSVFilenameLabel.setText(translate('SongImportWizard','Filename:')) - self.CSVBrowseButton.setText(translate('SongImportWizard','Browse...')) - self.ImportPage.setTitle(translate('SongImportWizard','Importing')) - self.ImportPage.setSubTitle(translate('SongImportWizard','Please wait while your songs ' - 'are imported.')) - self.ImportProgressLabel.setText(translate('SongImportWizard','Ready.')) - self.ImportProgressBar.setFormat(translate('SongImportWizard','%p%')) + translate(u'SongsPlugin.SongImportWizard', + u'Welcome to the Song Import Wizard')) + self.InformationLabel.setText( + translate(u'SongsPlugin.SongImportWizard', + u'This wizard will help you to import songs from a variety of ' + u'formats. Click the next button below to start the process by ' + u'selecting a format to import from.')) + self.SourcePage.setTitle( + translate(u'SongsPlugin.SongImportWizard', u'Select Import Source')) + self.SourcePage.setSubTitle( + translate(u'SongsPlugin.SongImportWizard', + u'Select the import format, and where to import from.')) + self.FormatLabel.setText( + translate(u'SongsPlugin.SongImportWizard', u'Format:')) + self.FormatComboBox.setItemText(0, + translate(u'SongsPlugin.SongImportWizard', u'OpenLyrics')) + self.FormatComboBox.setItemText(1, + translate(u'SongsPlugin.SongImportWizard', u'OpenSong')) + self.FormatComboBox.setItemText(2, + translate(u'SongsPlugin.SongImportWizard', u'CCLI')) + self.FormatComboBox.setItemText(3, + translate(u'SongsPlugin.SongImportWizard', u'CSV')) + self.OpenLyricsAddButton.setText( + translate(u'SongsPlugin.SongImportWizard', u'Add Files...')) + self.OpenLyricsRemoveButton.setText( + translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)')) + self.OpenSongAddButton.setText( + translate(u'SongsPlugin.SongImportWizard', u'Add Files...')) + self.OpenSongRemoveButton.setText( + translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)')) + self.CCLIAddButton.setText( + translate(u'SongsPlugin.SongImportWizard', u'Add Files...')) + self.CCLIRemoveButton.setText( + translate(u'SongsPlugin.SongImportWizard', u'Remove File(s)')) + self.CSVFilenameLabel.setText( + translate(u'SongsPlugin.SongImportWizard', u'Filename:')) + self.CSVBrowseButton.setText( + translate(u'SongsPlugin.SongImportWizard', u'Browse...')) + self.ImportPage.setTitle( + translate(u'SongsPlugin.SongImportWizard', u'Importing')) + self.ImportPage.setSubTitle( + translate(u'SongsPlugin.SongImportWizard', + u'Please wait while your songs are imported.')) + self.ImportProgressLabel.setText( + translate(u'SongsPlugin.SongImportWizard', u'Ready.')) + self.ImportProgressBar.setFormat( + translate(u'SongsPlugin.SongImportWizard', u'%p%')) diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index a8751b132..bb20dd6e0 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -208,16 +208,29 @@ class Ui_SongMaintenanceDialog(object): QtCore.QMetaObject.connectSlotsByName(SongMaintenanceDialog) def retranslateUi(self, SongMaintenanceDialog): - SongMaintenanceDialog.setWindowTitle(translate('SongMaintenanceForm', 'Song Maintenance')) - self.TypeListWidget.item(0).setText(translate('SongMaintenanceForm', 'Authors')) - self.TypeListWidget.item(1).setText(translate('SongMaintenanceForm', 'Topics')) - self.TypeListWidget.item(2).setText(translate('SongMaintenanceForm', 'Books/Hymnals')) - self.AuthorAddButton.setText(translate('SongMaintenanceForm', 'Add')) - self.AuthorEditButton.setText(translate('SongMaintenanceForm', 'Edit')) - self.AuthorDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) - self.TopicAddButton.setText(translate('SongMaintenanceForm', 'Add')) - self.TopicEditButton.setText(translate('SongMaintenanceForm', 'Edit')) - self.TopicDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) - self.BookAddButton.setText(translate('SongMaintenanceForm', 'Add')) - self.BookEditButton.setText(translate('SongMaintenanceForm', 'Edit')) - self.BookDeleteButton.setText(translate('SongMaintenanceForm', 'Delete')) + SongMaintenanceDialog.setWindowTitle( + translate(u'SongsPlugin.SongMaintenanceForm', u'Song Maintenance')) + self.TypeListWidget.item(0).setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Authors')) + self.TypeListWidget.item(1).setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Topics')) + self.TypeListWidget.item(2).setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Books/Hymnals')) + self.AuthorAddButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Add')) + self.AuthorEditButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Edit')) + self.AuthorDeleteButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Delete')) + self.TopicAddButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Add')) + self.TopicEditButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Edit')) + self.TopicDeleteButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Delete')) + self.BookAddButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Add')) + self.BookEditButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Edit')) + self.BookDeleteButton.setText( + translate(u'SongsPlugin.SongMaintenanceForm', u'Delete')) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 219c2e213..33d158e6e 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -140,8 +140,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetAuthors() else: QtGui.QMessageBox.critical( - self, translate('SongMaintenanceForm','Error'), - translate('SongMaintenanceForm','Couldn\'t add your author.')) + self, translate(u'SongsPlugin.SongMaintenanceForm', + u'Error'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Couldn\'t add your author.')) def onTopicAddButtonClick(self): if self.topicform.exec_(): @@ -151,8 +153,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetTopics() else: QtGui.QMessageBox.critical( - self, translate('SongMaintenanceForm','Error'), - translate('SongMaintenanceForm','Couldn\'t add your topic.')) + self, translate(u'SongsPlugin.SongMaintenanceForm', + u'Error'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Couldn\'t add your topic.')) def onBookAddButtonClick(self): if self.bookform.exec_(): @@ -163,8 +167,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetBooks() else: QtGui.QMessageBox.critical( - self, translate('SongMaintenanceForm','Error'), - translate('SongMaintenanceForm','Couldn\'t add your book.')) + self, translate(u'SongsPlugin.SongMaintenanceForm', + u'Error'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Couldn\'t add your book.')) def onAuthorEditButtonClick(self): author_id = self._getCurrentItemId(self.AuthorsListWidget) @@ -185,8 +191,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetAuthors() else: QtGui.QMessageBox.critical( - self, translate('SongMaintenanceForm','Error'), - translate('SongMaintenanceForm','Couldn\'t save your author.')) + self, translate(u'SongsPlugin.SongMaintenanceForm', + u'Error'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Couldn\'t save your author.')) def onTopicEditButtonClick(self): topic_id = self._getCurrentItemId(self.TopicsListWidget) @@ -199,8 +207,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetTopics() else: QtGui.QMessageBox.critical( - self, translate('SongMaintenanceForm','Error'), - translate('SongMaintenanceForm','Couldn\'t save your topic.')) + self, translate(u'SongsPlugin.SongMaintenanceForm', + u'Error'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Couldn\'t save your topic.')) def onBookEditButtonClick(self): book_id = self._getCurrentItemId(self.BooksListWidget) @@ -216,8 +226,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self.resetBooks() else: QtGui.QMessageBox.critical( - self, translate('SongMaintenanceForm','Error'), - translate('SongMaintenanceForm','Couldn\'t save your book.')) + self, translate(u'SongsPlugin.SongMaintenanceForm', + u'Error'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Couldn\'t save your book.')) def onAuthorDeleteButtonClick(self): """ @@ -226,11 +238,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self._deleteItem( self.AuthorsListWidget, self.songmanager.get_author, self.songmanager.delete_author, self.resetAuthors, - translate('SongMaintenanceForm','Delete Author'), - translate('SongMaintenanceForm','Are you sure you want to delete the selected author?'), - translate('SongMaintenanceForm','This author can\'t be deleted, they are currently ' - 'assigned to at least one song.'), - translate('SongMaintenanceForm','No author selected!')) + translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Author'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Are you sure you want to delete the selected author?'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'This author can\'t be deleted, they are currently ' + u'assigned to at least one song.'), + translate(u'SongsPlugin.SongMaintenanceForm', u'No author selected!')) def onTopicDeleteButtonClick(self): """ @@ -239,11 +253,13 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self._deleteItem( self.TopicsListWidget, self.songmanager.get_topic, self.songmanager.delete_topic, self.resetTopics, - translate('SongMaintenanceForm','Delete Topic'), - translate('SongMaintenanceForm','Are you sure you want to delete the selected topic?'), - translate('SongMaintenanceForm','This topic can\'t be deleted, it is currently ' - 'assigned to at least one song.'), - translate('SongMaintenanceForm','No topic selected!')) + translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Topic'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Are you sure you want to delete the selected topic?'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'This topic can\'t be deleted, it is currently ' + u'assigned to at least one song.'), + translate(u'SongsPlugin.SongMaintenanceForm', u'No topic selected!')) def onBookDeleteButtonClick(self): """ @@ -252,8 +268,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): self._deleteItem( self.BooksListWidget, self.songmanager.get_book, self.songmanager.delete_book, self.resetBooks, - translate('SongMaintenanceForm','Delete Book'), - translate('SongMaintenanceForm','Are you sure you want to delete the selected book?'), - translate('SongMaintenanceForm','This book can\'t be deleted, it is currently ' - 'assigned to at least one song.'), - translate('SongMaintenanceForm','No book selected!')) + translate(u'SongsPlugin.SongMaintenanceForm', u'Delete Book'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'Are you sure you want to delete the selected book?'), + translate(u'SongsPlugin.SongMaintenanceForm', + u'This book can\'t be deleted, it is currently ' + u'assigned to at least one song.'), + translate(u'SongsPlugin.SongMaintenanceForm', u'No book selected!')) diff --git a/openlp/plugins/songs/forms/topicsdialog.py b/openlp/plugins/songs/forms/topicsdialog.py index a78d905f4..3ed9da3c3 100644 --- a/openlp/plugins/songs/forms/topicsdialog.py +++ b/openlp/plugins/songs/forms/topicsdialog.py @@ -60,5 +60,7 @@ class Ui_TopicsDialog(object): QtCore.QMetaObject.connectSlotsByName(TopicsDialog) def retranslateUi(self, TopicsDialog): - TopicsDialog.setWindowTitle(translate('TopicsForm', 'Topic Maintenance')) - self.NameLabel.setText(translate('TopicsForm', 'Topic name:')) + TopicsDialog.setWindowTitle( + translate(u'SongsPlugin.TopicsForm', u'Topic Maintenance')) + self.NameLabel.setText( + translate(u'SongsPlugin.TopicsForm', u'Topic name:')) diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index 1784fae16..fa9eeb7c0 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -49,8 +49,9 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): def accept(self): if not self.NameEdit.text(): QtGui.QMessageBox.critical( - self, translate('TopicsForm','Error'), - translate('TopicsForm','You need to type in a topic name!'), + self, translate(u'SongsPlugin.TopicsForm', u'Error'), + translate(u'SongsPlugin.TopicsForm', + u'You need to type in a topic name!'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.NameEdit.setFocus() return False diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 1d1a96623..240b5ea93 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -60,7 +60,7 @@ class SongMediaItem(MediaManagerItem): self.remoteSong = -1 def initPluginNameVisible(self): - self.PluginNameVisible = translate('mediaItem','Song') + self.PluginNameVisible = translate(u'SongsPlugin.MediaItem', u'Song') def requiredIcons(self): MediaManagerItem.requiredIcons(self) @@ -69,8 +69,10 @@ class SongMediaItem(MediaManagerItem): def addEndHeaderBar(self): self.addToolbarSeparator() ## Song Maintenance Button ## - self.addToolbarButton(translate('mediaItem','Song Maintenance'), - translate('mediaItem','Maintain the lists of authors, topics and books'), + self.addToolbarButton( + translate(u'SongsPlugin.MediaItem', u'Song Maintenance'), + translate(u'SongsPlugin.MediaItem', + u'Maintain the lists of authors, topics and books'), ':/songs/song_maintenance.png', self.onSongMaintenanceClick) self.PageLayout.setSpacing(4) self.SearchLayout = QtGui.QFormLayout() @@ -139,15 +141,22 @@ class SongMediaItem(MediaManagerItem): QtCore.QVariant(u'False')).toBool() def retranslateUi(self): - self.SearchTextLabel.setText(translate('mediaItem','Search:')) - self.SearchTypeLabel.setText(translate('mediaItem','Type:')) - self.ClearTextButton.setText(translate('mediaItem','Clear')) - self.SearchTextButton.setText(translate('mediaItem','Search')) + self.SearchTextLabel.setText( + translate(u'SongsPlugin.MediaItem', u'Search:')) + self.SearchTypeLabel.setText( + translate(u'SongsPlugin.MediaItem', u'Type:')) + self.ClearTextButton.setText( + translate(u'SongsPlugin.MediaItem', u'Clear')) + self.SearchTextButton.setText( + translate(u'SongsPlugin.MediaItem', u'Search')) def initialise(self): - self.SearchTypeComboBox.addItem(translate('mediaItem','Titles')) - self.SearchTypeComboBox.addItem(translate('mediaItem','Lyrics')) - self.SearchTypeComboBox.addItem(translate('mediaItem','Authors')) + self.SearchTypeComboBox.addItem( + translate(u'SongsPlugin.MediaItem', u'Titles')) + self.SearchTypeComboBox.addItem( + translate(u'SongsPlugin.MediaItem', u'Lyrics')) + self.SearchTypeComboBox.addItem( + translate(u'SongsPlugin.MediaItem', u'Authors')) self.configUpdated() def onSearchTextButtonClick(self): @@ -203,7 +212,8 @@ class SongMediaItem(MediaManagerItem): self.ListView.clear() for author in searchresults: for song in author.songs: - song_detail = unicode(translate('mediaItem','%s (%s)' % \ + song_detail = unicode( + translate(u'SongsPlugin.MediaItem', u'%s (%s)' % \ (unicode(author.display_name), unicode(song.title)))) song_name = QtGui.QListWidgetItem(song_detail) song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id)) @@ -281,12 +291,15 @@ class SongMediaItem(MediaManagerItem): items = self.ListView.selectedIndexes() if items: if len(items) == 1: - del_message = translate('mediaItem','Delete song?') + del_message = translate(u'SongsPlugin.MediaItem', + u'Delete song?') else: del_message = unicode( - translate('mediaItem','Delete %d songs?')) % len(items) + translate(u'SongsPlugin.MediaItem', + u'Delete %d songs?')) % len(items) ans = QtGui.QMessageBox.question(self, - translate('mediaItem','Delete Confirmation'), del_message, + translate(u'SongsPlugin.MediaItem', u'Delete Confirmation'), + del_message, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok| QtGui.QMessageBox.Cancel), QtGui.QMessageBox.Ok) @@ -367,7 +380,7 @@ class SongMediaItem(MediaManagerItem): raw_footer.append(author_list) raw_footer.append(song.copyright ) raw_footer.append(unicode( - translate('mediaItem','CCLI Licence: ') + ccli)) + translate(u'SongsPlugin.MediaItem', u'CCLI Licence: ') + ccli)) service_item.raw_footer = raw_footer service_item.audit = [ song.title, author_audit, song.copyright, song.ccli_number diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 08f39954e..b697f508c 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -63,9 +63,9 @@ class SongImport(object): self.versecount = 0 self.choruscount = 0 self.copyright_string = unicode(QtGui.QApplication.translate( \ - u'SongImport', u'copyright')) + u'SongsPlugin.SongImport', u'copyright')) self.copyright_symbol = unicode(QtGui.QApplication.translate( \ - u'SongImport', u'©')) + u'SongsPlugin.SongImport', u'©')) @staticmethod def process_songs_text(manager, text): diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 327105554..f4dab9d20 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -36,7 +36,7 @@ class SongsTab(SettingsTab): def setupUi(self): self.setObjectName(u'SongsTab') - self.tabTitleVisible = translate('SongsTab','Songs') + self.tabTitleVisible = translate(u'SongsPlugin.SongsTab', u'Songs') self.SongsLayout = QtGui.QFormLayout(self) self.SongsLayout.setObjectName(u'SongsLayout') self.SongsModeGroupBox = QtGui.QGroupBox(self) @@ -61,11 +61,12 @@ class SongsTab(SettingsTab): self.SongBarActiveCheckBoxChanged) def retranslateUi(self): - self.SongsModeGroupBox.setTitle(translate('SongsTab','Songs Mode')) + self.SongsModeGroupBox.setTitle( + translate(u'SongsPlugin.SongsTab', u'Songs Mode')) self.SearchAsTypeCheckBox.setText( - translate('SongsTab','Enable search as you type')) + translate(u'SongsPlugin.SongsTab', u'Enable search as you type')) self.SongBarActiveCheckBox.setText( - translate('SongsTab','Display Verses on Live Tool bar')) + translate(u'SongsPlugin.SongsTab', u'Display Verses on Live Tool bar')) def onSearchAsTypeCheckBoxChanged(self, check_state): self.song_search = False diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 06f3b5656..f13cf80ec 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -150,7 +150,8 @@ class SongsPlugin(Plugin): def onImportSofItemClick(self): filenames = QtGui.QFileDialog.getOpenFileNames( - None, translate('Songsplugin','Open Songs of Fellowship file'), + None, translate(u'SongsPlugin.Songsplugin', + u'Open Songs of Fellowship file'), u'', u'Songs of Fellowship file (*.rtf *.RTF)') try: for filename in filenames: @@ -170,15 +171,17 @@ class SongsPlugin(Plugin): def onImportOooItemClick(self): filenames = QtGui.QFileDialog.getOpenFileNames( - None, translate('Songsplugin','Open documents or presentations'), + None, translate(u'SongsPlugin.Songsplugin', + u'Open documents or presentations'), u'', u'All Files(*.*)') oooimport = OooImport(self.manager) oooimport.import_docs(filenames) Receiver.send_message(u'songs_load_list') def about(self): - about_text = translate('Songsplugin','Song Plugin
' - 'This plugin allows songs to be managed and displayed.') + about_text = translate(u'SongsPlugin.Songsplugin', + u'Song Plugin
' + u'This plugin allows songs to be managed and displayed.') return about_text def can_delete_theme(self, theme): diff --git a/openlp/plugins/songusage/forms/songusagedeletedialog.py b/openlp/plugins/songusage/forms/songusagedeletedialog.py index 02b7496b2..fc44a1c18 100644 --- a/openlp/plugins/songusage/forms/songusagedeletedialog.py +++ b/openlp/plugins/songusage/forms/songusagedeletedialog.py @@ -58,4 +58,5 @@ class Ui_SongUsageDeleteDialog(object): QtCore.QMetaObject.connectSlotsByName(SongUsageDeleteDialog) def retranslateUi(self, SongUsageDeleteDialog): - SongUsageDeleteDialog.setWindowTitle(translate('AuditDeleteDialog', 'Song Usage Delete')) + SongUsageDeleteDialog.setWindowTitle( + translate(u'SongsPlugin.AuditDeleteDialog', u'Song Usage Delete')) diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index a494dd49f..92aad690b 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -42,8 +42,10 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog): def accept(self): ret = QtGui.QMessageBox.question(self, - translate('SongUsageDeleteForm','Delete Selected Song Usage Events?'), - translate('SongUsageDeleteForm','Are you sure you want to delete selected Song Usage data?'), + translate(u'SongsPlugin.SongUsageDeleteForm', + u'Delete Selected Song Usage Events?'), + translate(u'SongsPlugin.SongUsageDeleteForm', + u'Are you sure you want to delete selected Song Usage data?'), QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel), diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index 9e25651ab..7b69e21fa 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -87,7 +87,12 @@ class Ui_SongUsageDetailDialog(object): QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog) def retranslateUi(self, SongUsageDetailDialog): - SongUsageDetailDialog.setWindowTitle(translate('AuditDetailDialog', 'Song Usage Extraction')) - self.DateRangeGroupBox.setTitle(translate('AuditDetailDialog', 'Select Date Range')) - self.ToLabel.setText(translate('AuditDetailDialog', 'to')) - self.FileGroupBox.setTitle(translate('AuditDetailDialog', 'Report Location')) + SongUsageDetailDialog.setWindowTitle( + translate(u'SongsPlugin.AuditDetailDialog', + u'Song Usage Extraction')) + self.DateRangeGroupBox.setTitle( + translate(u'SongsPlugin.AuditDetailDialog', u'Select Date Range')) + self.ToLabel.setText( + translate(u'SongsPlugin.AuditDetailDialog', u'to')) + self.FileGroupBox.setTitle( + translate(u'SongsPlugin.AuditDetailDialog', u'Report Location')) diff --git a/openlp/plugins/songusage/forms/songusagedetailform.py b/openlp/plugins/songusage/forms/songusagedetailform.py index 7a39480b6..2a4dfb39e 100644 --- a/openlp/plugins/songusage/forms/songusagedetailform.py +++ b/openlp/plugins/songusage/forms/songusagedetailform.py @@ -61,7 +61,8 @@ class SongUsageDetailForm(QtGui.QDialog, Ui_SongUsageDetailDialog): def defineOutputLocation(self): path = QtGui.QFileDialog.getExistingDirectory(self, - translate('SongUsageDetailForm','Output File Location'), + translate(u'SongsPlugin.SongUsageDetailForm', + u'Output File Location'), SettingsManager.get_last_dir(self.parent.settingsSection, 1)) path = unicode(path) if path != u'': diff --git a/openlp/plugins/songusage/songusageplugin.py b/openlp/plugins/songusage/songusageplugin.py index c05562428..6cbb08e1a 100644 --- a/openlp/plugins/songusage/songusageplugin.py +++ b/openlp/plugins/songusage/songusageplugin.py @@ -156,7 +156,8 @@ class SongUsagePlugin(Plugin): self.SongUsagedetailform.exec_() def about(self): - about_text = translate('SongUsagePlugin','SongUsage Plugin
This plugin ' - 'records the use of songs and when they have been used during ' - 'a live service') + about_text = translate(u'SongsPlugin.SongUsagePlugin', + u'SongUsage Plugin
This plugin ' + u'records the use of songs and when they have been used during ' + u'a live service') return about_text From d364bcbc2ad24942529505e5b1799c47eac204be Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 16:26:08 +0200 Subject: [PATCH 12/17] fixed translate() 'u symbol in Aboutform --- openlp/core/ui/aboutdialog.py | 860 +++++++++++++++++----------------- 1 file changed, 430 insertions(+), 430 deletions(-) diff --git a/openlp/core/ui/aboutdialog.py b/openlp/core/ui/aboutdialog.py index f31b214b6..a4bc72cca 100644 --- a/openlp/core/ui/aboutdialog.py +++ b/openlp/core/ui/aboutdialog.py @@ -115,447 +115,447 @@ class Ui_AboutDialog(object): def retranslateUi(self, AboutDialog): AboutDialog.setWindowTitle(translate(u'AboutForm', u'About OpenLP')) - self.AboutTextEdit.setPlainText(translate(u'AboutForm', u - 'OpenLP - Open Source Lyrics ' - 'Projection\n' - '\n' - 'OpenLP is free church presentation software, or lyrics ' - 'projection software, used to display slides of songs, Bible ' - 'verses, videos, images, and even presentations (if ' - 'OpenOffice.org, PowerPoint or PowerPoint Viewer is installed) ' - 'for church worship using a computer and a data projector.\n' - '\n' - 'Find out more about OpenLP: http://openlp.org/\n' - '\n' - 'OpenLP is written and maintained by volunteers. If you would ' - 'like to see more free Christian software being written, please ' - 'consider contributing by using the button below.' + self.AboutTextEdit.setPlainText(translate(u'AboutForm', + u'OpenLP - Open Source Lyrics ' + u'Projection\n' + u'\n' + u'OpenLP is free church presentation software, or lyrics ' + u'projection software, used to display slides of songs, Bible ' + u'verses, videos, images, and even presentations (if ' + u'OpenOffice.org, PowerPoint or PowerPoint Viewer is installed) ' + u'for church worship using a computer and a data projector.\n' + u'\n' + u'Find out more about OpenLP: http://openlp.org/\n' + u'\n' + u'OpenLP is written and maintained by volunteers. If you would ' + u'like to see more free Christian software being written, please ' + u'consider contributing by using the button below.' )) self.AboutNotebook.setTabText( self.AboutNotebook.indexOf(self.AboutTab), translate(u'AboutForm', u'About')) self.CreditsTextEdit.setPlainText(translate(u'AboutForm', u'Project Lead\n' - ' Raoul "superfly" Snyman\n' - '\n' - 'Developers\n' - ' Tim "TRB143" Bentley\n' - ' Jonathan "gushie" Corwin\n' - ' Michael "cocooncrash" Gorven\n' - ' Scott "sguerrieri" Guerrieri\n' - ' Raoul "superfly" Snyman\n' - ' Martin "mijiti" Thompson\n' - ' Jon "Meths" Tibble\n' - '\n' - 'Contributors\n' - ' Meinert "m2j" Jordan\n' - ' Christian "crichter" Richter\n' - ' Maikel Stuivenberg\n' - ' Carsten "catini" Tingaard\n' - '\n' - 'Testers\n' - ' Philip "Phill" Ridout\n' - ' Wesley "wrst" Stout (lead)\n' - '\n' - 'Packagers\n' - ' Thomas "tabthorpe" Abthorpe (FreeBSD)\n' - ' Tim "TRB143" Bentley (Fedora)\n' - ' Michael "cocooncrash" Gorven (Ubuntu)\n' - ' Matthias "matthub" Hub (Mac OS X)\n' - ' Raoul "superfly" Snyman (Windows)\n' + u' Raoul "superfly" Snyman\n' + u'\n' + u'Developers\n' + u' Tim "TRB143" Bentley\n' + u' Jonathan "gushie" Corwin\n' + u' Michael "cocooncrash" Gorven\n' + u' Scott "sguerrieri" Guerrieri\n' + u' Raoul "superfly" Snyman\n' + u' Martin "mijiti" Thompson\n' + u' Jon "Meths" Tibble\n' + u'\n' + u'Contributors\n' + u' Meinert "m2j" Jordan\n' + u' Christian "crichter" Richter\n' + u' Maikel Stuivenberg\n' + u' Carsten "catini" Tingaard\n' + u'\n' + u'Testers\n' + u' Philip "Phill" Ridout\n' + u' Wesley "wrst" Stout (lead)\n' + u'\n' + u'Packagers\n' + u' Thomas "tabthorpe" Abthorpe (FreeBSD)\n' + u' Tim "TRB143" Bentley (Fedora)\n' + u' Michael "cocooncrash" Gorven (Ubuntu)\n' + u' Matthias "matthub" Hub (Mac OS X)\n' + u' Raoul "superfly" Snyman (Windows)\n' )) self.AboutNotebook.setTabText( self.AboutNotebook.indexOf(self.CreditsTab), translate(u'AboutForm', u'Credits')) self.LicenseTextEdit.setPlainText(translate(u'AboutForm', - 'Copyright \xa9 2004-2010 Raoul Snyman\n' - 'Portions copyright \xa9 2004-2010 ' - 'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, ' - 'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon ' - 'Tibble, Carsten Tinggaard\n' - '\n' - 'This program is free software; you can redistribute it and/or ' - 'modify it under the terms of the GNU General Public License as ' - 'published by the Free Software Foundation; version 2 of the ' - 'License.\n' - '\n' - 'This program is distributed in the hope that it will be useful, ' - 'but WITHOUT ANY WARRANTY; without even the implied warranty of ' - 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See below ' - 'for more details.\n' - '\n' - '\n' - 'GNU GENERAL PUBLIC LICENSE\n' - 'Version 2, June 1991\n' - '\n' - 'Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 ' - 'Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ' - 'Everyone is permitted to copy and distribute verbatim copies of ' - 'this license document, but changing it is not allowed.\n' - '\n' - 'Preamble\n' - '\n' - 'The licenses for most software are designed to take away your ' - 'freedom to share and change it. By contrast, the GNU General ' - 'Public License is intended to guarantee your freedom to share ' - 'and change free software--to make sure the software is free for ' - 'all its users. This General Public License applies to most of ' - 'the Free Software Foundation\'s software and to any other ' - 'program whose authors commit to using it. (Some other Free ' - 'Software Foundation software is covered by the GNU Lesser ' - 'General Public License instead.) You can apply it to your ' - 'programs, too.\n' - '\n' - 'When we speak of free software, we are referring to freedom, not ' - 'price. Our General Public Licenses are designed to make sure ' - 'that you have the freedom to distribute copies of free software ' - '(and charge for this service if you wish), that you receive ' - 'source code or can get it if you want it, that you can change ' - 'the software or use pieces of it in new free programs; and that ' - 'you know you can do these things.\n' - '\n' - 'To protect your rights, we need to make restrictions that forbid ' - 'anyone to deny you these rights or to ask you to surrender the ' - 'rights. These restrictions translate to certain responsibilities ' - 'for you if you distribute copies of the software, or if you ' - 'modify it.\n' - '\n' - 'For example, if you distribute copies of such a program, whether ' - 'gratis or for a fee, you must give the recipients all the rights ' - 'that you have. You must make sure that they, too, receive or ' - 'can get the source code. And you must show them these terms so ' - 'they know their rights.\n' - '\n' - 'We protect your rights with two steps: (1) copyright the ' - 'software, and (2) offer you this license which gives you legal ' - 'permission to copy, distribute and/or modify the software.\n' - '\n' - 'Also, for each author\'s protection and ours, we want to make ' - 'certain that everyone understands that there is no warranty for ' - 'this free software. If the software is modified by someone else ' - 'and passed on, we want its recipients to know that what they ' - 'have is not the original, so that any problems introduced by ' - 'others will not reflect on the original authors\' reputations.\n' - '\n' - 'Finally, any free program is threatened constantly by software ' - 'patents. We wish to avoid the danger that redistributors of a ' - 'free program will individually obtain patent licenses, in effect ' - 'making the program proprietary. To prevent this, we have made ' - 'it clear that any patent must be licensed for everyone\'s free ' - 'use or not licensed at all.\n' - '\n' - 'The precise terms and conditions for copying, distribution and ' - 'modification follow.\n' - '\n' - 'GNU GENERAL PUBLIC LICENSE\n' - 'TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n' - '\n' - '0. This License applies to any program or other work which ' - 'contains a notice placed by the copyright holder saying it may ' - 'be distributed under the terms of this General Public License. ' - 'The "Program", below, refers to any such program or work, and a ' - '"work based on the Program" means either the Program or any ' - 'derivative work under copyright law: that is to say, a work ' - 'containing the Program or a portion of it, either verbatim or ' - 'with modifications and/or translated into another language. ' - '(Hereinafter, translation is included without limitation in the ' - 'term "modification".) Each licensee is addressed as "you".\n' - '\n' - 'Activities other than copying, distribution and modification are ' - 'not covered by this License; they are outside its scope. The ' - 'act of running the Program is not restricted, and the output ' - 'from the Program is covered only if its contents constitute a ' - 'work based on the Program (independent of having been made by ' - 'running the Program). Whether that is true depends on what the ' - 'Program does.\n' - '\n' - '1. You may copy and distribute verbatim copies of the Program\'s ' - 'source code as you receive it, in any medium, provided that you ' - 'conspicuously and appropriately publish on each copy an ' - 'appropriate copyright notice and disclaimer of warranty; keep ' - 'intact all the notices that refer to this License and to the ' - 'absence of any warranty; and give any other recipients of the ' - 'Program a copy of this License along with the Program.\n' - '\n' - 'You may charge a fee for the physical act of transferring a ' - 'copy, and you may at your option offer warranty protection in ' - 'exchange for a fee.\n' - '\n' - '2. You may modify your copy or copies of the Program or any ' - 'portion of it, thus forming a work based on the Program, and ' - 'copy and distribute such modifications or work under the terms ' - 'of Section 1 above, provided that you also meet all of these ' - 'conditions:\n' - '\n' - 'a) You must cause the modified files to carry prominent notices ' - 'stating that you changed the files and the date of any change.\n' - '\n' - 'b) You must cause any work that you distribute or publish, that ' - 'in whole or in part contains or is derived from the Program or ' - 'any part thereof, to be licensed as a whole at no charge to all ' - 'third parties under the terms of this License.\n' - '\n' - 'c) If the modified program normally reads commands interactively ' - 'when run, you must cause it, when started running for such ' - 'interactive use in the most ordinary way, to print or display an ' - 'announcement including an appropriate copyright notice and a ' - 'notice that there is no warranty (or else, saying that you ' - 'provide a warranty) and that users may redistribute the program ' - 'under these conditions, and telling the user how to view a copy ' - 'of this License. (Exception: if the Program itself is ' - 'interactive but does not normally print such an announcement, ' - 'your work based on the Program is not required to print an ' - 'announcement.)\n' - '\n' - 'These requirements apply to the modified work as a whole. If ' - 'identifiable sections of that work are not derived from the ' - 'Program, and can be reasonably considered independent and ' - 'separate works in themselves, then this License, and its terms, ' - 'do not apply to those sections when you distribute them as ' - 'separate works. But when you distribute the same sections as ' - 'part of a whole which is a work based on the Program, the ' - 'distribution of the whole must be on the terms of this License, ' - 'whose permissions for other licensees extend to the entire ' - 'whole, and thus to each and every part regardless of who wrote ' - 'it.\n' - '\n' - 'Thus, it is not the intent of this section to claim rights or ' - 'contest your rights to work written entirely by you; rather, the ' - 'intent is to exercise the right to control the distribution of ' - 'derivative or collective works based on the Program.\n' - '\n' - 'In addition, mere aggregation of another work not based on the ' - 'Program with the Program (or with a work based on the Program) ' - 'on a volume of a storage or distribution medium does not bring ' - 'the other work under the scope of this License.\n' - '\n' - '3. You may copy and distribute the Program (or a work based on ' - 'it, under Section 2) in object code or executable form under the ' - 'terms of Sections 1 and 2 above provided that you also do one of ' - 'the following:\n' - '\n' - 'a) Accompany it with the complete corresponding machine-readable ' - 'source code, which must be distributed under the terms of ' - 'Sections 1 and 2 above on a medium customarily used for software ' - 'interchange; or,\n' - '\n' - 'b) Accompany it with a written offer, valid for at least three ' - 'years, to give any third party, for a charge no more than your ' - 'cost of physically performing source distribution, a complete ' - 'machine-readable copy of the corresponding source code, to be ' - 'distributed under the terms of Sections 1 and 2 above on a ' - 'medium customarily used for software interchange; or,\n' - '\n' - 'c) Accompany it with the information you received as to the ' - 'offer to distribute corresponding source code. (This ' - 'alternative is allowed only for noncommercial distribution and ' - 'only if you received the program in object code or executable ' - 'form with such an offer, in accord with Subsection b above.)\n' - '\n' - 'The source code for a work means the preferred form of the work ' - 'for making modifications to it. For an executable work, ' - 'complete source code means all the source code for all modules ' - 'it contains, plus any associated interface definition files, ' - 'plus the scripts used to control compilation and installation of ' - 'the executable. However, as a special exception, the source ' - 'code distributed need not include anything that is normally ' - 'distributed (in either source or binary form) with the major ' - 'components (compiler, kernel, and so on) of the operating system ' - 'on which the executable runs, unless that component itself ' - 'accompanies the executable.\n' - '\n' - 'If distribution of executable or object code is made by offering ' - 'access to copy from a designated place, then offering equivalent ' - 'access to copy the source code from the same place counts as ' - 'distribution of the source code, even though third parties are ' - 'not compelled to copy the source along with the object code.\n' - '\n' - '4. You may not copy, modify, sublicense, or distribute the ' - 'Program except as expressly provided under this License. Any ' - 'attempt otherwise to copy, modify, sublicense or distribute the ' - 'Program is void, and will automatically terminate your rights ' - 'under this License. However, parties who have received copies, ' - 'or rights, from you under this License will not have their ' - 'licenses terminated so long as such parties remain in full ' - 'compliance.\n' - '\n' - '5. You are not required to accept this License, since you have ' - 'not signed it. However, nothing else grants you permission to ' - 'modify or distribute the Program or its derivative works. These ' - 'actions are prohibited by law if you do not accept this ' - 'License. Therefore, by modifying or distributing the Program ' - '(or any work based on the Program), you indicate your acceptance ' - 'of this License to do so, and all its terms and conditions for ' - 'copying, distributing or modifying the Program or works based on ' - 'it.\n' - '\n' - '6. Each time you redistribute the Program (or any work based on ' - 'the Program), the recipient automatically receives a license ' - 'from the original licensor to copy, distribute or modify the ' - 'Program subject to these terms and conditions. You may not ' - 'impose any further restrictions on the recipients\' exercise of ' - 'the rights granted herein. You are not responsible for enforcing ' - 'compliance by third parties to this License.\n' - '\n' - '7. If, as a consequence of a court judgment or allegation of ' - 'patent infringement or for any other reason (not limited to ' - 'patent issues), conditions are imposed on you (whether by court ' - 'order, agreement or otherwise) that contradict the conditions of ' - 'this License, they do not excuse you from the conditions of this ' - 'License. If you cannot distribute so as to satisfy ' - 'simultaneously your obligations under this License and any other ' - 'pertinent obligations, then as a consequence you may not ' - 'distribute the Program at all. For example, if a patent license ' - 'would not permit royalty-free redistribution of the Program by ' - 'all those who receive copies directly or indirectly through you, ' - 'then the only way you could satisfy both it and this License ' - 'would be to refrain entirely from distribution of the Program.\n' - '\n' - 'If any portion of this section is held invalid or unenforceable ' - 'under any particular circumstance, the balance of the section is ' - 'intended to apply and the section as a whole is intended to ' - 'apply in other circumstances.\n' - '\n' - 'It is not the purpose of this section to induce you to infringe ' - 'any patents or other property right claims or to contest ' - 'validity of any such claims; this section has the sole purpose ' - 'of protecting the integrity of the free software distribution ' - 'system, which is implemented by public license practices. Many ' - 'people have made generous contributions to the wide range of ' - 'software distributed through that system in reliance on ' - 'consistent application of that system; it is up to the ' - 'author/donor to decide if he or she is willing to distribute ' - 'software through any other system and a licensee cannot impose ' - 'that choice.\n' - '\n' - 'This section is intended to make thoroughly clear what is ' - 'believed to be a consequence of the rest of this License.\n' - '\n' - '8. If the distribution and/or use of the Program is restricted ' - 'in certain countries either by patents or by copyrighted ' - 'interfaces, the original copyright holder who places the Program ' - 'under this License may add an explicit geographical distribution ' - 'limitation excluding those countries, so that distribution is ' - 'permitted only in or among countries not thus excluded. In such ' - 'case, this License incorporates the limitation as if written in ' - 'the body of this License.\n' - '\n' - '9. The Free Software Foundation may publish revised and/or new ' - 'versions of the General Public License from time to time. Such ' - 'new versions will be similar in spirit to the present version, ' - 'but may differ in detail to address new problems or concerns.\n' - '\n' - 'Each version is given a distinguishing version number. If the ' - 'Program specifies a version number of this License which applies ' - 'to it and \"any later version\', you have the option of ' - 'following the terms and conditions either of that version or of ' - 'any later version published by the Free Software Foundation. If ' - 'the Program does not specify a version number of this License, ' - 'you may choose any version ever published by the Free Software ' - 'Foundation.\n' - '\n' - '10. If you wish to incorporate parts of the Program into other ' - 'free programs whose distribution conditions are different, write ' - 'to the author to ask for permission. For software which is ' - 'copyrighted by the Free Software Foundation, write to the Free ' - 'Software Foundation; we sometimes make exceptions for this. Our ' - 'decision will be guided by the two goals of preserving the free ' - 'status of all derivatives of our free software and of promoting ' - 'the sharing and reuse of software generally.\n' - '\n' - 'NO WARRANTY\n' - '\n' - '11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO ' - 'WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE ' - 'LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT ' - 'HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT ' - 'WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, ' - 'BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ' - 'AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE ' - 'QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ' - 'PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY ' - 'SERVICING, REPAIR OR CORRECTION.\n' - '\n' - '12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO ' - 'IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY ' - 'MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE ' - 'LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, ' - 'INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR ' - 'INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS ' - 'OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ' - 'YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ' - 'ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ' - 'ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n' - '\n' - 'END OF TERMS AND CONDITIONS\n' - '\n' - 'How to Apply These Terms to Your New Programs\n' - '\n' - 'If you develop a new program, and you want it to be of the ' - 'greatest possible use to the public, the best way to achieve ' - 'this is to make it free software which everyone can redistribute ' - 'and change under these terms.\n' - '\n' - 'To do so, attach the following notices to the program. It is ' - 'safest to attach them to the start of each source file to most ' - 'effectively convey the exclusion of warranty; and each file ' - 'should have at least the "copyright" line and a pointer to where ' - 'the full notice is found.\n' - '\n' - '\n' - 'Copyright (C) \n' - '\n' - 'This program is free software; you can redistribute it and/or ' - 'modify it under the terms of the GNU General Public License as ' - 'published by the Free Software Foundation; either version 2 of ' - 'the License, or (at your option) any later version.\n' - '\n' - 'This program is distributed in the hope that it will be useful, ' - 'but WITHOUT ANY WARRANTY; without even the implied warranty of ' - 'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' - 'GNU General Public License for more details.\n' - '\n' - 'You should have received a copy of the GNU General Public ' - 'License along with this program; if not, write to the Free ' - 'Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ' - 'Boston, MA 02110-1301 USA.\n' - '\n' - 'Also add information on how to contact you by electronic and ' - 'paper mail.\n' - '\n' - 'If the program is interactive, make it output a short notice ' - 'like this when it starts in an interactive mode:\n' - '\n' - 'Gnomovision version 69, Copyright (C) year name of author\n' - 'Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type ' - '"show w".\n' - 'This is free software, and you are welcome to redistribute it ' - 'under certain conditions; type "show c" for details.\n' - '\n' - 'The hypothetical commands "show w" and "show c" should show ' - 'the appropriate parts of the General Public License. Of course, ' - 'the commands you use may be called something other than "show ' - 'w" and "show c"; they could even be mouse-clicks or menu items--' - 'whatever suits your program.\n' - '\n' - 'You should also get your employer (if you work as a programmer) ' - 'or your school, if any, to sign a "copyright disclaimer" for the ' - 'program, if necessary. Here is a sample; alter the names:\n' - '\n' - 'Yoyodyne, Inc., hereby disclaims all copyright interest in the ' - 'program "Gnomovision" (which makes passes at compilers) written ' - 'by James Hacker.\n' - '\n' - ', 1 April 1989\n' - 'Ty Coon, President of Vice\n' - '\n' - 'This General Public License does not permit incorporating your ' - 'program into proprietary programs. If your program is a ' - 'subroutine library, you may consider it more useful to permit ' - 'linking proprietary applications with the library. If this is ' - 'what you want to do, use the GNU Lesser General Public License ' - 'instead of this License.')) + u'Copyright \xa9 2004-2010 Raoul Snyman\n' + u'Portions copyright \xa9 2004-2010 ' + u'Tim Bentley, Jonathan Corwin, Michael Gorven, Scott Guerrieri, ' + u'Christian Richter, Maikel Stuivenberg, Martin Thompson, Jon ' + u'Tibble, Carsten Tinggaard\n' + u'\n' + u'This program is free software; you can redistribute it and/or ' + u'modify it under the terms of the GNU General Public License as ' + u'published by the Free Software Foundation; version 2 of the ' + u'License.\n' + u'\n' + u'This program is distributed in the hope that it will be useful, ' + u'but WITHOUT ANY WARRANTY; without even the implied warranty of ' + u'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See below ' + u'for more details.\n' + u'\n' + u'\n' + u'GNU GENERAL PUBLIC LICENSE\n' + u'Version 2, June 1991\n' + u'\n' + u'Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 ' + u'Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ' + u'Everyone is permitted to copy and distribute verbatim copies of ' + u'this license document, but changing it is not allowed.\n' + u'\n' + u'Preamble\n' + u'\n' + u'The licenses for most software are designed to take away your ' + u'freedom to share and change it. By contrast, the GNU General ' + u'Public License is intended to guarantee your freedom to share ' + u'and change free software--to make sure the software is free for ' + u'all its users. This General Public License applies to most of ' + u'the Free Software Foundation\'s software and to any other ' + u'program whose authors commit to using it. (Some other Free ' + u'Software Foundation software is covered by the GNU Lesser ' + u'General Public License instead.) You can apply it to your ' + u'programs, too.\n' + u'\n' + u'When we speak of free software, we are referring to freedom, not ' + u'price. Our General Public Licenses are designed to make sure ' + u'that you have the freedom to distribute copies of free software ' + u'(and charge for this service if you wish), that you receive ' + u'source code or can get it if you want it, that you can change ' + u'the software or use pieces of it in new free programs; and that ' + u'you know you can do these things.\n' + u'\n' + u'To protect your rights, we need to make restrictions that forbid ' + u'anyone to deny you these rights or to ask you to surrender the ' + u'rights. These restrictions translate to certain responsibilities ' + u'for you if you distribute copies of the software, or if you ' + u'modify it.\n' + u'\n' + u'For example, if you distribute copies of such a program, whether ' + u'gratis or for a fee, you must give the recipients all the rights ' + u'that you have. You must make sure that they, too, receive or ' + u'can get the source code. And you must show them these terms so ' + u'they know their rights.\n' + u'\n' + u'We protect your rights with two steps: (1) copyright the ' + u'software, and (2) offer you this license which gives you legal ' + u'permission to copy, distribute and/or modify the software.\n' + u'\n' + u'Also, for each author\'s protection and ours, we want to make ' + u'certain that everyone understands that there is no warranty for ' + u'this free software. If the software is modified by someone else ' + u'and passed on, we want its recipients to know that what they ' + u'have is not the original, so that any problems introduced by ' + u'others will not reflect on the original authors\' reputations.\n' + u'\n' + u'Finally, any free program is threatened constantly by software ' + u'patents. We wish to avoid the danger that redistributors of a ' + u'free program will individually obtain patent licenses, in effect ' + u'making the program proprietary. To prevent this, we have made ' + u'it clear that any patent must be licensed for everyone\'s free ' + u'use or not licensed at all.\n' + u'\n' + u'The precise terms and conditions for copying, distribution and ' + u'modification follow.\n' + u'\n' + u'GNU GENERAL PUBLIC LICENSE\n' + u'TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\n' + u'\n' + u'0. This License applies to any program or other work which ' + u'contains a notice placed by the copyright holder saying it may ' + u'be distributed under the terms of this General Public License. ' + u'The "Program", below, refers to any such program or work, and a ' + u'"work based on the Program" means either the Program or any ' + u'derivative work under copyright law: that is to say, a work ' + u'containing the Program or a portion of it, either verbatim or ' + u'with modifications and/or translated into another language. ' + u'(Hereinafter, translation is included without limitation in the ' + u'term "modification".) Each licensee is addressed as "you".\n' + u'\n' + u'Activities other than copying, distribution and modification are ' + u'not covered by this License; they are outside its scope. The ' + u'act of running the Program is not restricted, and the output ' + u'from the Program is covered only if its contents constitute a ' + u'work based on the Program (independent of having been made by ' + u'running the Program). Whether that is true depends on what the ' + u'Program does.\n' + u'\n' + u'1. You may copy and distribute verbatim copies of the Program\'s ' + u'source code as you receive it, in any medium, provided that you ' + u'conspicuously and appropriately publish on each copy an ' + u'appropriate copyright notice and disclaimer of warranty; keep ' + u'intact all the notices that refer to this License and to the ' + u'absence of any warranty; and give any other recipients of the ' + u'Program a copy of this License along with the Program.\n' + u'\n' + u'You may charge a fee for the physical act of transferring a ' + u'copy, and you may at your option offer warranty protection in ' + u'exchange for a fee.\n' + u'\n' + u'2. You may modify your copy or copies of the Program or any ' + u'portion of it, thus forming a work based on the Program, and ' + u'copy and distribute such modifications or work under the terms ' + u'of Section 1 above, provided that you also meet all of these ' + u'conditions:\n' + u'\n' + u'a) You must cause the modified files to carry prominent notices ' + u'stating that you changed the files and the date of any change.\n' + u'\n' + u'b) You must cause any work that you distribute or publish, that ' + u'in whole or in part contains or is derived from the Program or ' + u'any part thereof, to be licensed as a whole at no charge to all ' + u'third parties under the terms of this License.\n' + u'\n' + u'c) If the modified program normally reads commands interactively ' + u'when run, you must cause it, when started running for such ' + u'interactive use in the most ordinary way, to print or display an ' + u'announcement including an appropriate copyright notice and a ' + u'notice that there is no warranty (or else, saying that you ' + u'provide a warranty) and that users may redistribute the program ' + u'under these conditions, and telling the user how to view a copy ' + u'of this License. (Exception: if the Program itself is ' + u'interactive but does not normally print such an announcement, ' + u'your work based on the Program is not required to print an ' + u'announcement.)\n' + u'\n' + u'These requirements apply to the modified work as a whole. If ' + u'identifiable sections of that work are not derived from the ' + u'Program, and can be reasonably considered independent and ' + u'separate works in themselves, then this License, and its terms, ' + u'do not apply to those sections when you distribute them as ' + u'separate works. But when you distribute the same sections as ' + u'part of a whole which is a work based on the Program, the ' + u'distribution of the whole must be on the terms of this License, ' + u'whose permissions for other licensees extend to the entire ' + u'whole, and thus to each and every part regardless of who wrote ' + u'it.\n' + u'\n' + u'Thus, it is not the intent of this section to claim rights or ' + u'contest your rights to work written entirely by you; rather, the ' + u'intent is to exercise the right to control the distribution of ' + u'derivative or collective works based on the Program.\n' + u'\n' + u'In addition, mere aggregation of another work not based on the ' + u'Program with the Program (or with a work based on the Program) ' + u'on a volume of a storage or distribution medium does not bring ' + u'the other work under the scope of this License.\n' + u'\n' + u'3. You may copy and distribute the Program (or a work based on ' + u'it, under Section 2) in object code or executable form under the ' + u'terms of Sections 1 and 2 above provided that you also do one of ' + u'the following:\n' + u'\n' + u'a) Accompany it with the complete corresponding machine-readable ' + u'source code, which must be distributed under the terms of ' + u'Sections 1 and 2 above on a medium customarily used for software ' + u'interchange; or,\n' + u'\n' + u'b) Accompany it with a written offer, valid for at least three ' + u'years, to give any third party, for a charge no more than your ' + u'cost of physically performing source distribution, a complete ' + u'machine-readable copy of the corresponding source code, to be ' + u'distributed under the terms of Sections 1 and 2 above on a ' + u'medium customarily used for software interchange; or,\n' + u'\n' + u'c) Accompany it with the information you received as to the ' + u'offer to distribute corresponding source code. (This ' + u'alternative is allowed only for noncommercial distribution and ' + u'only if you received the program in object code or executable ' + u'form with such an offer, in accord with Subsection b above.)\n' + u'\n' + u'The source code for a work means the preferred form of the work ' + u'for making modifications to it. For an executable work, ' + u'complete source code means all the source code for all modules ' + u'it contains, plus any associated interface definition files, ' + u'plus the scripts used to control compilation and installation of ' + u'the executable. However, as a special exception, the source ' + u'code distributed need not include anything that is normally ' + u'distributed (in either source or binary form) with the major ' + u'components (compiler, kernel, and so on) of the operating system ' + u'on which the executable runs, unless that component itself ' + u'accompanies the executable.\n' + u'\n' + u'If distribution of executable or object code is made by offering ' + u'access to copy from a designated place, then offering equivalent ' + u'access to copy the source code from the same place counts as ' + u'distribution of the source code, even though third parties are ' + u'not compelled to copy the source along with the object code.\n' + u'\n' + u'4. You may not copy, modify, sublicense, or distribute the ' + u'Program except as expressly provided under this License. Any ' + u'attempt otherwise to copy, modify, sublicense or distribute the ' + u'Program is void, and will automatically terminate your rights ' + u'under this License. However, parties who have received copies, ' + u'or rights, from you under this License will not have their ' + u'licenses terminated so long as such parties remain in full ' + u'compliance.\n' + u'\n' + u'5. You are not required to accept this License, since you have ' + u'not signed it. However, nothing else grants you permission to ' + u'modify or distribute the Program or its derivative works. These ' + u'actions are prohibited by law if you do not accept this ' + u'License. Therefore, by modifying or distributing the Program ' + u'(or any work based on the Program), you indicate your acceptance ' + u'of this License to do so, and all its terms and conditions for ' + u'copying, distributing or modifying the Program or works based on ' + u'it.\n' + u'\n' + u'6. Each time you redistribute the Program (or any work based on ' + u'the Program), the recipient automatically receives a license ' + u'from the original licensor to copy, distribute or modify the ' + u'Program subject to these terms and conditions. You may not ' + u'impose any further restrictions on the recipients\' exercise of ' + u'the rights granted herein. You are not responsible for enforcing ' + u'compliance by third parties to this License.\n' + u'\n' + u'7. If, as a consequence of a court judgment or allegation of ' + u'patent infringement or for any other reason (not limited to ' + u'patent issues), conditions are imposed on you (whether by court ' + u'order, agreement or otherwise) that contradict the conditions of ' + u'this License, they do not excuse you from the conditions of this ' + u'License. If you cannot distribute so as to satisfy ' + u'simultaneously your obligations under this License and any other ' + u'pertinent obligations, then as a consequence you may not ' + u'distribute the Program at all. For example, if a patent license ' + u'would not permit royalty-free redistribution of the Program by ' + u'all those who receive copies directly or indirectly through you, ' + u'then the only way you could satisfy both it and this License ' + u'would be to refrain entirely from distribution of the Program.\n' + u'\n' + u'If any portion of this section is held invalid or unenforceable ' + u'under any particular circumstance, the balance of the section is ' + u'intended to apply and the section as a whole is intended to ' + u'apply in other circumstances.\n' + u'\n' + u'It is not the purpose of this section to induce you to infringe ' + u'any patents or other property right claims or to contest ' + u'validity of any such claims; this section has the sole purpose ' + u'of protecting the integrity of the free software distribution ' + u'system, which is implemented by public license practices. Many ' + u'people have made generous contributions to the wide range of ' + u'software distributed through that system in reliance on ' + u'consistent application of that system; it is up to the ' + u'author/donor to decide if he or she is willing to distribute ' + u'software through any other system and a licensee cannot impose ' + u'that choice.\n' + u'\n' + u'This section is intended to make thoroughly clear what is ' + u'believed to be a consequence of the rest of this License.\n' + u'\n' + u'8. If the distribution and/or use of the Program is restricted ' + u'in certain countries either by patents or by copyrighted ' + u'interfaces, the original copyright holder who places the Program ' + u'under this License may add an explicit geographical distribution ' + u'limitation excluding those countries, so that distribution is ' + u'permitted only in or among countries not thus excluded. In such ' + u'case, this License incorporates the limitation as if written in ' + u'the body of this License.\n' + u'\n' + u'9. The Free Software Foundation may publish revised and/or new ' + u'versions of the General Public License from time to time. Such ' + u'new versions will be similar in spirit to the present version, ' + u'but may differ in detail to address new problems or concerns.\n' + u'\n' + u'Each version is given a distinguishing version number. If the ' + u'Program specifies a version number of this License which applies ' + u'to it and \"any later version\', you have the option of ' + u'following the terms and conditions either of that version or of ' + u'any later version published by the Free Software Foundation. If ' + u'the Program does not specify a version number of this License, ' + u'you may choose any version ever published by the Free Software ' + u'Foundation.\n' + u'\n' + u'10. If you wish to incorporate parts of the Program into other ' + u'free programs whose distribution conditions are different, write ' + u'to the author to ask for permission. For software which is ' + u'copyrighted by the Free Software Foundation, write to the Free ' + u'Software Foundation; we sometimes make exceptions for this. Our ' + u'decision will be guided by the two goals of preserving the free ' + u'status of all derivatives of our free software and of promoting ' + u'the sharing and reuse of software generally.\n' + u'\n' + u'NO WARRANTY\n' + u'\n' + u'11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO ' + u'WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE ' + u'LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT ' + u'HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT ' + u'WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, ' + u'BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ' + u'AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE ' + u'QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ' + u'PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY ' + u'SERVICING, REPAIR OR CORRECTION.\n' + u'\n' + u'12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO ' + u'IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY ' + u'MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE ' + u'LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, ' + u'INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR ' + u'INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS ' + u'OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ' + u'YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ' + u'ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ' + u'ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\n' + u'\n' + u'END OF TERMS AND CONDITIONS\n' + u'\n' + u'How to Apply These Terms to Your New Programs\n' + u'\n' + u'If you develop a new program, and you want it to be of the ' + u'greatest possible use to the public, the best way to achieve ' + u'this is to make it free software which everyone can redistribute ' + u'and change under these terms.\n' + u'\n' + u'To do so, attach the following notices to the program. It is ' + u'safest to attach them to the start of each source file to most ' + u'effectively convey the exclusion of warranty; and each file ' + u'should have at least the "copyright" line and a pointer to where ' + u'the full notice is found.\n' + u'\n' + u'\n' + u'Copyright (C) \n' + u'\n' + u'This program is free software; you can redistribute it and/or ' + u'modify it under the terms of the GNU General Public License as ' + u'published by the Free Software Foundation; either version 2 of ' + u'the License, or (at your option) any later version.\n' + u'\n' + u'This program is distributed in the hope that it will be useful, ' + u'but WITHOUT ANY WARRANTY; without even the implied warranty of ' + u'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ' + u'GNU General Public License for more details.\n' + u'\n' + u'You should have received a copy of the GNU General Public ' + u'License along with this program; if not, write to the Free ' + u'Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ' + u'Boston, MA 02110-1301 USA.\n' + u'\n' + u'Also add information on how to contact you by electronic and ' + u'paper mail.\n' + u'\n' + u'If the program is interactive, make it output a short notice ' + u'like this when it starts in an interactive mode:\n' + u'\n' + u'Gnomovision version 69, Copyright (C) year name of author\n' + u'Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type ' + u'"show w".\n' + u'This is free software, and you are welcome to redistribute it ' + u'under certain conditions; type "show c" for details.\n' + u'\n' + u'The hypothetical commands "show w" and "show c" should show ' + u'the appropriate parts of the General Public License. Of course, ' + u'the commands you use may be called something other than "show ' + u'w" and "show c"; they could even be mouse-clicks or menu items--' + u'whatever suits your program.\n' + u'\n' + u'You should also get your employer (if you work as a programmer) ' + u'or your school, if any, to sign a "copyright disclaimer" for the ' + u'program, if necessary. Here is a sample; alter the names:\n' + u'\n' + u'Yoyodyne, Inc., hereby disclaims all copyright interest in the ' + u'program "Gnomovision" (which makes passes at compilers) written ' + u'by James Hacker.\n' + u'\n' + u', 1 April 1989\n' + u'Ty Coon, President of Vice\n' + u'\n' + u'This General Public License does not permit incorporating your ' + u'program into proprietary programs. If your program is a ' + u'subroutine library, you may consider it more useful to permit ' + u'linking proprietary applications with the library. If this is ' + u'what you want to do, use the GNU Lesser General Public License ' + u'instead of this License.')) self.AboutNotebook.setTabText( self.AboutNotebook.indexOf(self.LicenseTab), translate(u'AboutForm', u'License')) From 84d8f0f12ada68a40763f6bb123b11166117bbaf Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 16:46:07 +0200 Subject: [PATCH 13/17] ups.. removed a "0" that should not be here.. --- openlp/core/ui/amendthemeform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 34a24046a..060bb9437 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -211,7 +211,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): def onImageToolButtonClicked(self): filename = QtGui.QFileDialog.getOpenFileName( self, translate(u'AmendThemeForm', u'Open file')) - if filename:0 + if filename: self.ImageLineEdit.setText(filename) self.theme.background_filename = filename self.previewTheme() From b7d4f537e560667bcd3bb0f63d4a6716fae90e40 Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Mon, 7 Jun 2010 00:44:49 +0200 Subject: [PATCH 14/17] . --- openlp/core/ui/thememanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 81ebb7f18..17497fdb7 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -372,7 +372,7 @@ class ThemeManager(QtGui.QWidget): except IOError: QtGui.QMessageBox.critical( self, translate(u'ThemeManager', u'Error'), - translate(u'ThemeManager', u'File is not a valid theme.'), + translate(u'ThemeManager', u'File is not a valid theme.')) log.exception(u'Importing theme from zip file failed %s' % filename) finally: if zip: From 9bb7343092bd32c52ce9ebdb6be9fdb33e59b5fa Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Mon, 7 Jun 2010 00:24:45 +0100 Subject: [PATCH 15/17] Fix incorrect exception --- openlp/core/lib/toolbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/lib/toolbar.py b/openlp/core/lib/toolbar.py index 12916097e..799852908 100644 --- a/openlp/core/lib/toolbar.py +++ b/openlp/core/lib/toolbar.py @@ -120,7 +120,7 @@ class OpenLPToolbar(QtGui.QToolBar): try: if self.icons[title]: return self.icons[title] - except NameError: + except KeyError: log.exception(u'getIconFromTitle - no icon for %s' % title) return QtGui.QIcon() From 559e4c4d63145653b25769f103707d9692963225 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Jun 2010 16:38:09 +0100 Subject: [PATCH 16/17] Cleanups --- openlp/core/ui/amendthemedialog.py | 29 ++++++----- openlp/core/ui/amendthemeform.py | 20 ++++++-- openlp/core/ui/displaytab.py | 27 +++++------ openlp/core/ui/thememanager.py | 6 +-- openlp/core/utils/languagemanager.py | 11 +++-- openlp/plugins/alerts/alertsplugin.py | 2 +- openlp/plugins/alerts/forms/alertform.py | 36 ++++++-------- .../plugins/bibles/forms/importwizardform.py | 2 +- openlp/plugins/bibles/lib/biblestab.py | 2 +- openlp/plugins/bibles/lib/mediaitem.py | 12 ++--- openlp/plugins/bibles/lib/opensong.py | 4 +- openlp/plugins/custom/customplugin.py | 2 +- .../plugins/custom/forms/editcustomdialog.py | 22 ++++----- openlp/plugins/custom/forms/editcustomform.py | 11 +++-- openlp/plugins/custom/lib/customtab.py | 2 +- openlp/plugins/custom/lib/mediaitem.py | 3 +- openlp/plugins/images/imageplugin.py | 2 +- openlp/plugins/images/lib/imagetab.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 5 +- openlp/plugins/media/lib/mediaitem.py | 13 +++-- openlp/plugins/media/mediaplugin.py | 16 +++++-- .../presentations/lib/impresscontroller.py | 24 ++++++---- .../presentations/lib/powerpointcontroller.py | 12 +++-- .../presentations/lib/pptviewcontroller.py | 4 +- .../lib/presentationcontroller.py | 2 +- openlp/plugins/songs/forms/__init__.py | 32 ++++++++----- openlp/plugins/songs/forms/editsongdialog.py | 48 ++++++++++++------- openlp/plugins/songs/forms/editsongform.py | 15 +++--- openlp/plugins/songs/forms/editversedialog.py | 40 ++++++++-------- openlp/plugins/songs/forms/editverseform.py | 6 ++- .../songs/forms/songmaintenancedialog.py | 8 ++-- .../songs/forms/songmaintenanceform.py | 6 ++- openlp/plugins/songs/lib/manager.py | 4 +- openlp/plugins/songs/lib/mediaitem.py | 1 - openlp/plugins/songs/lib/oooimport.py | 9 ++-- openlp/plugins/songs/lib/songstab.py | 4 +- openlp/plugins/songs/songsplugin.py | 3 +- .../songusage/forms/songusagedeleteform.py | 1 + .../songusage/forms/songusagedetaildialog.py | 17 ++++--- 39 files changed, 254 insertions(+), 211 deletions(-) diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index 283d6f3b4..142592d88 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -671,8 +671,8 @@ class Ui_AmendThemeDialog(object): self.ThemePreviewLayout.addItem(spacerItem8) self.AmendThemeLayout.addWidget(self.PreviewGroupBox) self.ThemeButtonBox = QtGui.QDialogButtonBox(AmendThemeDialog) - self.ThemeButtonBox.setStandardButtons( - QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) + self.ThemeButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | + QtGui.QDialogButtonBox.Ok) self.ThemeButtonBox.setObjectName(u'ThemeButtonBox') self.AmendThemeLayout.addWidget(self.ThemeButtonBox) @@ -813,12 +813,9 @@ class Ui_AmendThemeDialog(object): translate(u'AmendThemeForm', u'Width:')) self.FontMainHeightLabel.setText( translate(u'AmendThemeForm', u'Height:')) - self.FontMainXSpinBox.setSuffix( - translate(u'AmendThemeForm', u'px')) - self.FontMainYSpinBox.setSuffix( - translate(u'AmendThemeForm', u'px')) - self.FontMainWidthSpinBox.setSuffix( - translate(u'AmendThemeForm', u'px')) + self.FontMainXSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.FontMainYSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) + self.FontMainWidthSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) self.FontMainHeightSpinBox.setSuffix( translate(u'AmendThemeForm', u'px')) self.ThemeTabWidget.setTabText( @@ -830,7 +827,8 @@ class Ui_AmendThemeDialog(object): self.FontFooterColorLabel.setText( translate(u'AmendThemeForm', u'Font Color:')) self.FontFooterSizeLabel.setText(translate(u'AmendThemeForm', u'Size:')) - self.FontFooterSizeSpinBox.setSuffix(translate(u'AmendThemeForm', u'pt')) + self.FontFooterSizeSpinBox.setSuffix( + translate(u'AmendThemeForm', u'pt')) self.FontFooterWeightComboBox.setItemText(0, translate(u'AmendThemeForm', u'Normal')) self.FontFooterWeightComboBox.setItemText(1, @@ -863,16 +861,16 @@ class Ui_AmendThemeDialog(object): translate(u'AmendThemeForm', u'px')) self.ThemeTabWidget.setTabText( self.ThemeTabWidget.indexOf(self.FontFooterTab), - translate('AmendThemeForm', 'Font Footer')) - self.OutlineGroupBox.setTitle(translate('AmendThemeForm', 'Outline')) + translate(u'AmendThemeForm', u'Font Footer')) + self.OutlineGroupBox.setTitle(translate(u'AmendThemeForm', u'Outline')) self.OutlineSpinBoxLabel.setText( - translate('AmendThemeForm', 'Outline Size:')) - self.OutlineSpinBox.setSuffix(translate('AmendThemeForm', 'px')) + translate(u'AmendThemeForm', u'Outline Size:')) + self.OutlineSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) self.OutlineColorLabel.setText( translate(u'AmendThemeForm', u'Outline Color:')) self.OutlineEnabledLabel.setText( - translate('AmendThemeForm', 'Show Outline:')) - self.ShadowGroupBox.setTitle(translate('AmendThemeForm', 'Shadow')) + translate(u'AmendThemeForm', u'Show Outline:')) + self.ShadowGroupBox.setTitle(translate(u'AmendThemeForm', u'Shadow')) self.ShadowSpinBoxLabel.setText( translate(u'AmendThemeForm', u'Shadow Size:')) self.ShadowSpinBox.setSuffix(translate(u'AmendThemeForm', u'px')) @@ -906,3 +904,4 @@ class Ui_AmendThemeDialog(object): self.ThemeTabWidget.indexOf(self.OtherOptionsTab), translate(u'AmendThemeForm', u'Other Options')) self.PreviewGroupBox.setTitle(translate(u'AmendThemeForm', u'Preview')) + diff --git a/openlp/core/ui/amendthemeform.py b/openlp/core/ui/amendthemeform.py index 4510d77ea..1ae9caa79 100644 --- a/openlp/core/ui/amendthemeform.py +++ b/openlp/core/ui/amendthemeform.py @@ -215,6 +215,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.ImageLineEdit.setText(filename) self.theme.background_filename = filename self.previewTheme() + # #Main Font Tab # @@ -306,6 +307,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): if self.theme.font_main_height != self.FontMainHeightSpinBox.value(): self.theme.font_main_height = self.FontMainHeightSpinBox.value() self.previewTheme() + # #Footer Font Tab # @@ -384,6 +386,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.font_footer_height = \ self.FontFooterHeightSpinBox.value() self.previewTheme() + # #Background Tab # @@ -446,6 +449,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.Color2PushButton.setStyleSheet( u'background-color: %s' % unicode(self.theme.background_endColor)) self.previewTheme() + # #Other Tab # @@ -506,6 +510,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.display_verticalAlign = currentIndex self.stateChanging(self.theme) self.previewTheme() + # #Local Methods # @@ -629,7 +634,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): if theme.background_type == u'solid': self.Color1PushButton.setStyleSheet( u'background-color: %s' % unicode(theme.background_color)) - self.Color1Label.setText(translate(u'AmendThemeForm', u'Background Color:')) + self.Color1Label.setText( + translate(u'AmendThemeForm', u'Background Color:')) self.Color1Label.setVisible(True) self.Color1PushButton.setVisible(True) self.Color2Label.setVisible(False) @@ -644,8 +650,10 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): % unicode(theme.background_startColor)) self.Color2PushButton.setStyleSheet(u'background-color: %s' \ % unicode(theme.background_endColor)) - self.Color1Label.setText(translate(u'AmendThemeForm', u'First Color:')) - self.Color2Label.setText(translate(u'AmendThemeForm', u'Second Color:')) + self.Color1Label.setText( + translate(u'AmendThemeForm', u'First Color:')) + self.Color2Label.setText( + translate(u'AmendThemeForm', u'Second Color:')) self.Color1Label.setVisible(True) self.Color1PushButton.setVisible(True) self.Color2Label.setVisible(True) @@ -713,7 +721,8 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): log.debug(u'Page Length area height %s, metrics %s, lines %s' % (self.FontMainHeightSpinBox.value(), metrics.height(), page_length)) - page_length_text = unicode(translate(u'AmendThemeForm', u'Slide Height is %s rows')) + page_length_text = unicode( + translate(u'AmendThemeForm', u'Slide Height is %s rows')) self.FontMainLinesPageLabel.setText(page_length_text % page_length) frame = self.thememanager.generateImage(self.theme) self.ThemePreview.setPixmap(QtGui.QPixmap.fromImage(frame)) @@ -728,8 +737,9 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog): self.theme.font_main_italics)# italic mainFont.setPixelSize(self.theme.font_main_proportion) metrics = QtGui.QFontMetrics(mainFont) - #Validate that the screen width is big enough to display the text + # Validate that the screen width is big enough to display the text if self.theme.font_main_width < metrics.maxWidth() * 2 + 64: self.theme.font_main_width = metrics.maxWidth() * 2 + 64 self.FontMainWidthSpinBox.setValue(self.theme.font_main_width) return metrics + diff --git a/openlp/core/ui/displaytab.py b/openlp/core/ui/displaytab.py index 6c970bda3..6fe9f16e2 100644 --- a/openlp/core/ui/displaytab.py +++ b/openlp/core/ui/displaytab.py @@ -155,12 +155,12 @@ class DisplayTab(SettingsTab): self.OverrideCheckBox.setObjectName(u'OverrideCheckBox') QtCore.QMetaObject.connectSlotsByName(self) QtCore.QObject.connect(self.OverrideCheckBox, - QtCore.SIGNAL(u'stateChanged(int)'), - self.onOverrideCheckBoxChanged) + QtCore.SIGNAL(u'stateChanged(int)'), self.onOverrideCheckBoxChanged) def retranslateUi(self): self.setWindowTitle(translate(u'DisplayTab', u'Amend Display Settings')) - self.CurrentGroupBox.setTitle(translate(u'DisplayTab', u'Default Settings')) + self.CurrentGroupBox.setTitle( + translate(u'DisplayTab', u'Default Settings')) self.XLabel.setText(translate(u'DisplayTab', u'X')) self.Xpos.setText(u'0') self.YLabel.setText(translate(u'DisplayTab', u'Y')) @@ -169,12 +169,14 @@ class DisplayTab(SettingsTab): self.Height.setText(u'0') self.WidthLabel.setText(translate(u'DisplayTab', u'Width')) self.Width.setText(u'0') - self.CurrentGroupBox_2.setTitle(translate(u'DisplayTab', u'Amend Settings')) + self.CurrentGroupBox_2.setTitle( + translate(u'DisplayTab', u'Amend Settings')) self.XAmendLabel.setText(translate(u'DisplayTab', u'X')) self.YAmendLabel.setText(translate(u'DisplayTab', u'Y')) self.HeightAmendLabel.setText(translate(u'DisplayTab', u'Height')) self.WidthAmendLabel.setText(translate(u'DisplayTab', u'Width')) - self.OverrideCheckBox.setText(translate(u'DisplayTab', u'Override Output Display')) + self.OverrideCheckBox.setText( + translate(u'DisplayTab', u'Override Output Display')) def load(self): settings = QtCore.QSettings() @@ -209,16 +211,11 @@ class DisplayTab(SettingsTab): def save(self): settings = QtCore.QSettings() settings.beginGroup(self.settingsSection) - settings.setValue('x position', - QtCore.QVariant(self.XposEdit.text())) - settings.setValue('y position', - QtCore.QVariant(self.YposEdit.text())) - settings.setValue('height', - QtCore.QVariant(self.HeightEdit.text())) - settings.setValue('width', - QtCore.QVariant(self.WidthEdit.text())) - settings.setValue('amend display', - QtCore.QVariant(self.amend_display)) + settings.setValue('x position', QtCore.QVariant(self.XposEdit.text())) + settings.setValue('y position', QtCore.QVariant(self.YposEdit.text())) + settings.setValue('height', QtCore.QVariant(self.HeightEdit.text())) + settings.setValue('width', QtCore.QVariant(self.WidthEdit.text())) + settings.setValue('amend display', QtCore.QVariant(self.amend_display)) self.postSetUp() def postSetUp(self): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 9e60aaea3..f1d5ece34 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -35,7 +35,7 @@ from openlp.core.ui import AmendThemeForm from openlp.core.theme import Theme from openlp.core.lib import OpenLPToolbar, contextMenuAction, \ ThemeXML, str_to_bool, get_text_file_string, build_icon, Receiver, \ - contextMenuSeparator, SettingsManager, translate + contextMenuSeparator, SettingsManager, translate from openlp.core.utils import AppLocation log = logging.getLogger(__name__) @@ -99,7 +99,7 @@ class ThemeManager(QtGui.QWidget): contextMenuAction(self.ThemeListWidget, u':/general/general_export.png', translate(u'ThemeManager', u'Export theme'), - self.onExportTheme)) + self.onExportTheme)) self.ThemeListWidget.addAction( contextMenuSeparator(self.ThemeListWidget)) #Signals @@ -199,7 +199,7 @@ class ThemeManager(QtGui.QWidget): return if unicode(self.parent.ServiceManagerContents.ThemeComboBox.currentText()) == theme: QtGui.QMessageBox.critical( - self, translate('ThemeManager','Error'), + self, translate(u'ThemeManager',u'Error'), translate(u'ThemeManager', u'Theme %s is use by Service Manager' % theme), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) diff --git a/openlp/core/utils/languagemanager.py b/openlp/core/utils/languagemanager.py index 8621095ab..06d00c40f 100644 --- a/openlp/core/utils/languagemanager.py +++ b/openlp/core/utils/languagemanager.py @@ -34,7 +34,7 @@ log = logging.getLogger() class LanguageManager(object): """ - Helper for Language selection + Helper for Language selection """ __qmList__ = None AutoLanguage = False @@ -55,8 +55,8 @@ class LanguageManager(object): trans_dir = QtCore.QDir(os.path.join(trans_dir, u'resources', u'i18n')) fileNames = trans_dir.entryList(QtCore.QStringList("*.qm"), QtCore.QDir.Files, QtCore.QDir.Name) - for i in fileNames: - fileNames.replaceInStrings(i, trans_dir.filePath(i)) + for name in fileNames: + fileNames.replaceInStrings(name, trans_dir.filePath(name)) return fileNames @staticmethod @@ -101,11 +101,12 @@ class LanguageManager(object): regEx = QtCore.QRegExp("^.*openlp_(.*).qm") if regEx.exactMatch(qmf): langName = regEx.cap(1) - LanguageManager.__qmList__[u'%#2i %s' % (i+1, - LanguageManager.language_name(qmf))] = langName + LanguageManager.__qmList__[u'%#2i %s' % (i+1, + LanguageManager.language_name(qmf))] = langName @staticmethod def get_qm_list(): if LanguageManager.__qmList__ == None: LanguageManager.init_qm_list() return LanguageManager.__qmList__ + diff --git a/openlp/plugins/alerts/alertsplugin.py b/openlp/plugins/alerts/alertsplugin.py index 87d01db76..7474a0564 100644 --- a/openlp/plugins/alerts/alertsplugin.py +++ b/openlp/plugins/alerts/alertsplugin.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon, PluginStatus, translate +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.alerts.lib import AlertsManager, AlertsTab, DBManager from openlp.plugins.alerts.forms import AlertForm diff --git a/openlp/plugins/alerts/forms/alertform.py b/openlp/plugins/alerts/forms/alertform.py index 83afe986b..04028fc1b 100644 --- a/openlp/plugins/alerts/forms/alertform.py +++ b/openlp/plugins/alerts/forms/alertform.py @@ -43,38 +43,29 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): self.item_id = None QtGui.QDialog.__init__(self, None) self.setupUi(self) - QtCore.QObject.connect(self.DisplayButton, - QtCore.SIGNAL(u'clicked()'), - self.onDisplayClicked) + QtCore.QObject.connect(self.DisplayButton, QtCore.SIGNAL(u'clicked()'), + self.onDisplayClicked) QtCore.QObject.connect(self.DisplayCloseButton, - QtCore.SIGNAL(u'clicked()'), - self.onDisplayCloseClicked) + QtCore.SIGNAL(u'clicked()'), self.onDisplayCloseClicked) QtCore.QObject.connect(self.AlertTextEdit, - QtCore.SIGNAL(u'textChanged(const QString&)'), - self.onTextChanged) - QtCore.QObject.connect(self.NewButton, - QtCore.SIGNAL(u'clicked()'), - self.onNewClick) - QtCore.QObject.connect(self.DeleteButton, - QtCore.SIGNAL(u'clicked()'), - self.onDeleteClick) - QtCore.QObject.connect(self.SaveButton, - QtCore.SIGNAL(u'clicked()'), - self.onSaveClick) + QtCore.SIGNAL(u'textChanged(const QString&)'), self.onTextChanged) + QtCore.QObject.connect(self.NewButton, QtCore.SIGNAL(u'clicked()'), + self.onNewClick) + QtCore.QObject.connect(self.DeleteButton, QtCore.SIGNAL(u'clicked()'), + self.onDeleteClick) + QtCore.QObject.connect(self.SaveButton, QtCore.SIGNAL(u'clicked()'), + self.onSaveClick) QtCore.QObject.connect(self.AlertListWidget, - QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), - self.onDoubleClick) + QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onDoubleClick) QtCore.QObject.connect(self.AlertListWidget, - QtCore.SIGNAL(u'clicked(QModelIndex)'), - self.onSingleClick) + QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onSingleClick) def loadList(self): self.AlertListWidget.clear() alerts = self.manager.get_all_alerts() for alert in alerts: item_name = QtGui.QListWidgetItem(alert.text) - item_name.setData( - QtCore.Qt.UserRole, QtCore.QVariant(alert.id)) + item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(alert.id)) self.AlertListWidget.addItem(item_name) self.SaveButton.setEnabled(False) self.DeleteButton.setEnabled(False) @@ -157,3 +148,4 @@ class AlertForm(QtGui.QDialog, Ui_AlertDialog): self.parent.alertsmanager.displayAlert(text) return True return False + diff --git a/openlp/plugins/bibles/forms/importwizardform.py b/openlp/plugins/bibles/forms/importwizardform.py index 36919753d..b1eafcd61 100644 --- a/openlp/plugins/bibles/forms/importwizardform.py +++ b/openlp/plugins/bibles/forms/importwizardform.py @@ -31,7 +31,7 @@ import os.path from PyQt4 import QtCore, QtGui from bibleimportwizard import Ui_BibleImportWizard -from openlp.core.lib import Receiver, SettingsManager, translate +from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.utils import AppLocation, variant_to_unicode from openlp.plugins.bibles.lib.manager import BibleFormat diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index c01ba8c8d..763347784 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -27,7 +27,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Receiver, SettingsTab, translate +from openlp.core.lib import Receiver, SettingsTab, translate log = logging.getLogger(__name__) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 38db5db00..d922cb446 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -29,7 +29,7 @@ import time from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, Receiver, BaseListWithDnD, \ - ItemCapabilities, translate + ItemCapabilities, translate from openlp.plugins.bibles.forms import ImportWizardForm log = logging.getLogger(__name__) @@ -521,10 +521,10 @@ class BibleMediaItem(MediaManagerItem): if self.parent.settings_tab.display_style == 1: verse_text = self.formatVerse(old_chapter, chapter, verse, u'(u', u')') - elif self.parent.settings_tab.display_style == 2: + elif self.parent.settings_tab.display_style == 2: verse_text = self.formatVerse(old_chapter, chapter, verse, u'{', u'}') - elif self.parent.settings_tab.display_style == 3: + elif self.parent.settings_tab.display_style == 3: verse_text = self.formatVerse(old_chapter, chapter, verse, u'[', u']') else: @@ -558,10 +558,9 @@ class BibleMediaItem(MediaManagerItem): service_item.title = u'%s %s' % (book, verse_text) elif service_item.title.find( translate(u'BiblesPlugin.MediaItem', u'etc')) == -1: - service_item.title = u'%s, %s' \ - % (service_item.title, + service_item.title = u'%s, %s' % (service_item.title, translate(u'BiblesPlugin.MediaItem', u'etc')) - if len(self.parent.settings_tab.bible_theme) == 0: + if len(self.parent.settings_tab.bible_theme) == 0: service_item.theme = None else: service_item.theme = self.parent.settings_tab.bible_theme @@ -658,3 +657,4 @@ class BibleMediaItem(MediaManagerItem): def searchByReference(self, bible, search): log.debug(u'searchByReference %s, %s', bible, search) self.search_results = self.parent.manager.get_verses(bible, search) + diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index 585b5bae0..abc06431c 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -28,7 +28,7 @@ import logging from lxml import objectify from PyQt4 import QtCore -from openlp.core.lib import Receiver, translate +from openlp.core.lib import Receiver, translate from db import BibleDB log = logging.getLogger(__name__) @@ -95,7 +95,7 @@ class OpenSongBible(BibleDB): Receiver.send_message(u'openlp_process_events') self.wizard.incrementProgressBar( QtCore.QString('%s %s %s' % ( - translate(u'BiblesPlugin.Opensong', u'Importing'),\ + translate(u'BiblesPlugin.Opensong', u'Importing'), \ db_book.name, chapter.attrib[u'n']))) self.commit() except IOError: diff --git a/openlp/plugins/custom/customplugin.py b/openlp/plugins/custom/customplugin.py index f0d8202a2..9ae208a28 100644 --- a/openlp/plugins/custom/customplugin.py +++ b/openlp/plugins/custom/customplugin.py @@ -26,7 +26,7 @@ import logging from forms import EditCustomForm -from openlp.core.lib import Plugin, build_icon, PluginStatus, translate +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab log = logging.getLogger(__name__) diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 35b6a5f98..de446813f 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -24,6 +24,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui + from openlp.core.lib import translate class Ui_customEditDialog(object): @@ -106,8 +107,8 @@ class Ui_customEditDialog(object): self.SplitButton = QtGui.QPushButton(self.ButtonWidge) self.SplitButton.setObjectName(u'SplitButton') self.verticalLayout_2.addWidget(self.SplitButton) - spacerItem1 = QtGui.QSpacerItem(20, 40, - QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) + spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, + QtGui.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem1) self.EditLayout_3.addWidget(self.ButtonWidge) self.gridLayout.addWidget(self.EditWidget, 2, 0, 1, 1) @@ -130,7 +131,8 @@ class Ui_customEditDialog(object): self.horizontalLayout_2.addWidget(self.CreditEdit) self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(customEditDialog) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | + QtGui.QDialogButtonBox.Save) self.buttonBox.setObjectName(u'buttonBox') self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1) @@ -153,20 +155,17 @@ class Ui_customEditDialog(object): customEditDialog.setTabOrder(self.DownButton, self.ThemeComboBox) def retranslateUi(self, customEditDialog): - customEditDialog.setWindowTitle(translate(u'CustomPlugin.EditCustomForm', - u'Edit Custom Slides')) - self.UpButton.setToolTip( - translate(u'CustomPlugin.EditCustomForm' - u'CustomPlugin.EditCustomForm', - u'Move slide Up 1')) + customEditDialog.setWindowTitle( + translate(u'CustomPlugin.EditCustomForm', u'Edit Custom Slides')) + self.UpButton.setToolTip(translate(u'CustomPlugin.EditCustomForm' + u'CustomPlugin.EditCustomForm', u'Move slide Up 1')) self.DownButton.setToolTip( translate(u'CustomPlugin.EditCustomForm', u'Move slide down 1')) self.TitleLabel.setText( translate(u'CustomPlugin.EditCustomForm', u'Title:')) self.AddButton.setText( translate(u'CustomPlugin.EditCustomForm', u'Add New')) - self.AddButton.setToolTip( - translate(u'CustomPlugin.EditCustomForm', + self.AddButton.setToolTip(translate(u'CustomPlugin.EditCustomForm', u'Add new slide at bottom')) self.EditButton.setText( translate(u'CustomPlugin.EditCustomForm', u'Edit')) @@ -196,3 +195,4 @@ class Ui_customEditDialog(object): translate(u'CustomPlugin.EditCustomForm', u'Theme:')) self.CreditLabel.setText( translate(u'CustomPlugin.EditCustomForm', u'Credits:')) + diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index bbd8f0fed..4e8b5957a 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from editcustomdialog import Ui_customEditDialog -from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate +from openlp.core.lib import SongXMLBuilder, SongXMLParser, Receiver, translate from openlp.plugins.custom.lib.models import CustomSlide log = logging.getLogger(__name__) @@ -163,8 +163,10 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): count += 1 self.customSlide.title = unicode(self.TitleEdit.displayText(), u'utf-8') self.customSlide.text = unicode(sxml.extract_xml(), u'utf-8') - self.customSlide.credits = unicode(self.CreditEdit.displayText(), u'utf-8') - self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText(), u'utf-8') + self.customSlide.credits = unicode(self.CreditEdit.displayText(), + u'utf-8') + self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText(), + u'utf-8') self.custommanager.save_slide(self.customSlide) return True @@ -230,7 +232,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def onSaveButtonPressed(self): if self.editAll: self.VerseListView.clear() - for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n[---]\n'): + for row in unicode(self.VerseTextEdit.toPlainText()).split( + u'\n[---]\n'): self.VerseListView.addItem(row) else: self.VerseListView.currentItem().setText( diff --git a/openlp/plugins/custom/lib/customtab.py b/openlp/plugins/custom/lib/customtab.py index 6f1ac86f1..a12fd8354 100644 --- a/openlp/plugins/custom/lib/customtab.py +++ b/openlp/plugins/custom/lib/customtab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, translate +from openlp.core.lib import SettingsTab, translate class CustomTab(SettingsTab): """ diff --git a/openlp/plugins/custom/lib/mediaitem.py b/openlp/plugins/custom/lib/mediaitem.py index 2c828dd08..581334410 100644 --- a/openlp/plugins/custom/lib/mediaitem.py +++ b/openlp/plugins/custom/lib/mediaitem.py @@ -28,7 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, \ - Receiver, ItemCapabilities, translate + Receiver, ItemCapabilities, translate log = logging.getLogger(__name__) @@ -70,7 +70,6 @@ class CustomMediaItem(MediaManagerItem): def requiredIcons(self): MediaManagerItem.requiredIcons(self) - self.hasFileIcon = False def initialise(self): self.loadCustomListView(self.parent.custommanager.get_all_slides()) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 038558a22..ca375ed6c 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -25,7 +25,7 @@ import logging -from openlp.core.lib import Plugin, build_icon, PluginStatus, translate +from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.images.lib import ImageMediaItem, ImageTab log = logging.getLogger(__name__) diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 24706d60e..cced9b7d6 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import SettingsTab, Receiver, translate +from openlp.core.lib import SettingsTab, Receiver, translate class ImageTab(SettingsTab): """ diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 38e5ab183..96584a455 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -29,7 +29,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - contextMenuAction, ItemCapabilities, SettingsManager, translate + contextMenuAction, ItemCapabilities, SettingsManager, translate from openlp.core.utils import AppLocation log = logging.getLogger(__name__) @@ -169,7 +169,8 @@ class ImageMediaItem(MediaManagerItem): if not self.ListView.selectedIndexes(): QtGui.QMessageBox.information(self, translate(u'ImagePlugin.MediaItem', u'No item selected'), - translate(u'ImagePlugin.MediaItem', u'You must select one item')) + translate(u'ImagePlugin.MediaItem', + u'You must select one item')) items = self.ListView.selectedIndexes() for item in items: bitem = self.ListView.item(item.row()) diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 82579f24b..dc3cc837e 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -29,7 +29,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - ItemCapabilities, SettingsManager, contextMenuAction, Receiver, translate + ItemCapabilities, SettingsManager, contextMenuAction, Receiver, translate log = logging.getLogger(__name__) @@ -77,8 +77,7 @@ class MediaMediaItem(MediaManagerItem): MediaManagerItem.addListViewToToolBar(self) self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.ListView.addAction( - contextMenuAction( - self.ListView, u':/slides/slide_blank.png', + contextMenuAction(self.ListView, u':/slides/slide_blank.png', translate(u'MediaPlugin.MediaItem', u'Replace Live Background'), self.onReplaceClick)) @@ -107,8 +106,7 @@ class MediaMediaItem(MediaManagerItem): self.background = True if not self.ListView.selectedIndexes(): QtGui.QMessageBox.information(self, - translate(u'MediaPlugin.MediaItem', - u'No item selected'), + translate(u'MediaPlugin.MediaItem', u'No item selected'), translate(u'MediaPlugin.MediaItem', u'You must select one item')) items = self.ListView.selectedIndexes() @@ -135,8 +133,8 @@ class MediaMediaItem(MediaManagerItem): self.ListView.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) self.ListView.setIconSize(QtCore.QSize(88, 50)) - self.loadList(SettingsManager.load_list( - self.settingsSection, self.settingsSection)) + self.loadList(SettingsManager.load_list(self.settingsSection, + self.settingsSection)) def onDeleteClick(self): item = self.ListView.currentItem() @@ -154,3 +152,4 @@ class MediaMediaItem(MediaManagerItem): item_name.setIcon(build_icon(img)) item_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(file)) self.ListView.addItem(item_name) + diff --git a/openlp/plugins/media/mediaplugin.py b/openlp/plugins/media/mediaplugin.py index 6405d844d..7c773c5a7 100644 --- a/openlp/plugins/media/mediaplugin.py +++ b/openlp/plugins/media/mediaplugin.py @@ -25,9 +25,10 @@ import logging +from PyQt4.phonon import Phonon + from openlp.core.lib import Plugin, build_icon, PluginStatus, translate from openlp.plugins.media.lib import MediaMediaItem -from PyQt4.phonon import Phonon log = logging.getLogger(__name__) @@ -46,13 +47,17 @@ class MediaPlugin(Plugin): for mimetype in Phonon.BackendCapabilities.availableMimeTypes(): mimetype = unicode(mimetype) type = mimetype.split(u'audio/x-') - self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype) + self.audio_list, mimetype = self._add_to_list(self.audio_list, + type, mimetype) type = mimetype.split(u'audio/') - self.audio_list, mimetype = self._add_to_list(self.audio_list, type, mimetype) + self.audio_list, mimetype = self._add_to_list(self.audio_list, + type, mimetype) type = mimetype.split(u'video/x-') - self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) + self.video_list, mimetype = self._add_to_list(self.video_list, + type, mimetype) type = mimetype.split(u'video/') - self.video_list, mimetype = self._add_to_list(self.video_list, type, mimetype) + self.video_list, mimetype = self._add_to_list(self.video_list, + type, mimetype) def _add_to_list(self, list, value, type): if len(value) == 2: @@ -80,3 +85,4 @@ class MediaPlugin(Plugin): u'Media Plugin
This plugin ' u'allows the playing of audio and video media') return about_text + diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index d75136e21..c1de03b2b 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -106,20 +106,23 @@ class ImpressController(PresentationController): loop = 0 log.debug(u'get UNO Desktop Openoffice - getComponentContext') context = uno.getComponentContext() - log.debug(u'get UNO Desktop Openoffice - createInstaneWithContext - UnoUrlResolver') + log.debug(u'get UNO Desktop Openoffice - createInstaneWithContext - ' + u'UnoUrlResolver') resolver = context.ServiceManager.createInstanceWithContext( u'com.sun.star.bridge.UnoUrlResolver', context) while ctx is None and loop < 3: try: log.debug(u'get UNO Desktop Openoffice - resolve') - ctx = resolver.resolve(u'uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext') + ctx = resolver.resolve(u'uno:socket,host=localhost,port=2002;' + u'urp;StarOffice.ComponentContext') except: log.exception(u'Unable to find running instance ') self.start_process() loop += 1 try: self.manager = ctx.ServiceManager - log.debug(u'get UNO Desktop Openoffice - createInstanceWithContext - Desktop') + log.debug(u'get UNO Desktop Openoffice - createInstanceWithContext' + u' - Desktop') desktop = self.manager.createInstanceWithContext( "com.sun.star.frame.Desktop", ctx ) return desktop @@ -201,7 +204,8 @@ class ImpressDocument(PresentationDocument): if desktop is None: self.controller.start_process() desktop = self.controller.get_com_desktop() - url = u'file:///' + self.filepath.replace(u'\\', u'/').replace(u':', u'|').replace(u' ', u'%20') + url = u'file:///' + self.filepath.replace(u'\\', u'/').replace( + u':', u'|').replace(u' ', u'%20') else: desktop = self.controller.get_uno_desktop() url = uno.systemPathToFileUrl(self.filepath) @@ -219,7 +223,8 @@ class ImpressDocument(PresentationDocument): log.exception(u'Failed to load presentation') return self.presentation = self.document.getPresentation() - self.presentation.Display = self.controller.plugin.render_manager.screens.current_display + 1 + self.presentation.Display = \ + self.controller.plugin.render_manager.screens.current_display + 1 self.control = None self.create_thumbnails() @@ -332,12 +337,14 @@ class ImpressDocument(PresentationDocument): log.debug(u'start presentation OpenOffice') if self.control is None or not self.control.isRunning(): self.presentation.start() - # start() returns before the getCurrentComponent is ready. Try for 5 seconds + # start() returns before the getCurrentComponent is ready. + # Try for 5 seconds i = 1 while self.desktop.getCurrentComponent() is None and i < 50: time.sleep(0.1) i = i + 1 - self.control = self.desktop.getCurrentComponent().Presentation.getController() + self.control = \ + self.desktop.getCurrentComponent().Presentation.getController() else: self.control.activate() self.goto_slide(1) @@ -383,7 +390,7 @@ class ImpressDocument(PresentationDocument): Returns the text on the slide ``slide_no`` - The slide the text is required for, starting at 1 + The slide the text is required for, starting at 1 """ doc = self.document pages = doc.getDrawPages() @@ -412,3 +419,4 @@ class ImpressDocument(PresentationDocument): if shape.supportsService("com.sun.star.drawing.Text"): text += shape.getString() + '\n' return text + diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 05ef7e4f1..34cc6376e 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -122,7 +122,8 @@ class PowerpointDocument(PresentationDocument): if not self.controller.process.Visible: self.controller.start_process() #try: - self.controller.process.Presentations.Open(self.filepath, False, False, True) + self.controller.process.Presentations.Open(self.filepath, False, False, + True) #except: # return self.presentation = self.controller.process.Presentations( @@ -140,8 +141,8 @@ class PowerpointDocument(PresentationDocument): """ if self.check_thumbnails(): return - self.presentation.Export(os.path.join(self.thumbnailpath, '') - , 'png', 640, 480) + self.presentation.Export(os.path.join(self.thumbnailpath, ''), 'png', + 640, 480) def close_presentation(self): """ @@ -225,7 +226,8 @@ class PowerpointDocument(PresentationDocument): dpi = win32ui.GetActiveWindow().GetDC().GetDeviceCaps(88) except: try: - dpi = win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88) + dpi = \ + win32ui.GetForegroundWindow().GetDC().GetDeviceCaps(88) except: dpi = 96 self.presentation.SlideShowSettings.Run() @@ -286,7 +288,7 @@ class PowerpointDocument(PresentationDocument): Returns the text on the slide ``slide_no`` - The slide the text is required for, starting at 1 + The slide the text is required for, starting at 1 """ text = '' shapes = self.presentation.Slides(slide_no).Shapes diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 59cf1ff3b..409a0b760 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -125,7 +125,8 @@ class PptviewDocument(PresentationDocument): filepath = str(self.filepath.replace(u'/', u'\\')) try: self.pptid = self.controller.process.OpenPPT(filepath, None, rect, - str(os.path.join(self.thumbnailpath, self.controller.thumbnailprefix))) + str(os.path.join(self.thumbnailpath, + self.controller.thumbnailprefix))) self.stop_presentation() except: log.exception(u'Failed to load presentation') @@ -233,3 +234,4 @@ class PptviewDocument(PresentationDocument): return path else: return None + diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 3d2836041..706e70ae6 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -381,7 +381,7 @@ class PresentationDocument(object): Returns the text on the slide ``slide_no`` - The slide the text is required for, starting at 1 + The slide the text is required for, starting at 1 """ return '' diff --git a/openlp/plugins/songs/forms/__init__.py b/openlp/plugins/songs/forms/__init__.py index 90b983b97..a336db465 100644 --- a/openlp/plugins/songs/forms/__init__.py +++ b/openlp/plugins/songs/forms/__init__.py @@ -37,36 +37,42 @@ class VerseType(object): @staticmethod def to_string(verse_type): if verse_type == VerseType.Verse: - return translate('VerseType', 'Verse') + return translate(u'VerseType', u'Verse') elif verse_type == VerseType.Chorus: - return translate('VerseType', 'Chorus') + return translate(u'VerseType', u'Chorus') elif verse_type == VerseType.Bridge: - return translate('VerseType', 'Bridge') + return translate(u'VerseType', u'Bridge') elif verse_type == VerseType.PreChorus: - return translate('VerseType', 'Pre-Chorus') + return translate(u'VerseType', u'Pre-Chorus') elif verse_type == VerseType.Intro: - return translate('VerseType', 'Intro') + return translate(u'VerseType', u'Intro') elif verse_type == VerseType.Ending: - return translate('VerseType', 'Ending') + return translate(u'VerseType', u'Ending') elif verse_type == VerseType.Other: - return translate('VerseType', 'Other') + return translate(u'VerseType', u'Other') @staticmethod def from_string(verse_type): verse_type = verse_type.lower() if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower(): return VerseType.Verse - elif verse_type == unicode(VerseType.to_string(VerseType.Chorus)).lower(): + elif verse_type == \ + unicode(VerseType.to_string(VerseType.Chorus)).lower(): return VerseType.Chorus - elif verse_type == unicode(VerseType.to_string(VerseType.Bridge)).lower(): + elif verse_type == \ + unicode(VerseType.to_string(VerseType.Bridge)).lower(): return VerseType.Bridge - elif verse_type == unicode(VerseType.to_string(VerseType.PreChorus)).lower(): + elif verse_type == \ + unicode(VerseType.to_string(VerseType.PreChorus)).lower(): return VerseType.PreChorus - elif verse_type == unicode(VerseType.to_string(VerseType.Intro)).lower(): + elif verse_type == \ + unicode(VerseType.to_string(VerseType.Intro)).lower(): return VerseType.Intro - elif verse_type == unicode(VerseType.to_string(VerseType.Ending)).lower(): + elif verse_type == \ + unicode(VerseType.to_string(VerseType.Ending)).lower(): return VerseType.Ending - elif verse_type == unicode(VerseType.to_string(VerseType.Other)).lower(): + elif verse_type == \ + unicode(VerseType.to_string(VerseType.Other)).lower(): return VerseType.Other from authorsform import AuthorsForm diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 400a8e47a..d613715dd 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -116,7 +116,8 @@ class Ui_EditSongDialog(object): self.AuthorsTabLayout.setObjectName(u'AuthorsTabLayout') self.AuthorsMaintenanceWidget = QtGui.QWidget(self.AuthorsTab) self.AuthorsMaintenanceWidget.setObjectName(u'AuthorsMaintenanceWidget') - self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout(self.AuthorsMaintenanceWidget) + self.AuthorsMaintenanceLayout = QtGui.QVBoxLayout( + self.AuthorsMaintenanceWidget) self.AuthorsMaintenanceLayout.setSpacing(8) self.AuthorsMaintenanceLayout.setMargin(0) self.AuthorsMaintenanceLayout.setObjectName(u'AuthorsMaintenanceLayout') @@ -146,7 +147,8 @@ class Ui_EditSongDialog(object): self.AuthorsSelectionComboItem.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToMinimumContentsLength) self.AuthorsSelectionComboItem.setMinimumContentsLength(8) - self.AuthorsSelectionComboItem.setObjectName(u'AuthorsSelectionComboItem') + self.AuthorsSelectionComboItem.setObjectName( + u'AuthorsSelectionComboItem') self.AuthorAddLayout.addWidget(self.AuthorsSelectionComboItem) self.AuthorAddButton = QtGui.QPushButton(self.AuthorAddWidget) self.AuthorAddButton.setMaximumSize(QtCore.QSize(110, 16777215)) @@ -261,7 +263,8 @@ class Ui_EditSongDialog(object): QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.SongbookCombo.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.SongbookCombo.sizePolicy().hasHeightForWidth()) self.SongbookCombo.setEditable(True) self.SongbookCombo.setSizePolicy(sizePolicy) self.SongbookCombo.setObjectName(u'SongbookCombo') @@ -277,7 +280,8 @@ class Ui_EditSongDialog(object): self.ThemeTabLayout.setObjectName(u'ThemeTabLayout') self.ThemeCopyCommentsWidget = QtGui.QWidget(self.ThemeTab) self.ThemeCopyCommentsWidget.setObjectName(u'ThemeCopyCommentsWidget') - self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout(self.ThemeCopyCommentsWidget) + self.ThemeCopyCommentsLayout = QtGui.QHBoxLayout( + self.ThemeCopyCommentsWidget) self.ThemeCopyCommentsLayout.setSpacing(8) self.ThemeCopyCommentsLayout.setMargin(0) self.ThemeCopyCommentsLayout.setObjectName(u'ThemeCopyCommentsLayout') @@ -286,7 +290,8 @@ class Ui_EditSongDialog(object): QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.TextWidget.sizePolicy().hasHeightForWidth()) + sizePolicy.setHeightForWidth( + self.TextWidget.sizePolicy().hasHeightForWidth()) self.TextWidget.setSizePolicy(sizePolicy) self.TextWidget.setObjectName(u'TextWidget') self.DetailsLayout = QtGui.QVBoxLayout(self.TextWidget) @@ -401,24 +406,34 @@ class Ui_EditSongDialog(object): EditSongDialog.setTabOrder(self.AlternativeEdit, self.VerseListWidget) EditSongDialog.setTabOrder(self.VerseListWidget, self.VerseAddButton) EditSongDialog.setTabOrder(self.VerseAddButton, self.VerseEditButton) - EditSongDialog.setTabOrder(self.VerseEditButton, self.VerseEditAllButton) - EditSongDialog.setTabOrder(self.VerseEditAllButton, self.VerseDeleteButton) + EditSongDialog.setTabOrder(self.VerseEditButton, + self.VerseEditAllButton) + EditSongDialog.setTabOrder(self.VerseEditAllButton, + self.VerseDeleteButton) EditSongDialog.setTabOrder(self.VerseDeleteButton, self.VerseOrderEdit) - EditSongDialog.setTabOrder(self.VerseOrderEdit, self.AuthorsSelectionComboItem) - EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem, self.AuthorAddButton) + EditSongDialog.setTabOrder(self.VerseOrderEdit, + self.AuthorsSelectionComboItem) + EditSongDialog.setTabOrder(self.AuthorsSelectionComboItem, + self.AuthorAddButton) EditSongDialog.setTabOrder(self.AuthorAddButton, self.AuthorsListView) - EditSongDialog.setTabOrder(self.AuthorsListView, self.AuthorRemoveButton) - EditSongDialog.setTabOrder(self.AuthorRemoveButton, self.MaintenanceButton) + EditSongDialog.setTabOrder(self.AuthorsListView, + self.AuthorRemoveButton) + EditSongDialog.setTabOrder(self.AuthorRemoveButton, + self.MaintenanceButton) EditSongDialog.setTabOrder(self.MaintenanceButton, self.SongTopicCombo) EditSongDialog.setTabOrder(self.SongTopicCombo, self.TopicAddButton) EditSongDialog.setTabOrder(self.TopicAddButton, self.TopicsListView) EditSongDialog.setTabOrder(self.TopicsListView, self.TopicRemoveButton) EditSongDialog.setTabOrder(self.TopicRemoveButton, self.SongbookCombo) - EditSongDialog.setTabOrder(self.SongbookCombo, self.ThemeSelectionComboItem) - EditSongDialog.setTabOrder(self.ThemeSelectionComboItem, self.ThemeAddButton) + EditSongDialog.setTabOrder(self.SongbookCombo, + self.ThemeSelectionComboItem) + EditSongDialog.setTabOrder(self.ThemeSelectionComboItem, + self.ThemeAddButton) EditSongDialog.setTabOrder(self.ThemeAddButton, self.CopyrightEditItem) - EditSongDialog.setTabOrder(self.CopyrightEditItem, self.CopyrightInsertButton) - EditSongDialog.setTabOrder(self.CopyrightInsertButton, self.CCLNumberEdit) + EditSongDialog.setTabOrder(self.CopyrightEditItem, + self.CopyrightInsertButton) + EditSongDialog.setTabOrder(self.CopyrightInsertButton, + self.CCLNumberEdit) EditSongDialog.setTabOrder(self.CCLNumberEdit, self.CommentsEdit) EditSongDialog.setTabOrder(self.CommentsEdit, self.ButtonBox) @@ -450,8 +465,7 @@ class Ui_EditSongDialog(object): translate(u'SongsPlugin.EditSongForm', u'&Add to Song')) self.AuthorRemoveButton.setText( translate(u'SongsPlugin.EditSongForm', u'&Remove')) - self.MaintenanceButton.setText( - translate(u'SongsPlugin.EditSongForm', + self.MaintenanceButton.setText(translate(u'SongsPlugin.EditSongForm', u'&Manage Authors, Topics, Books')) self.TopicGroupBox.setTitle( translate(u'SongsPlugin.EditSongForm', u'Topic')) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index f22928057..d23bcd298 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -437,12 +437,13 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if parts.endswith(u'\n'): parts = parts.rstrip(u'\n') item = QtGui.QTableWidgetItem(parts) - item.setData( - QtCore.Qt.UserRole, QtCore.QVariant(variant)) + item.setData(QtCore.Qt.UserRole, + QtCore.QVariant(variant)) self.VerseListWidget.setRowCount( self.VerseListWidget.rowCount() + 1) self.VerseListWidget.setItem( - int(self.VerseListWidget.rowCount() - 1), 0, item) + int(self.VerseListWidget.rowCount() - 1), + 0, item) self.VerseListWidget.setColumnWidth(0, self.width) self.VerseListWidget.resizeRowsToContents() self.VerseListWidget.repaint() @@ -483,10 +484,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): else: self.SongTabWidget.setCurrentIndex(0) self.VerseOrderEdit.setFocus() - return False, \ - translate(u'SongsPlugin.EditSongForm', - u'Invalid verse entry, values must be I,B,T,P,E,O,V,C ' - u'followed by a number') + return False, translate(u'SongsPlugin.EditSongForm', + u'Invalid verse entry, values must be I,B,T,P,E,O,V,C ' + u'followed by a number') return True, u'' def onTitleEditItemLostFocus(self): @@ -597,4 +597,3 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.song.search_title = self.song.search_title.replace(u'}', u'') self.song.search_title = self.song.search_title.replace(u'?', u'') - diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index c4d098671..d70d5c5b4 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -73,22 +73,16 @@ class Ui_EditVerseDialog(object): self.EditVerseLayout.addLayout(self.VerseTypeLayout) self.EditButtonBox = QtGui.QDialogButtonBox(EditVerseDialog) self.EditButtonBox.setOrientation(QtCore.Qt.Horizontal) - self.EditButtonBox.setStandardButtons( - QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Save) + self.EditButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | + QtGui.QDialogButtonBox.Save) self.EditButtonBox.setObjectName(u'EditButtonBox') self.EditVerseLayout.addWidget(self.EditButtonBox) self.retranslateUi(EditVerseDialog) - QtCore.QObject.connect( - self.EditButtonBox, - QtCore.SIGNAL(u'accepted()'), - EditVerseDialog.accept - ) - QtCore.QObject.connect( - self.EditButtonBox, - QtCore.SIGNAL(u'rejected()'), - EditVerseDialog.reject - ) + QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'accepted()'), + EditVerseDialog.accept) + QtCore.QObject.connect(self.EditButtonBox, QtCore.SIGNAL(u'rejected()'), + EditVerseDialog.reject) QtCore.QMetaObject.connectSlotsByName(EditVerseDialog) def retranslateUi(self, EditVerseDialog): @@ -96,14 +90,20 @@ class Ui_EditVerseDialog(object): translate(u'SongsPlugin.EditVerseForm', u'Edit Verse')) self.VerseTypeLabel.setText( translate(u'SongsPlugin.EditVerseForm', u'Verse Type:')) - self.VerseTypeComboBox.setItemText(0, VerseType.to_string(VerseType.Verse)) - self.VerseTypeComboBox.setItemText(1, VerseType.to_string(VerseType.Chorus)) - self.VerseTypeComboBox.setItemText(2, VerseType.to_string(VerseType.Bridge)) - self.VerseTypeComboBox.setItemText(3, VerseType.to_string(VerseType.PreChorus)) - self.VerseTypeComboBox.setItemText(4, VerseType.to_string(VerseType.Intro)) - self.VerseTypeComboBox.setItemText(5, VerseType.to_string(VerseType.Ending)) - self.VerseTypeComboBox.setItemText(6, VerseType.to_string(VerseType.Other)) + self.VerseTypeComboBox.setItemText(0, + VerseType.to_string(VerseType.Verse)) + self.VerseTypeComboBox.setItemText(1, + VerseType.to_string(VerseType.Chorus)) + self.VerseTypeComboBox.setItemText(2, + VerseType.to_string(VerseType.Bridge)) + self.VerseTypeComboBox.setItemText(3, + VerseType.to_string(VerseType.PreChorus)) + self.VerseTypeComboBox.setItemText(4, + VerseType.to_string(VerseType.Intro)) + self.VerseTypeComboBox.setItemText(5, + VerseType.to_string(VerseType.Ending)) + self.VerseTypeComboBox.setItemText(6, + VerseType.to_string(VerseType.Other)) self.InsertButton.setText( translate(u'SongsPlugin.EditVerseForm', u'Insert')) - diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index 9033267cd..56bb5de91 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -112,7 +112,8 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): tag=u'%s:1' % VerseType.to_string(VerseType.Verse)): if single: verse_type, verse_number = tag.split(u':') - self.VerseTypeComboBox.setCurrentIndex(VerseType.from_string(verse_type)) + self.VerseTypeComboBox.setCurrentIndex( + VerseType.from_string(verse_type)) self.VerseNumberBox.setValue(int(verse_number)) self.InsertButton.setVisible(False) else: @@ -133,6 +134,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def getVerseAll(self): text = self.VerseTextEdit.toPlainText() if not text.startsWith(u'---['): - text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), text) + text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), + text) return text diff --git a/openlp/plugins/songs/forms/songmaintenancedialog.py b/openlp/plugins/songs/forms/songmaintenancedialog.py index bb20dd6e0..81403bbe0 100644 --- a/openlp/plugins/songs/forms/songmaintenancedialog.py +++ b/openlp/plugins/songs/forms/songmaintenancedialog.py @@ -25,7 +25,7 @@ from PyQt4 import QtCore, QtGui -from openlp.core.lib import build_icon, translate +from openlp.core.lib import build_icon, translate class Ui_SongMaintenanceDialog(object): def setupUi(self, SongMaintenanceDialog): @@ -192,9 +192,11 @@ class Ui_SongMaintenanceDialog(object): self.TypeStackedWidget.addWidget(self.BooksPage) self.ContentLayout.addWidget(self.TypeStackedWidget) self.DialogLayout.addWidget(self.ContentWidget) - self.MaintenanceButtonBox = QtGui.QDialogButtonBox(SongMaintenanceDialog) + self.MaintenanceButtonBox = QtGui.QDialogButtonBox( + SongMaintenanceDialog) self.MaintenanceButtonBox.setOrientation(QtCore.Qt.Horizontal) - self.MaintenanceButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) + self.MaintenanceButtonBox.setStandardButtons( + QtGui.QDialogButtonBox.Close) self.MaintenanceButtonBox.setObjectName(u'MaintenanceButtonBox') self.DialogLayout.addWidget(self.MaintenanceButtonBox) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index 21908c26b..34388dd62 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -238,7 +238,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): translate(u'SongsPlugin.SongMaintenanceForm', u'This author can\'t be deleted, they are currently ' u'assigned to at least one song.'), - translate(u'SongsPlugin.SongMaintenanceForm', u'No author selected!')) + translate(u'SongsPlugin.SongMaintenanceForm', + u'No author selected!')) def onTopicDeleteButtonClick(self): """ @@ -253,7 +254,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): translate(u'SongsPlugin.SongMaintenanceForm', u'This topic can\'t be deleted, it is currently ' u'assigned to at least one song.'), - translate(u'SongsPlugin.SongMaintenanceForm', u'No topic selected!')) + translate(u'SongsPlugin.SongMaintenanceForm', + u'No topic selected!')) def onBookDeleteButtonClick(self): """ diff --git a/openlp/plugins/songs/lib/manager.py b/openlp/plugins/songs/lib/manager.py index 43b10aeec..0b833fb0b 100644 --- a/openlp/plugins/songs/lib/manager.py +++ b/openlp/plugins/songs/lib/manager.py @@ -96,8 +96,8 @@ class SongManager(object): settings = QtCore.QSettings() settings.beginGroup(u'songs') self.db_url = u'' - db_type = unicode( - settings.value(u'songs/db type', QtCore.QVariant(u'sqlite')).toString()) + db_type = unicode(settings.value(u'songs/db type', + QtCore.QVariant(u'sqlite')).toString()) if db_type == u'sqlite': self.db_url = u'sqlite:///%s/songs.sqlite' % \ AppLocation.get_section_data_path(u'songs') diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 6c1411ccc..67133f9c6 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -64,7 +64,6 @@ class SongMediaItem(MediaManagerItem): def requiredIcons(self): MediaManagerItem.requiredIcons(self) - self.hasFileIcon = False def addEndHeaderBar(self): self.addToolbarSeparator() diff --git a/openlp/plugins/songs/lib/oooimport.py b/openlp/plugins/songs/lib/oooimport.py index a2a75a872..6ef5d2f86 100644 --- a/openlp/plugins/songs/lib/oooimport.py +++ b/openlp/plugins/songs/lib/oooimport.py @@ -97,7 +97,7 @@ class OooImport(object): loop += 1 manager = ctx.ServiceManager self.desktop = manager.createInstanceWithContext( - "com.sun.star.frame.Desktop", ctx ) + "com.sun.star.frame.Desktop", ctx) def start_ooo_process(self): try: @@ -130,10 +130,9 @@ class OooImport(object): try: self.document = self.desktop.loadComponentFromURL(url, u'_blank', 0, properties) - if not self.document.supportsService( - "com.sun.star.presentation.PresentationDocument") \ - and not self.document.supportsService( - "com.sun.star.text.TextDocument"): + if not self.document.supportsService( + "com.sun.star.presentation.PresentationDocument") and not \ + self.document.supportsService("com.sun.star.text.TextDocument"): self.close_ooo_file() except: pass diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index f4dab9d20..b69a98adb 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -65,8 +65,8 @@ class SongsTab(SettingsTab): translate(u'SongsPlugin.SongsTab', u'Songs Mode')) self.SearchAsTypeCheckBox.setText( translate(u'SongsPlugin.SongsTab', u'Enable search as you type')) - self.SongBarActiveCheckBox.setText( - translate(u'SongsPlugin.SongsTab', u'Display Verses on Live Tool bar')) + self.SongBarActiveCheckBox.setText(translate(u'SongsPlugin.SongsTab', + u'Display Verses on Live Tool bar')) def onSearchAsTypeCheckBoxChanged(self, check_state): self.song_search = False diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index f13cf80ec..993b18bb9 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -27,7 +27,8 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, translate +from openlp.core.lib import Plugin, build_icon, PluginStatus, Receiver, \ + translate from openlp.plugins.songs.lib import SongManager, SongMediaItem, SongsTab, \ SofImport, OooImport diff --git a/openlp/plugins/songusage/forms/songusagedeleteform.py b/openlp/plugins/songusage/forms/songusagedeleteform.py index 92aad690b..87bca1832 100644 --- a/openlp/plugins/songusage/forms/songusagedeleteform.py +++ b/openlp/plugins/songusage/forms/songusagedeleteform.py @@ -54,3 +54,4 @@ class SongUsageDeleteForm(QtGui.QDialog, Ui_SongUsageDeleteDialog): deleteDate = self.DeleteCalendar.selectedDate().toPyDate() self.songusagemanager.delete_to_date(deleteDate) self.close() + diff --git a/openlp/plugins/songusage/forms/songusagedetaildialog.py b/openlp/plugins/songusage/forms/songusagedetaildialog.py index 4c67adfd8..ecad1c707 100644 --- a/openlp/plugins/songusage/forms/songusagedetaildialog.py +++ b/openlp/plugins/songusage/forms/songusagedetaildialog.py @@ -70,20 +70,19 @@ class Ui_SongUsageDetailDialog(object): self.verticalLayout_2.addWidget(self.FileGroupBox) self.verticalLayout.addWidget(self.DateRangeGroupBox) self.buttonBox = QtGui.QDialogButtonBox(SongUsageDetailDialog) - self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | + QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(u'buttonBox') self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(SongUsageDetailDialog) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'accepted()'), - SongUsageDetailDialog.accept) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'rejected()'), - SongUsageDetailDialog.close) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), + SongUsageDetailDialog.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), + SongUsageDetailDialog.close) QtCore.QObject.connect(self.SaveFilePushButton, - QtCore.SIGNAL(u'pressed()'), - SongUsageDetailDialog.defineOutputLocation) + QtCore.SIGNAL(u'pressed()'), + SongUsageDetailDialog.defineOutputLocation) QtCore.QMetaObject.connectSlotsByName(SongUsageDetailDialog) def retranslateUi(self, SongUsageDetailDialog): From 6792a4cce73139b28a596489e025eac85de0c866 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Tue, 8 Jun 2010 16:56:47 +0100 Subject: [PATCH 17/17] Couple more whitespace cleanups --- openlp/core/ui/serviceitemeditform.py | 29 +++++++++++---------------- openlp/core/ui/servicenoteform.py | 11 +++++----- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/openlp/core/ui/serviceitemeditform.py b/openlp/core/ui/serviceitemeditform.py index 9df8088c8..eddf064e9 100644 --- a/openlp/core/ui/serviceitemeditform.py +++ b/openlp/core/ui/serviceitemeditform.py @@ -38,21 +38,16 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): self.setupUi(self) self.itemList = [] # enable drop - QtCore.QObject.connect(self.upButton, - QtCore.SIGNAL(u'clicked()'), - self.onItemUp) - QtCore.QObject.connect(self.downButton, - QtCore.SIGNAL(u'clicked()'), - self.onItemDown) - QtCore.QObject.connect(self.deleteButton, - QtCore.SIGNAL(u'clicked()'), - self.onItemDelete) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'accepted()'), - self.accept) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'rejected()'), - self.reject) + QtCore.QObject.connect(self.upButton, QtCore.SIGNAL(u'clicked()'), + self.onItemUp) + QtCore.QObject.connect(self.downButton, QtCore.SIGNAL(u'clicked()'), + self.onItemDown) + QtCore.QObject.connect(self.deleteButton, QtCore.SIGNAL(u'clicked()'), + self.onItemDelete) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), + self.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), + self.reject) def setServiceItem(self, item): self.item = item @@ -68,8 +63,8 @@ class ServiceItemEditForm(QtGui.QDialog, Ui_ServiceItemEditDialog): self.item._raw_frames = [] if self.item.is_image(): for item in self.itemList: - self.item.add_from_image(item[u'path'], - item[u'title'], item[u'image']) + self.item.add_from_image(item[u'path'], item[u'title'], + item[u'image']) self.item.render() return self.item diff --git a/openlp/core/ui/servicenoteform.py b/openlp/core/ui/servicenoteform.py index 6dfdf0b03..2dd19b242 100644 --- a/openlp/core/ui/servicenoteform.py +++ b/openlp/core/ui/servicenoteform.py @@ -24,6 +24,7 @@ ############################################################################### from PyQt4 import QtCore, QtGui + from servicenotedialog import Ui_ServiceNoteEdit class ServiceNoteForm(QtGui.QDialog, Ui_ServiceNoteEdit): @@ -36,9 +37,7 @@ class ServiceNoteForm(QtGui.QDialog, Ui_ServiceNoteEdit): """ QtGui.QDialog.__init__(self, parent) self.setupUi(self) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'accepted()'), - self.accept) - QtCore.QObject.connect(self.buttonBox, - QtCore.SIGNAL(u'rejected()'), - self.reject) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'accepted()'), + self.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), + self.reject)