forked from openlp/openlp
Hopefully the last of the string fixes.
This commit is contained in:
parent
3c303365b1
commit
651ee535f6
@ -31,9 +31,6 @@ class SplashScreen(object):
|
|||||||
def __init__(self, version):
|
def __init__(self, version):
|
||||||
self.splash_screen = QtGui.QSplashScreen()
|
self.splash_screen = QtGui.QSplashScreen()
|
||||||
self.setupUi()
|
self.setupUi()
|
||||||
self.message = translate(
|
|
||||||
'Splashscreen', 'Starting')\
|
|
||||||
+ '..... ' + version
|
|
||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.splash_screen.setObjectName(u'splash_screen')
|
self.splash_screen.setObjectName(u'splash_screen')
|
||||||
@ -48,25 +45,15 @@ class SplashScreen(object):
|
|||||||
self.splash_screen.sizePolicy().hasHeightForWidth())
|
self.splash_screen.sizePolicy().hasHeightForWidth())
|
||||||
self.splash_screen.setSizePolicy(sizePolicy)
|
self.splash_screen.setSizePolicy(sizePolicy)
|
||||||
self.splash_screen.setContextMenuPolicy(QtCore.Qt.PreventContextMenu)
|
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')
|
splash_image = QtGui.QPixmap(u':/graphics/openlp-splash-screen.png')
|
||||||
self.splash_screen.setPixmap(splash_image)
|
self.splash_screen.setPixmap(splash_image)
|
||||||
self.splash_screen.setMask(splash_image.mask())
|
self.splash_screen.setMask(splash_image.mask())
|
||||||
self.splash_screen.setWindowFlags(
|
self.splash_screen.setWindowFlags(
|
||||||
QtCore.Qt.SplashScreen | QtCore.Qt.WindowStaysOnTopHint)
|
QtCore.Qt.SplashScreen | QtCore.Qt.WindowStaysOnTopHint)
|
||||||
self.retranslateUi()
|
|
||||||
QtCore.QMetaObject.connectSlotsByName(self.splash_screen)
|
QtCore.QMetaObject.connectSlotsByName(self.splash_screen)
|
||||||
|
|
||||||
def retranslateUi(self):
|
|
||||||
self.splash_screen.setWindowTitle(
|
|
||||||
translate('Splashscreen', 'Splash Screen'))
|
|
||||||
|
|
||||||
def show(self):
|
def show(self):
|
||||||
self.splash_screen.show()
|
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):
|
def finish(self, widget):
|
||||||
self.splash_screen.finish(widget)
|
self.splash_screen.finish(widget)
|
||||||
|
@ -55,25 +55,31 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.amendThemeForm = AmendThemeForm(self)
|
self.amendThemeForm = AmendThemeForm(self)
|
||||||
self.Toolbar = OpenLPToolbar(self)
|
self.Toolbar = OpenLPToolbar(self)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
translate('ThemeManager', 'New Theme'), u':/themes/theme_new.png',
|
translate('OpenLP.ThemeManager', 'New Theme'),
|
||||||
translate('ThemeManager', 'Create a new theme.'), self.onAddTheme)
|
u':/themes/theme_new.png',
|
||||||
|
translate('OpenLP.ThemeManager', 'Create a new theme.'),
|
||||||
|
self.onAddTheme)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
translate('ThemeManager', 'Edit Theme'),
|
translate('OpenLP.ThemeManager', 'Edit Theme'),
|
||||||
u':/themes/theme_edit.png',
|
u':/themes/theme_edit.png',
|
||||||
translate('ThemeManager', 'Edit a theme.'), self.onEditTheme)
|
translate('OpenLP.ThemeManager', 'Edit a theme.'),
|
||||||
|
self.onEditTheme)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
translate('ThemeManager', 'Delete Theme'),
|
translate('OpenLP.ThemeManager', 'Delete Theme'),
|
||||||
u':/general/general_delete.png',
|
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.addSeparator()
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
translate('ThemeManager', 'Import Theme'),
|
translate('OpenLP.ThemeManager', 'Import Theme'),
|
||||||
u':/general/general_import.png',
|
u':/general/general_import.png',
|
||||||
translate('ThemeManager', 'Import a theme.'), self.onImportTheme)
|
translate('OpenLP.ThemeManager', 'Import a theme.'),
|
||||||
|
self.onImportTheme)
|
||||||
self.Toolbar.addToolbarButton(
|
self.Toolbar.addToolbarButton(
|
||||||
translate('ThemeManager', 'Export Theme'),
|
translate('OpenLP.ThemeManager', 'Export Theme'),
|
||||||
u':/general/general_export.png',
|
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.ThemeWidget = QtGui.QWidgetAction(self.Toolbar)
|
||||||
self.Layout.addWidget(self.Toolbar)
|
self.Layout.addWidget(self.Toolbar)
|
||||||
self.ThemeListWidget = QtGui.QListWidget(self)
|
self.ThemeListWidget = QtGui.QListWidget(self)
|
||||||
@ -84,23 +90,24 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
context_menu_action(self.ThemeListWidget,
|
context_menu_action(self.ThemeListWidget,
|
||||||
u':/themes/theme_edit.png',
|
u':/themes/theme_edit.png',
|
||||||
translate('ThemeManager', '&Edit Theme'), self.onEditTheme))
|
translate('OpenLP.ThemeManager', '&Edit Theme'),
|
||||||
|
self.onEditTheme))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
context_menu_separator(self.ThemeListWidget))
|
context_menu_separator(self.ThemeListWidget))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
context_menu_action(self.ThemeListWidget,
|
context_menu_action(self.ThemeListWidget,
|
||||||
u':/general/general_delete.png',
|
u':/general/general_delete.png',
|
||||||
translate('ThemeManager', '&Delete Theme'),
|
translate('OpenLP.ThemeManager', '&Delete Theme'),
|
||||||
self.onDeleteTheme))
|
self.onDeleteTheme))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
context_menu_action(self.ThemeListWidget,
|
context_menu_action(self.ThemeListWidget,
|
||||||
u':/general/general_export.png',
|
u':/general/general_export.png',
|
||||||
translate('ThemeManager', 'Set As &Global Default'),
|
translate('OpenLP.ThemeManager', 'Set As &Global Default'),
|
||||||
self.changeGlobalFromScreen))
|
self.changeGlobalFromScreen))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
context_menu_action(self.ThemeListWidget,
|
context_menu_action(self.ThemeListWidget,
|
||||||
u':/general/general_export.png',
|
u':/general/general_export.png',
|
||||||
translate('ThemeManager', 'E&xport Theme'),
|
translate('OpenLP.ThemeManager', 'E&xport Theme'),
|
||||||
self.onExportTheme))
|
self.onExportTheme))
|
||||||
self.ThemeListWidget.addAction(
|
self.ThemeListWidget.addAction(
|
||||||
context_menu_separator(self.ThemeListWidget))
|
context_menu_separator(self.ThemeListWidget))
|
||||||
@ -139,8 +146,8 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.ThemeListWidget.item(count).setText(newName)
|
self.ThemeListWidget.item(count).setText(newName)
|
||||||
#Set the new name
|
#Set the new name
|
||||||
if themeName == newName:
|
if themeName == newName:
|
||||||
name = unicode(translate('ThemeManager', '%s (default)')) % \
|
name = unicode(translate('OpenLP.ThemeManager',
|
||||||
newName
|
'%s (default)')) % newName
|
||||||
self.ThemeListWidget.item(count).setText(name)
|
self.ThemeListWidget.item(count).setText(name)
|
||||||
|
|
||||||
def changeGlobalFromScreen(self, index = -1):
|
def changeGlobalFromScreen(self, index = -1):
|
||||||
@ -161,13 +168,14 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
if count == selected_row:
|
if count == selected_row:
|
||||||
self.global_theme = unicode(
|
self.global_theme = unicode(
|
||||||
self.ThemeListWidget.item(count).text())
|
self.ThemeListWidget.item(count).text())
|
||||||
name = unicode(translate('ThemeManager', '%s (default)')) % \
|
name = unicode(translate('OpenLP.ThemeManager',
|
||||||
self.global_theme
|
'%s (default)')) % self.global_theme
|
||||||
self.ThemeListWidget.item(count).setText(name)
|
self.ThemeListWidget.item(count).setText(name)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
self.settingsSection + u'/global theme',
|
self.settingsSection + u'/global theme',
|
||||||
QtCore.QVariant(self.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()
|
self.pushThemes()
|
||||||
|
|
||||||
def onAddTheme(self):
|
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
|
Loads the settings for the theme that is to be edited and launches the
|
||||||
theme editing form so the user can make their changes.
|
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.')):
|
'You must select a theme to edit.')):
|
||||||
item = self.ThemeListWidget.currentItem()
|
item = self.ThemeListWidget.currentItem()
|
||||||
themeName = unicode(item.text())
|
themeName = unicode(item.text())
|
||||||
@ -207,14 +216,15 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.global_theme = unicode(QtCore.QSettings().value(
|
self.global_theme = unicode(QtCore.QSettings().value(
|
||||||
self.settingsSection + u'/global theme',
|
self.settingsSection + u'/global theme',
|
||||||
QtCore.QVariant(u'')).toString())
|
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.')):
|
'You must select a theme to delete.')):
|
||||||
item = self.ThemeListWidget.currentItem()
|
item = self.ThemeListWidget.currentItem()
|
||||||
theme = unicode(item.text())
|
theme = unicode(item.text())
|
||||||
# confirm deletion
|
# confirm deletion
|
||||||
answer = QtGui.QMessageBox.question(self,
|
answer = QtGui.QMessageBox.question(self,
|
||||||
translate('ThemeManager', 'Delete Confirmation'),
|
translate('OpenLP.ThemeManager', 'Delete Confirmation'),
|
||||||
translate('ThemeManager', 'Delete theme?'),
|
translate('OpenLP.ThemeManager', 'Delete theme?'),
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Yes |
|
||||||
QtGui.QMessageBox.No), QtGui.QMessageBox.No)
|
QtGui.QMessageBox.No), QtGui.QMessageBox.No)
|
||||||
if answer == QtGui.QMessageBox.No:
|
if answer == QtGui.QMessageBox.No:
|
||||||
@ -222,24 +232,24 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
# should be the same unless default
|
# should be the same unless default
|
||||||
if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):
|
if theme != unicode(item.data(QtCore.Qt.UserRole).toString()):
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('ThemeManager', 'Error'),
|
translate('OpenLP.ThemeManager', 'Error'),
|
||||||
translate('ThemeManager',
|
translate('OpenLP.ThemeManager',
|
||||||
'You are unable to delete the default theme.'),
|
'You are unable to delete the default theme.'),
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
else:
|
else:
|
||||||
for plugin in self.parent.plugin_manager.plugins:
|
for plugin in self.parent.plugin_manager.plugins:
|
||||||
if plugin.usesTheme(theme):
|
if plugin.usesTheme(theme):
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('ThemeManager', 'Error'),
|
translate('OpenLP.ThemeManager', 'Error'),
|
||||||
unicode(translate('ThemeManager',
|
unicode(translate('OpenLP.ThemeManager',
|
||||||
'Theme %s is use in %s plugin.')) % \
|
'Theme %s is use in %s plugin.')) % \
|
||||||
(theme, plugin.name))
|
(theme, plugin.name))
|
||||||
return
|
return
|
||||||
if unicode(self.serviceComboBox.currentText()) == theme:
|
if unicode(self.serviceComboBox.currentText()) == theme:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('ThemeManager', 'Error'),
|
translate('OpenLP.ThemeManager', 'Error'),
|
||||||
unicode(translate('ThemeManager',
|
unicode(translate('OpenLP.ThemeManager',
|
||||||
'Theme %s is use by the service manager.')) % theme)
|
'Theme %s is use by the service manager.')) % theme)
|
||||||
return
|
return
|
||||||
row = self.ThemeListWidget.row(item)
|
row = self.ThemeListWidget.row(item)
|
||||||
self.ThemeListWidget.takeItem(row)
|
self.ThemeListWidget.takeItem(row)
|
||||||
@ -273,12 +283,14 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
item = self.ThemeListWidget.currentItem()
|
item = self.ThemeListWidget.currentItem()
|
||||||
if item is None:
|
if item is None:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('ThemeManager', 'Error'),
|
translate('OpenLP.ThemeManager', 'Error'),
|
||||||
translate('ThemeManager', 'You have not selected a theme.'))
|
translate('OpenLP.ThemeManager',
|
||||||
|
'You have not selected a theme.'))
|
||||||
return
|
return
|
||||||
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
|
theme = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||||
path = QtGui.QFileDialog.getExistingDirectory(self,
|
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))
|
SettingsManager.get_last_dir(self.settingsSection, 1))
|
||||||
path = unicode(path)
|
path = unicode(path)
|
||||||
if path:
|
if path:
|
||||||
@ -294,14 +306,14 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
os.path.join(source, name).encode(u'utf-8'),
|
os.path.join(source, name).encode(u'utf-8'),
|
||||||
os.path.join(theme, name).encode(u'utf-8'))
|
os.path.join(theme, name).encode(u'utf-8'))
|
||||||
QtGui.QMessageBox.information(self,
|
QtGui.QMessageBox.information(self,
|
||||||
translate('ThemeManager', 'Theme Exported'),
|
translate('OpenLP.ThemeManager', 'Theme Exported'),
|
||||||
translate('ThemeManager',
|
translate('OpenLP.ThemeManager',
|
||||||
'Your theme has been successfully exported.'))
|
'Your theme has been successfully exported.'))
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
log.exception(u'Export Theme Failed')
|
log.exception(u'Export Theme Failed')
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('ThemeManager', 'Theme Export Failed'),
|
translate('OpenLP.ThemeManager', 'Theme Export Failed'),
|
||||||
translate('ThemeManager',
|
translate('OpenLP.ThemeManager',
|
||||||
'Your theme could not be exported due to an error.'))
|
'Your theme could not be exported due to an error.'))
|
||||||
finally:
|
finally:
|
||||||
if zip:
|
if zip:
|
||||||
@ -314,9 +326,9 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
will load both OpenLP version 1 and version 2 themes.
|
will load both OpenLP version 1 and version 2 themes.
|
||||||
"""
|
"""
|
||||||
files = QtGui.QFileDialog.getOpenFileNames(self,
|
files = QtGui.QFileDialog.getOpenFileNames(self,
|
||||||
translate('ThemeManager', 'Select Theme Import File'),
|
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
|
||||||
SettingsManager.get_last_dir(self.settingsSection),
|
SettingsManager.get_last_dir(self.settingsSection),
|
||||||
translate('ThemeManager', 'Theme (*.*)'))
|
translate('OpenLP.ThemeManager', 'Theme (*.*)'))
|
||||||
log.info(u'New Themes %s', unicode(files))
|
log.info(u'New Themes %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
for file in files:
|
for file in files:
|
||||||
@ -343,7 +355,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
if os.path.exists(theme):
|
if os.path.exists(theme):
|
||||||
textName = os.path.splitext(name)[0]
|
textName = os.path.splitext(name)[0]
|
||||||
if textName == self.global_theme:
|
if textName == self.global_theme:
|
||||||
name = unicode(translate('ThemeManager',
|
name = unicode(translate('OpenLP.ThemeManager',
|
||||||
'%s (default)')) % textName
|
'%s (default)')) % textName
|
||||||
else:
|
else:
|
||||||
name = textName
|
name = textName
|
||||||
@ -419,8 +431,9 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
ucsfile = file.decode(u'utf-8')
|
ucsfile = file.decode(u'utf-8')
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
QtGui.QMessageBox.critical(
|
QtGui.QMessageBox.critical(
|
||||||
self, translate('ThemeManager', 'Error'),
|
self, translate('OpenLP.ThemeManager', 'Error'),
|
||||||
translate('ThemeManager', 'File is not a valid theme.\n'
|
translate('OpenLP.ThemeManager',
|
||||||
|
'File is not a valid theme.\n'
|
||||||
'The content encoding is not UTF-8.'))
|
'The content encoding is not UTF-8.'))
|
||||||
log.exception(u'Filename "%s" is not valid UTF-8' %
|
log.exception(u'Filename "%s" is not valid UTF-8' %
|
||||||
file.decode(u'utf-8', u'replace'))
|
file.decode(u'utf-8', u'replace'))
|
||||||
@ -464,15 +477,16 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
self.generateAndSaveImage(dir, themename, filexml)
|
self.generateAndSaveImage(dir, themename, filexml)
|
||||||
else:
|
else:
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('ThemeManager', 'Error'),
|
translate('OpenLP.ThemeManager', 'Error'),
|
||||||
translate('ThemeManager', 'File is not a valid theme.'))
|
translate('OpenLP.ThemeManager',
|
||||||
log.exception(u'Theme file dosen\'t contain XML data %s' %
|
'File is not a valid theme.'))
|
||||||
|
log.exception(u'Theme file does not contain XML data %s' %
|
||||||
filename)
|
filename)
|
||||||
except (IOError, NameError):
|
except (IOError, NameError):
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate('ThemeManager', 'Error'),
|
translate('OpenLP.ThemeManager', 'Error'),
|
||||||
translate('ThemeManager', 'File is not a valid theme.'))
|
translate('OpenLP.ThemeManager', 'File is not a valid theme.'))
|
||||||
log.exception(u'Importing theme from zip file failed %s' % filename)
|
log.exception(u'Importing theme from zip failed %s' % filename)
|
||||||
finally:
|
finally:
|
||||||
if zip:
|
if zip:
|
||||||
zip.close()
|
zip.close()
|
||||||
@ -536,7 +550,8 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
vAlignCorrection = 1
|
vAlignCorrection = 1
|
||||||
elif theme.VerticalAlign == 1:
|
elif theme.VerticalAlign == 1:
|
||||||
vAlignCorrection = 2
|
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(outline), unicode(theme.OutlineColor.name()),
|
||||||
unicode(theme.HorizontalAlign), unicode(vAlignCorrection),
|
unicode(theme.HorizontalAlign), unicode(vAlignCorrection),
|
||||||
unicode(theme.WrapStyle), unicode(0))
|
unicode(theme.WrapStyle), unicode(0))
|
||||||
@ -559,8 +574,9 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
if self.saveThemeName != name:
|
if self.saveThemeName != name:
|
||||||
if os.path.exists(theme_file):
|
if os.path.exists(theme_file):
|
||||||
result = QtGui.QMessageBox.question(self,
|
result = QtGui.QMessageBox.question(self,
|
||||||
translate('ThemeManager', 'Theme Exists'),
|
translate('OpenLP.ThemeManager', 'Theme Exists'),
|
||||||
translate('ThemeManager', 'A theme with this name already '
|
translate('OpenLP.ThemeManager',
|
||||||
|
'A theme with this name already '
|
||||||
'exists. Would you like to overwrite it?'),
|
'exists. Would you like to overwrite it?'),
|
||||||
(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
|
(QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
|
||||||
QtGui.QMessageBox.No)
|
QtGui.QMessageBox.No)
|
||||||
@ -611,7 +627,7 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
newThemeItem).row()
|
newThemeItem).row()
|
||||||
self.global_theme = unicode(
|
self.global_theme = unicode(
|
||||||
self.ThemeListWidget.item(newThemeIndex).text())
|
self.ThemeListWidget.item(newThemeIndex).text())
|
||||||
newName = unicode(translate('ThemeManager',
|
newName = unicode(translate('OpenLP.ThemeManager',
|
||||||
'%s (default)')) % self.global_theme
|
'%s (default)')) % self.global_theme
|
||||||
self.ThemeListWidget.item(newThemeIndex).setText(newName)
|
self.ThemeListWidget.item(newThemeIndex).setText(newName)
|
||||||
QtCore.QSettings().setValue(
|
QtCore.QSettings().setValue(
|
||||||
@ -665,14 +681,15 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
log.debug(u'base theme created')
|
log.debug(u'base theme created')
|
||||||
newtheme = ThemeXML()
|
newtheme = ThemeXML()
|
||||||
newtheme.new_document(unicode(translate('ThemeManager', 'New Theme')))
|
newtheme.new_document(
|
||||||
newtheme.add_background_solid(unicode(u'#000000'))
|
unicode(translate('OpenLP.ThemeManager', 'New Theme')))
|
||||||
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
|
newtheme.add_background_solid(u'#000000')
|
||||||
unicode(30), u'False')
|
newtheme.add_font(unicode(QtGui.QFont().family()), u'#FFFFFF',
|
||||||
newtheme.add_font(unicode(QtGui.QFont().family()), unicode(u'#FFFFFF'),
|
u'30', u'False')
|
||||||
unicode(12), u'False', u'footer')
|
newtheme.add_font(unicode(QtGui.QFont().family()), u'#FFFFFF',
|
||||||
newtheme.add_display(u'False', unicode(u'#FFFFFF'), u'False',
|
u'12', u'False', u'footer')
|
||||||
unicode(u'#FFFFFF'), unicode(0), unicode(0), unicode(0), u'False')
|
newtheme.add_display(u'False', u'#FFFFFF', u'False',
|
||||||
|
unicode(u'#FFFFFF'), u'0', u'0', u'0', u'False')
|
||||||
return newtheme.extract_xml()
|
return newtheme.extract_xml()
|
||||||
|
|
||||||
def createThemeFromXml(self, theme_xml, path):
|
def createThemeFromXml(self, theme_xml, path):
|
||||||
|
@ -37,7 +37,7 @@ class ThemesTab(SettingsTab):
|
|||||||
|
|
||||||
def setupUi(self):
|
def setupUi(self):
|
||||||
self.setObjectName(u'ThemesTab')
|
self.setObjectName(u'ThemesTab')
|
||||||
self.tabTitleVisible = translate('ThemesTab', 'Themes')
|
self.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes')
|
||||||
self.ThemesTabLayout = QtGui.QHBoxLayout(self)
|
self.ThemesTabLayout = QtGui.QHBoxLayout(self)
|
||||||
self.ThemesTabLayout.setSpacing(8)
|
self.ThemesTabLayout.setSpacing(8)
|
||||||
self.ThemesTabLayout.setMargin(8)
|
self.ThemesTabLayout.setMargin(8)
|
||||||
@ -106,26 +106,28 @@ class ThemesTab(SettingsTab):
|
|||||||
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
|
QtCore.SIGNAL(u'theme_update_list'), self.updateThemeList)
|
||||||
|
|
||||||
def retranslateUi(self):
|
def retranslateUi(self):
|
||||||
self.GlobalGroupBox.setTitle(translate('ThemesTab', 'Global Theme'))
|
self.GlobalGroupBox.setTitle(
|
||||||
self.LevelGroupBox.setTitle(translate('ThemesTab', 'Theme Level'))
|
translate('OpenLP.ThemesTab', 'Global Theme'))
|
||||||
|
self.LevelGroupBox.setTitle(
|
||||||
|
translate('OpenLP.ThemesTab', 'Theme Level'))
|
||||||
self.SongLevelRadioButton.setText(
|
self.SongLevelRadioButton.setText(
|
||||||
translate('ThemesTab', 'S&ong Level'))
|
translate('OpenLP.ThemesTab', 'S&ong Level'))
|
||||||
self.SongLevelLabel.setText(
|
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 '
|
'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 '
|
'it, then use the service\'s theme. If the service doesn\'t have '
|
||||||
'a theme, then use the global theme.'))
|
'a theme, then use the global theme.'))
|
||||||
self.ServiceLevelRadioButton.setText(
|
self.ServiceLevelRadioButton.setText(
|
||||||
translate('ThemesTab', '&Service Level'))
|
translate('OpenLP.ThemesTab', '&Service Level'))
|
||||||
self.ServiceLevelLabel.setText(
|
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 '
|
'overriding any of the individual songs\' themes. If the '
|
||||||
'service doesn\'t have a theme, then use the global theme.'))
|
'service doesn\'t have a theme, then use the global theme.'))
|
||||||
self.GlobalLevelRadioButton.setText(
|
self.GlobalLevelRadioButton.setText(
|
||||||
translate('ThemesTab', '&Global Level'))
|
translate('OpenLP.ThemesTab', '&Global Level'))
|
||||||
self.GlobalLevelLabel.setText(
|
self.GlobalLevelLabel.setText(
|
||||||
translate('ThemesTab', 'Use the global theme, overriding any '
|
translate('OpenLP.ThemesTab', 'Use the global theme, overriding '
|
||||||
'themes associated with either the service or the songs.'))
|
'any themes associated with either the service or the songs.'))
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
settings = QtCore.QSettings()
|
settings = QtCore.QSettings()
|
||||||
|
@ -407,11 +407,11 @@ class Ui_EditSongDialog(object):
|
|||||||
self.TitleLabel.setText(
|
self.TitleLabel.setText(
|
||||||
translate('SongsPlugin.EditSongForm', '&Title:'))
|
translate('SongsPlugin.EditSongForm', '&Title:'))
|
||||||
self.AlternativeTitleLabel.setText(
|
self.AlternativeTitleLabel.setText(
|
||||||
translate('SongsPlugin.EditSongForm', 'Alt&ernate Title:'))
|
translate('SongsPlugin.EditSongForm', 'Alt&ernate title:'))
|
||||||
self.LyricsLabel.setText(
|
self.LyricsLabel.setText(
|
||||||
translate('SongsPlugin.EditSongForm', '&Lyrics:'))
|
translate('SongsPlugin.EditSongForm', '&Lyrics:'))
|
||||||
self.VerseOrderLabel.setText(
|
self.VerseOrderLabel.setText(
|
||||||
translate('SongsPlugin.EditSongForm', '&Verse Order:'))
|
translate('SongsPlugin.EditSongForm', '&Verse order:'))
|
||||||
self.VerseAddButton.setText(
|
self.VerseAddButton.setText(
|
||||||
translate('SongsPlugin.EditSongForm', '&Add'))
|
translate('SongsPlugin.EditSongForm', '&Add'))
|
||||||
self.VerseEditButton.setText(
|
self.VerseEditButton.setText(
|
||||||
@ -452,7 +452,7 @@ class Ui_EditSongDialog(object):
|
|||||||
self.CopyrightInsertButton.setText(
|
self.CopyrightInsertButton.setText(
|
||||||
translate('SongsPlugin.EditSongForm', '\xa9'))
|
translate('SongsPlugin.EditSongForm', '\xa9'))
|
||||||
self.CCLILabel.setText(
|
self.CCLILabel.setText(
|
||||||
translate('SongsPlugin.EditSongForm', 'CCLI Number:'))
|
translate('SongsPlugin.EditSongForm', 'CCLI number:'))
|
||||||
self.CommentsGroupBox.setTitle(
|
self.CommentsGroupBox.setTitle(
|
||||||
translate('SongsPlugin.EditSongForm', 'Comments'))
|
translate('SongsPlugin.EditSongForm', 'Comments'))
|
||||||
self.SongTabWidget.setTabText(
|
self.SongTabWidget.setTabText(
|
||||||
|
@ -93,19 +93,19 @@ class VerseType(object):
|
|||||||
The type to return a string for
|
The type to return a string for
|
||||||
"""
|
"""
|
||||||
if verse_type == VerseType.Verse:
|
if verse_type == VerseType.Verse:
|
||||||
return translate('VerseType', 'Verse')
|
return translate('SongsPlugin.VerseType', 'Verse')
|
||||||
elif verse_type == VerseType.Chorus:
|
elif verse_type == VerseType.Chorus:
|
||||||
return translate('VerseType', 'Chorus')
|
return translate('SongsPlugin.VerseType', 'Chorus')
|
||||||
elif verse_type == VerseType.Bridge:
|
elif verse_type == VerseType.Bridge:
|
||||||
return translate('VerseType', 'Bridge')
|
return translate('SongsPlugin.VerseType', 'Bridge')
|
||||||
elif verse_type == VerseType.PreChorus:
|
elif verse_type == VerseType.PreChorus:
|
||||||
return translate('VerseType', 'Pre-Chorus')
|
return translate('SongsPlugin.VerseType', 'Pre-Chorus')
|
||||||
elif verse_type == VerseType.Intro:
|
elif verse_type == VerseType.Intro:
|
||||||
return translate('VerseType', 'Intro')
|
return translate('SongsPlugin.VerseType', 'Intro')
|
||||||
elif verse_type == VerseType.Ending:
|
elif verse_type == VerseType.Ending:
|
||||||
return translate('VerseType', 'Ending')
|
return translate('SongsPlugin.VerseType', 'Ending')
|
||||||
elif verse_type == VerseType.Other:
|
elif verse_type == VerseType.Other:
|
||||||
return translate('VerseType', 'Other')
|
return translate('SongsPlugin.VerseType', 'Other')
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def from_string(verse_type):
|
def from_string(verse_type):
|
||||||
|
@ -209,9 +209,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
self.listView.clear()
|
self.listView.clear()
|
||||||
for author in searchresults:
|
for author in searchresults:
|
||||||
for song in author.songs:
|
for song in author.songs:
|
||||||
song_detail = unicode(
|
song_detail = '%s (%s)' % (author.display_name, song.title)
|
||||||
translate('SongsPlugin.MediaItem', '%s (%s)')) % \
|
|
||||||
(author.display_name, song.title)
|
|
||||||
song_name = QtGui.QListWidgetItem(song_detail)
|
song_name = QtGui.QListWidgetItem(song_detail)
|
||||||
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
|
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
|
||||||
self.listView.addItem(song_name)
|
self.listView.addItem(song_name)
|
||||||
@ -270,7 +268,8 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
"""
|
"""
|
||||||
Edit a song
|
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.')):
|
'You must select an item to edit.')):
|
||||||
item = self.listView.currentItem()
|
item = self.listView.currentItem()
|
||||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||||
@ -281,18 +280,19 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
"""
|
"""
|
||||||
Remove a song from the list and database
|
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.')):
|
'You must select an item to delete.')):
|
||||||
items = self.listView.selectedIndexes()
|
items = self.listView.selectedIndexes()
|
||||||
if len(items) == 1:
|
if len(items) == 1:
|
||||||
del_message = translate('SongsPlugin.MediaItem',
|
del_message = translate('SongsPlugin.MediaItem',
|
||||||
'Delete song?')
|
'Are you sure you want to delete the selected song?')
|
||||||
else:
|
else:
|
||||||
del_message = unicode(
|
del_message = unicode(translate('SongsPlugin.MediaItem',
|
||||||
translate('SongsPlugin.MediaItem',
|
'Are you sure you want to delete the %d selected '
|
||||||
'Delete %d songs?')) % len(items)
|
'songs?')) % len(items)
|
||||||
ans = QtGui.QMessageBox.question(self,
|
ans = QtGui.QMessageBox.question(self,
|
||||||
translate('SongsPlugin.MediaItem', 'Delete Confirmation'),
|
translate('SongsPlugin.MediaItem', 'Delete Song(s)?'),
|
||||||
del_message,
|
del_message,
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok|
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok|
|
||||||
QtGui.QMessageBox.Cancel),
|
QtGui.QMessageBox.Cancel),
|
||||||
|
@ -66,7 +66,7 @@ class SongsTab(SettingsTab):
|
|||||||
self.SearchAsTypeCheckBox.setText(
|
self.SearchAsTypeCheckBox.setText(
|
||||||
translate('SongsPlugin.SongsTab', 'Enable search as you type'))
|
translate('SongsPlugin.SongsTab', 'Enable search as you type'))
|
||||||
self.SongBarActiveCheckBox.setText(translate('SongsPlugin.SongsTab',
|
self.SongBarActiveCheckBox.setText(translate('SongsPlugin.SongsTab',
|
||||||
'Display Verses on Live Tool bar'))
|
'Display verses on live tool bar'))
|
||||||
|
|
||||||
def onSearchAsTypeCheckBoxChanged(self, check_state):
|
def onSearchAsTypeCheckBoxChanged(self, check_state):
|
||||||
self.song_search = False
|
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
Loading…
Reference in New Issue
Block a user