From 2c1f1f9455a98270ddeb4ffe41796f88b673045b Mon Sep 17 00:00:00 2001 From: Frode Woldsund Date: Sun, 6 Jun 2010 13:34:35 +0200 Subject: [PATCH] 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(