From 0d498bc3f09f8bc28d39aa56b86a5f1e80761be5 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 18 Feb 2011 01:07:55 +0000 Subject: [PATCH] UiStrings --- openlp/core/lib/ui.py | 4 +++- openlp/core/ui/generaltab.py | 4 ++-- openlp/core/ui/printserviceorderdialog.py | 2 +- openlp/core/ui/themeform.py | 2 +- openlp/core/ui/thememanager.py | 5 ++--- openlp/core/ui/themewizard.py | 8 ++++---- openlp/plugins/songs/forms/editsongdialog.py | 6 ++---- openlp/plugins/songs/songsplugin.py | 4 ++-- 8 files changed, 17 insertions(+), 18 deletions(-) diff --git a/openlp/core/lib/ui.py b/openlp/core/lib/ui.py index e77ad2f10..006e2c9f5 100644 --- a/openlp/core/lib/ui.py +++ b/openlp/core/lib/ui.py @@ -45,7 +45,8 @@ class UiStrings(object): Advanced = translate('OpenLP.Ui', 'Advanced') AllFiles = translate('OpenLP.Ui', 'All Files') Browse = translate('OpenLP.Ui', 'Browse...') - Authors = translate('OpenLP.Ui', 'Authors') + Cancel = translate('OpenLP.Ui', 'Cancel') + CCLINumberLabel = translate('OpenLP.Ui', 'CCLI number:') CreateService = translate('OpenLP.Ui', 'Create a new service.') Delete = translate('OpenLP.Ui', '&Delete') Edit = translate('OpenLP.Ui', '&Edit') @@ -63,6 +64,7 @@ class UiStrings(object): Load = translate('OpenLP.Ui', 'Load') New = translate('OpenLP.Ui', 'New') NewService = translate('OpenLP.Ui', 'New Service') + NewTheme = translate('OpenLP.Ui', 'New Theme') NFSs = translate('OpenLP.Ui', 'No File Selected', 'Singular') NFSp = translate('OpenLP.Ui', 'No Files Selected', 'Plural') NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular') diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 12353fed8..2b95088ab 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -28,6 +28,7 @@ import logging from PyQt4 import QtCore, QtGui from openlp.core.lib import SettingsTab, Receiver, translate +from openlp.core.lib.ui import UiStrings log = logging.getLogger(__name__) @@ -267,8 +268,7 @@ class GeneralTab(SettingsTab): translate('OpenLP.GeneralTab', ' sec')) self.ccliGroupBox.setTitle( translate('OpenLP.GeneralTab', 'CCLI Details')) - self.numberLabel.setText( - translate('OpenLP.GeneralTab', 'CCLI number:')) + self.numberLabel.setText(UiStrings.CCLINumberLabel) self.usernameLabel.setText( translate('OpenLP.GeneralTab', 'SongSelect username:')) self.passwordLabel.setText( diff --git a/openlp/core/ui/printserviceorderdialog.py b/openlp/core/ui/printserviceorderdialog.py index 22f8e9292..c27035fda 100644 --- a/openlp/core/ui/printserviceorderdialog.py +++ b/openlp/core/ui/printserviceorderdialog.py @@ -132,6 +132,6 @@ class Ui_PrintServiceOrderDialog(object): self.serviceTitleLineEdit.setText(translate('OpenLP.ServiceManager', 'Service Order Sheet')) self.printButton.setText(translate('OpenLP.ServiceManager', 'Print')) - self.cancelButton.setText(translate('OpenLP.ServiceManager', 'Cancel')) + self.cancelButton.setText(UiStrings.Cancel) self.customNotesLabel.setText( translate('OpenLP.ServiceManager', 'Custom Service Notes:')) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index f34e2b8d2..1b6d8d524 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -301,7 +301,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard): 'Edit Theme - %s')) % self.theme.theme_name) self.next() else: - self.setWindowTitle(translate('OpenLP.ThemeWizard', 'New Theme')) + self.setWindowTitle(UiStrings.NewTheme) return QtGui.QWizard.exec_(self) def initializePage(self, id): diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 5c996f688..981058408 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -36,7 +36,7 @@ from openlp.core.lib import OpenLPToolbar, ThemeXML, get_text_file_string, \ build_icon, Receiver, SettingsManager, translate, check_item_selected, \ BackgroundType, BackgroundGradientType, check_directory_exists, \ VerticalType -from openlp.core.lib.ui import critical_error_message_box +from openlp.core.lib.ui import UiStrings, critical_error_message_box from openlp.core.theme import Theme from openlp.core.ui import FileRenameForm, ThemeForm from openlp.core.utils import AppLocation, delete_file, file_is_unicode, \ @@ -62,8 +62,7 @@ class ThemeManager(QtGui.QWidget): self.layout.setMargin(0) self.layout.setObjectName(u'layout') self.toolbar = OpenLPToolbar(self) - self.toolbar.addToolbarButton( - translate('OpenLP.ThemeManager', 'New Theme'), + self.toolbar.addToolbarButton(UiStrings.NewTheme, u':/themes/theme_new.png', translate('OpenLP.ThemeManager', 'Create a new theme.'), self.onAddTheme) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index fc25e11fa..c968db821 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -448,17 +448,17 @@ class Ui_ThemeWizard(object): self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.mainSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.lineSpacingLabel.setText( translate('OpenLP.ThemeWizard', 'Line Spacing:')) - self.lineSpacingSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.lineSpacingSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.outlineCheckBox.setText( translate('OpenLP.ThemeWizard', '&Outline:')) self.outlineSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.outlineSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.outlineSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) + self.shadowSizeSpinBox.setSuffix(UiStrings.FontSizePtUnit) self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold')) self.mainItalicsCheckBox.setText( translate('OpenLP.ThemeWizard', 'Italic')) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 491f4fa74..bcc075574 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -292,10 +292,8 @@ class Ui_EditSongDialog(object): translate('SongsPlugin.EditSongForm', 'New &Theme')) self.rightsGroupBox.setTitle( translate('SongsPlugin.EditSongForm', 'Copyright Information')) - self.copyrightInsertButton.setText( - translate('SongsPlugin.EditSongForm', '\xa9')) - self.CCLILabel.setText( - translate('SongsPlugin.EditSongForm', 'CCLI number:')) + self.copyrightInsertButton.setText(SongStrings.CopyrightSymbol) + self.CCLILabel.setText(UiStrings.CCLINumberLabel) self.commentsGroupBox.setTitle( translate('SongsPlugin.EditSongForm', 'Comments')) self.songTabWidget.setTabText( diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index 887ddb7b2..bf33cd56e 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -31,6 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib.db import Manager +from openlp.core.lib.ui import UiStrings from openlp.plugins.songs.lib import SongMediaItem, SongsTab, SongXML from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.importer import SongFormat @@ -137,8 +138,7 @@ class SongsPlugin(Plugin): """ maxSongs = self.manager.get_object_count(Song) progressDialog = QtGui.QProgressDialog( - translate('SongsPlugin', 'Reindexing songs...'), - translate('SongsPlugin', 'Cancel'), + translate('SongsPlugin', 'Reindexing songs...'), UiStrings.Cancel, 0, maxSongs + 1, self.formparent) progressDialog.setWindowModality(QtCore.Qt.WindowModal) songs = self.manager.get_all_objects(Song)