Hopefully the last of the string fixes.

This commit is contained in:
Raoul Snyman 2010-07-23 21:17:36 +02:00
parent 3c303365b1
commit 651ee535f6
19 changed files with 4905 additions and 4995 deletions

View File

@ -31,9 +31,6 @@ class SplashScreen(object):
def __init__(self, version):
self.splash_screen = QtGui.QSplashScreen()
self.setupUi()
self.message = translate(
'Splashscreen', 'Starting')\
+ '..... ' + version
def setupUi(self):
self.splash_screen.setObjectName(u'splash_screen')
@ -48,25 +45,15 @@ class SplashScreen(object):
self.splash_screen.sizePolicy().hasHeightForWidth())
self.splash_screen.setSizePolicy(sizePolicy)
self.splash_screen.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
icon = build_icon(u':/icon/openlp-logo-16x16.png')
self.splash_screen.setWindowIcon(icon)
splash_image = QtGui.QPixmap(u':/graphics/openlp-splash-screen.png')
self.splash_screen.setPixmap(splash_image)
self.splash_screen.setMask(splash_image.mask())
self.splash_screen.setWindowFlags(
QtCore.Qt.SplashScreen | QtCore.Qt.WindowStaysOnTopHint)
self.retranslateUi()
QtCore.QMetaObject.connectSlotsByName(self.splash_screen)
def retranslateUi(self):
self.splash_screen.setWindowTitle(
translate('Splashscreen', 'Splash Screen'))
def show(self):
self.splash_screen.show()
self.splash_screen.showMessage(self.message,
QtCore.Qt.AlignLeft | QtCore.Qt.AlignBottom, QtCore.Qt.black)
self.splash_screen.repaint()
def finish(self, widget):
self.splash_screen.finish(widget)

View File

@ -55,25 +55,31 @@ 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('OpenLP.ThemeManager', 'New Theme'),
u':/themes/theme_new.png',
translate('OpenLP.ThemeManager', 'Create a new theme.'),
self.onAddTheme)
self.Toolbar.addToolbarButton(
translate('ThemeManager', 'Edit Theme'),
translate('OpenLP.ThemeManager', 'Edit Theme'),
u':/themes/theme_edit.png',
translate('ThemeManager', 'Edit a theme.'), self.onEditTheme)
translate('OpenLP.ThemeManager', 'Edit a theme.'),
self.onEditTheme)
self.Toolbar.addToolbarButton(
translate('ThemeManager', 'Delete Theme'),
translate('OpenLP.ThemeManager', 'Delete Theme'),
u':/general/general_delete.png',
translate('ThemeManager', 'Delete a theme.'), self.onDeleteTheme)
translate('OpenLP.ThemeManager', 'Delete a theme.'),
self.onDeleteTheme)
self.Toolbar.addSeparator()
self.Toolbar.addToolbarButton(
translate('ThemeManager', 'Import Theme'),
translate('OpenLP.ThemeManager', 'Import Theme'),
u':/general/general_import.png',
translate('ThemeManager', 'Import a theme.'), self.onImportTheme)
translate('OpenLP.ThemeManager', 'Import a theme.'),
self.onImportTheme)
self.Toolbar.addToolbarButton(
translate('ThemeManager', 'Export Theme'),
translate('OpenLP.ThemeManager', 'Export Theme'),
u':/general/general_export.png',
translate('ThemeManager', 'Export a theme.'), self.onExportTheme)
translate('OpenLP.ThemeManager', 'Export a theme.'),
self.onExportTheme)
self.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
self.Layout.addWidget(self.Toolbar)
self.ThemeListWidget = QtGui.QListWidget(self)
@ -84,23 +90,24 @@ class ThemeManager(QtGui.QWidget):
self.ThemeListWidget.addAction(
context_menu_action(self.ThemeListWidget,
u':/themes/theme_edit.png',
translate('ThemeManager', '&Edit Theme'), self.onEditTheme))
translate('OpenLP.ThemeManager', '&Edit Theme'),
self.onEditTheme))
self.ThemeListWidget.addAction(
context_menu_separator(self.ThemeListWidget))
self.ThemeListWidget.addAction(
context_menu_action(self.ThemeListWidget,
u':/general/general_delete.png',
translate('ThemeManager', '&Delete Theme'),
translate('OpenLP.ThemeManager', '&Delete Theme'),
self.onDeleteTheme))
self.ThemeListWidget.addAction(
context_menu_action(self.ThemeListWidget,
u':/general/general_export.png',
translate('ThemeManager', 'Set As &Global Default'),
translate('OpenLP.ThemeManager', 'Set As &Global Default'),
self.changeGlobalFromScreen))
self.ThemeListWidget.addAction(
context_menu_action(self.ThemeListWidget,
u':/general/general_export.png',
translate('ThemeManager', 'E&xport Theme'),
translate('OpenLP.ThemeManager', 'E&xport Theme'),
self.onExportTheme))
self.ThemeListWidget.addAction(
context_menu_separator(self.ThemeListWidget))
@ -139,8 +146,8 @@ class ThemeManager(QtGui.QWidget):
self.ThemeListWidget.item(count).setText(newName)
#Set the new name
if themeName == newName:
name = unicode(translate('ThemeManager', '%s (default)')) % \
newName
name = unicode(translate('OpenLP.ThemeManager',
'%s (default)')) % newName
self.ThemeListWidget.item(count).setText(name)
def changeGlobalFromScreen(self, index = -1):
@ -161,13 +168,14 @@ class ThemeManager(QtGui.QWidget):
if count == selected_row:
self.global_theme = unicode(
self.ThemeListWidget.item(count).text())
name = unicode(translate('ThemeManager', '%s (default)')) % \
self.global_theme
name = unicode(translate('OpenLP.ThemeManager',
'%s (default)')) % self.global_theme
self.ThemeListWidget.item(count).setText(name)
QtCore.QSettings().setValue(
self.settingsSection + u'/global theme',
QtCore.QVariant(self.global_theme))
Receiver.send_message(u'theme_update_global', self.global_theme)
Receiver.send_message(u'theme_update_global',
self.global_theme)
self.pushThemes()
def onAddTheme(self):
@ -185,7 +193,8 @@ class ThemeManager(QtGui.QWidget):
Loads the settings for the theme that is to be edited and launches the
theme editing form so the user can make their changes.
"""
if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
if check_item_selected(self.ThemeListWidget,
translate('OpenLP.ThemeManager',
'You must select a theme to edit.')):
item = self.ThemeListWidget.currentItem()
themeName = unicode(item.text())
@ -207,14 +216,15 @@ class ThemeManager(QtGui.QWidget):
self.global_theme = unicode(QtCore.QSettings().value(
self.settingsSection + u'/global theme',
QtCore.QVariant(u'')).toString())
if check_item_selected(self.ThemeListWidget, translate('ThemeManager',
if check_item_selected(self.ThemeListWidget,
translate('OpenLP.ThemeManager',
'You must select a theme to delete.')):
item = self.ThemeListWidget.currentItem()
theme = unicode(item.text())
# confirm deletion
answer = QtGui.QMessageBox.question(self,
translate('ThemeManager', 'Delete Confirmation'),
translate('ThemeManager', 'Delete theme?'),
translate('OpenLP.ThemeManager', 'Delete Confirmation'),
translate('OpenLP.ThemeManager', 'Delete theme?'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No), QtGui.QMessageBox.No)
if answer == QtGui.QMessageBox.No:
@ -222,24 +232,24 @@ 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',
translate('OpenLP.ThemeManager', 'Error'),
translate('OpenLP.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 plugin.usesTheme(theme):
QtGui.QMessageBox.critical(self,
translate('ThemeManager', 'Error'),
unicode(translate('ThemeManager',
translate('OpenLP.ThemeManager', 'Error'),
unicode(translate('OpenLP.ThemeManager',
'Theme %s is use in %s plugin.')) % \
(theme, plugin.name))
return
if unicode(self.serviceComboBox.currentText()) == theme:
QtGui.QMessageBox.critical(self,
translate('ThemeManager', 'Error'),
unicode(translate('ThemeManager',
'Theme %s is use by the service manager.')) % theme)
translate('OpenLP.ThemeManager', 'Error'),
unicode(translate('OpenLP.ThemeManager',
'Theme %s is use by the service manager.')) % theme)
return
row = self.ThemeListWidget.row(item)
self.ThemeListWidget.takeItem(row)
@ -273,12 +283,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.'))
translate('OpenLP.ThemeManager', 'Error'),
translate('OpenLP.ThemeManager',
'You have not selected a theme.'))
return
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
path = QtGui.QFileDialog.getExistingDirectory(self,
unicode(translate('ThemeManager', 'Save Theme - (%s)')) % theme,
unicode(translate('OpenLP.ThemeManager',
'Save Theme - (%s)')) % theme,
SettingsManager.get_last_dir(self.settingsSection, 1))
path = unicode(path)
if path:
@ -294,14 +306,14 @@ class ThemeManager(QtGui.QWidget):
os.path.join(source, name).encode(u'utf-8'),
os.path.join(theme, name).encode(u'utf-8'))
QtGui.QMessageBox.information(self,
translate('ThemeManager', 'Theme Exported'),
translate('ThemeManager',
translate('OpenLP.ThemeManager', 'Theme Exported'),
translate('OpenLP.ThemeManager',
'Your theme has been successfully exported.'))
except (IOError, OSError):
log.exception(u'Export Theme Failed')
QtGui.QMessageBox.critical(self,
translate('ThemeManager', 'Theme Export Failed'),
translate('ThemeManager',
translate('OpenLP.ThemeManager', 'Theme Export Failed'),
translate('OpenLP.ThemeManager',
'Your theme could not be exported due to an error.'))
finally:
if zip:
@ -314,9 +326,9 @@ class ThemeManager(QtGui.QWidget):
will load both OpenLP version 1 and version 2 themes.
"""
files = QtGui.QFileDialog.getOpenFileNames(self,
translate('ThemeManager', 'Select Theme Import File'),
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
SettingsManager.get_last_dir(self.settingsSection),
translate('ThemeManager', 'Theme (*.*)'))
translate('OpenLP.ThemeManager', 'Theme (*.*)'))
log.info(u'New Themes %s', unicode(files))
if files:
for file in files:
@ -343,7 +355,7 @@ class ThemeManager(QtGui.QWidget):
if os.path.exists(theme):
textName = os.path.splitext(name)[0]
if textName == self.global_theme:
name = unicode(translate('ThemeManager',
name = unicode(translate('OpenLP.ThemeManager',
'%s (default)')) % textName
else:
name = textName
@ -419,8 +431,9 @@ class ThemeManager(QtGui.QWidget):
ucsfile = file.decode(u'utf-8')
except UnicodeDecodeError:
QtGui.QMessageBox.critical(
self, translate('ThemeManager', 'Error'),
translate('ThemeManager', 'File is not a valid theme.\n'
self, translate('OpenLP.ThemeManager', 'Error'),
translate('OpenLP.ThemeManager',
'File is not a valid theme.\n'
'The content encoding is not UTF-8.'))
log.exception(u'Filename "%s" is not valid UTF-8' %
file.decode(u'utf-8', u'replace'))
@ -464,15 +477,16 @@ class ThemeManager(QtGui.QWidget):
self.generateAndSaveImage(dir, themename, filexml)
else:
QtGui.QMessageBox.critical(self,
translate('ThemeManager', 'Error'),
translate('ThemeManager', 'File is not a valid theme.'))
log.exception(u'Theme file dosen\'t contain XML data %s' %
translate('OpenLP.ThemeManager', 'Error'),
translate('OpenLP.ThemeManager',
'File is not a valid theme.'))
log.exception(u'Theme file does not contain XML data %s' %
filename)
except (IOError, NameError):
QtGui.QMessageBox.critical(self,
translate('ThemeManager', 'Error'),
translate('ThemeManager', 'File is not a valid theme.'))
log.exception(u'Importing theme from zip file failed %s' % filename)
translate('OpenLP.ThemeManager', 'Error'),
translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
log.exception(u'Importing theme from zip failed %s' % filename)
finally:
if zip:
zip.close()
@ -536,7 +550,8 @@ class ThemeManager(QtGui.QWidget):
vAlignCorrection = 1
elif theme.VerticalAlign == 1:
vAlignCorrection = 2
newtheme.add_display(unicode(shadow), unicode(theme.ShadowColor.name()),
newtheme.add_display(unicode(shadow),
unicode(theme.ShadowColor.name()),
unicode(outline), unicode(theme.OutlineColor.name()),
unicode(theme.HorizontalAlign), unicode(vAlignCorrection),
unicode(theme.WrapStyle), unicode(0))
@ -559,8 +574,9 @@ 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 '
translate('OpenLP.ThemeManager', 'Theme Exists'),
translate('OpenLP.ThemeManager',
'A theme with this name already '
'exists. Would you like to overwrite it?'),
(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
QtGui.QMessageBox.No)
@ -611,7 +627,7 @@ class ThemeManager(QtGui.QWidget):
newThemeItem).row()
self.global_theme = unicode(
self.ThemeListWidget.item(newThemeIndex).text())
newName = unicode(translate('ThemeManager',
newName = unicode(translate('OpenLP.ThemeManager',
'%s (default)')) % self.global_theme
self.ThemeListWidget.item(newThemeIndex).setText(newName)
QtCore.QSettings().setValue(
@ -665,14 +681,15 @@ class ThemeManager(QtGui.QWidget):
"""
log.debug(u'base theme created')
newtheme = ThemeXML()
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')
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
unicode(12), u'False', u'footer')
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0), u'False')
newtheme.new_document(
unicode(translate('OpenLP.ThemeManager', 'New Theme')))
newtheme.add_background_solid(u'#000000')
newtheme.add_font(unicode(QtGui.QFont().family()), u'#FFFFFF',
u'30', u'False')
newtheme.add_font(unicode(QtGui.QFont().family()), u'#FFFFFF',
u'12', u'False', u'footer')
newtheme.add_display(u'False', u'#FFFFFF', u'False',
unicode(u'#FFFFFF'), u'0', u'0', u'0', u'False')
return newtheme.extract_xml()
def createThemeFromXml(self, theme_xml, path):

View File

@ -37,7 +37,7 @@ class ThemesTab(SettingsTab):
def setupUi(self):
self.setObjectName(u'ThemesTab')
self.tabTitleVisible = translate('ThemesTab', 'Themes')
self.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes')
self.ThemesTabLayout = QtGui.QHBoxLayout(self)
self.ThemesTabLayout.setSpacing(8)
self.ThemesTabLayout.setMargin(8)
@ -106,26 +106,28 @@ 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.GlobalGroupBox.setTitle(
translate('OpenLP.ThemesTab', 'Global Theme'))
self.LevelGroupBox.setTitle(
translate('OpenLP.ThemesTab', 'Theme Level'))
self.SongLevelRadioButton.setText(
translate('ThemesTab', 'S&ong Level'))
translate('OpenLP.ThemesTab', 'S&ong Level'))
self.SongLevelLabel.setText(
translate('ThemesTab', 'Use the theme from each song '
translate('OpenLP.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'))
translate('OpenLP.ThemesTab', '&Service Level'))
self.ServiceLevelLabel.setText(
translate('ThemesTab', 'Use the theme from the service, '
translate('OpenLP.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'))
translate('OpenLP.ThemesTab', '&Global Level'))
self.GlobalLevelLabel.setText(
translate('ThemesTab', 'Use the global theme, overriding any '
'themes associated with either the service or the songs.'))
translate('OpenLP.ThemesTab', 'Use the global theme, overriding '
'any themes associated with either the service or the songs.'))
def load(self):
settings = QtCore.QSettings()

View File

@ -407,11 +407,11 @@ class Ui_EditSongDialog(object):
self.TitleLabel.setText(
translate('SongsPlugin.EditSongForm', '&Title:'))
self.AlternativeTitleLabel.setText(
translate('SongsPlugin.EditSongForm', 'Alt&ernate Title:'))
translate('SongsPlugin.EditSongForm', 'Alt&ernate title:'))
self.LyricsLabel.setText(
translate('SongsPlugin.EditSongForm', '&Lyrics:'))
self.VerseOrderLabel.setText(
translate('SongsPlugin.EditSongForm', '&Verse Order:'))
translate('SongsPlugin.EditSongForm', '&Verse order:'))
self.VerseAddButton.setText(
translate('SongsPlugin.EditSongForm', '&Add'))
self.VerseEditButton.setText(
@ -452,7 +452,7 @@ class Ui_EditSongDialog(object):
self.CopyrightInsertButton.setText(
translate('SongsPlugin.EditSongForm', '\xa9'))
self.CCLILabel.setText(
translate('SongsPlugin.EditSongForm', 'CCLI Number:'))
translate('SongsPlugin.EditSongForm', 'CCLI number:'))
self.CommentsGroupBox.setTitle(
translate('SongsPlugin.EditSongForm', 'Comments'))
self.SongTabWidget.setTabText(

View File

@ -93,19 +93,19 @@ class VerseType(object):
The type to return a string for
"""
if verse_type == VerseType.Verse:
return translate('VerseType', 'Verse')
return translate('SongsPlugin.VerseType', 'Verse')
elif verse_type == VerseType.Chorus:
return translate('VerseType', 'Chorus')
return translate('SongsPlugin.VerseType', 'Chorus')
elif verse_type == VerseType.Bridge:
return translate('VerseType', 'Bridge')
return translate('SongsPlugin.VerseType', 'Bridge')
elif verse_type == VerseType.PreChorus:
return translate('VerseType', 'Pre-Chorus')
return translate('SongsPlugin.VerseType', 'Pre-Chorus')
elif verse_type == VerseType.Intro:
return translate('VerseType', 'Intro')
return translate('SongsPlugin.VerseType', 'Intro')
elif verse_type == VerseType.Ending:
return translate('VerseType', 'Ending')
return translate('SongsPlugin.VerseType', 'Ending')
elif verse_type == VerseType.Other:
return translate('VerseType', 'Other')
return translate('SongsPlugin.VerseType', 'Other')
@staticmethod
def from_string(verse_type):

View File

@ -209,9 +209,7 @@ class SongMediaItem(MediaManagerItem):
self.listView.clear()
for author in searchresults:
for song in author.songs:
song_detail = unicode(
translate('SongsPlugin.MediaItem', '%s (%s)')) % \
(author.display_name, song.title)
song_detail = '%s (%s)' % (author.display_name, song.title)
song_name = QtGui.QListWidgetItem(song_detail)
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
self.listView.addItem(song_name)
@ -270,7 +268,8 @@ class SongMediaItem(MediaManagerItem):
"""
Edit a song
"""
if check_item_selected(self.listView, translate('SongsPlugin.MediaItem',
if check_item_selected(self.listView,
translate('SongsPlugin.MediaItem',
'You must select an item to edit.')):
item = self.listView.currentItem()
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
@ -281,18 +280,19 @@ class SongMediaItem(MediaManagerItem):
"""
Remove a song from the list and database
"""
if check_item_selected(self.listView, translate('SongsPlugin.MediaItem',
if check_item_selected(self.listView,
translate('SongsPlugin.MediaItem',
'You must select an item to delete.')):
items = self.listView.selectedIndexes()
if len(items) == 1:
del_message = translate('SongsPlugin.MediaItem',
'Delete song?')
'Are you sure you want to delete the selected song?')
else:
del_message = unicode(
translate('SongsPlugin.MediaItem',
'Delete %d songs?')) % len(items)
del_message = unicode(translate('SongsPlugin.MediaItem',
'Are you sure you want to delete the %d selected '
'songs?')) % len(items)
ans = QtGui.QMessageBox.question(self,
translate('SongsPlugin.MediaItem', 'Delete Confirmation'),
translate('SongsPlugin.MediaItem', 'Delete Song(s)?'),
del_message,
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok|
QtGui.QMessageBox.Cancel),

View File

@ -66,7 +66,7 @@ class SongsTab(SettingsTab):
self.SearchAsTypeCheckBox.setText(
translate('SongsPlugin.SongsTab', 'Enable search as you type'))
self.SongBarActiveCheckBox.setText(translate('SongsPlugin.SongsTab',
'Display Verses on Live Tool bar'))
'Display verses on live tool bar'))
def onSearchAsTypeCheckBoxChanged(self, check_state):
self.song_search = False

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff