This commit is contained in:
Andreas Preikschat 2011-02-09 16:00:04 +01:00
commit 50e9f9ab5e
22 changed files with 177 additions and 176 deletions

View File

@ -34,6 +34,29 @@ from openlp.core.lib import build_icon, Receiver, translate
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class UiStrings(object):
"""
Provide standard strings for objects to use.
"""
# These strings should need a good reason to be retranslated elsewhere.
# Should some/more/less of these have an & attached?
Add = translate('OpenLP.Ui', '&Add')
AllFiles = translate('OpenLP.Ui', 'All Files')
Authors = translate('OpenLP.Ui', 'Authors')
Delete = translate('OpenLP.Ui', '&Delete')
Edit = translate('OpenLP.Ui', '&Edit')
Error = translate('OpenLP.Ui', 'Error')
Import = translate('OpenLP.Ui', 'Import')
Live = translate('OpenLP.Ui', 'Live')
Load = translate('OpenLP.Ui', 'Load')
New = translate('OpenLP.Ui', 'New')
OLPV2 = translate('OpenLP.Ui', 'OpenLP 2.0')
Preview = translate('OpenLP.Ui', 'Preview')
Service = translate('OpenLP.Ui', 'Service')
Theme = translate('OpenLP.Ui', 'Theme')
Themes = translate('OpenLP.Ui', 'Themes')
def add_welcome_page(parent, image): def add_welcome_page(parent, image):
""" """
Generate an opening welcome page for a wizard using a provided image. Generate an opening welcome page for a wizard using a provided image.
@ -98,13 +121,12 @@ def critical_error_message_box(title=None, message=None, parent=None,
``question`` ``question``
Should this message box question the user. Should this message box question the user.
""" """
error = translate('OpenLP.Ui', 'Error')
if question: if question:
return QtGui.QMessageBox.critical(parent, error, message, return QtGui.QMessageBox.critical(parent, error, message,
QtGui.QMessageBox.StandardButtons( QtGui.QMessageBox.StandardButtons(
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No)) QtGui.QMessageBox.Yes | QtGui.QMessageBox.No))
data = {u'message': message} data = {u'message': message}
data[u'title'] = title if title else error data[u'title'] = title if title else UiStrings.Error
return Receiver.send_message(u'openlp_error_message', data) return Receiver.send_message(u'openlp_error_message', data)
def media_item_combo_box(parent, name): def media_item_combo_box(parent, name):
@ -134,7 +156,7 @@ def create_delete_push_button(parent, icon=None):
delete_button.setObjectName(u'deleteButton') delete_button.setObjectName(u'deleteButton')
delete_icon = icon if icon else u':/general/general_delete.png' delete_icon = icon if icon else u':/general/general_delete.png'
delete_button.setIcon(build_icon(delete_icon)) delete_button.setIcon(build_icon(delete_icon))
delete_button.setText(translate('OpenLP.Ui', '&Delete')) delete_button.setText(UiStrings.Delete)
delete_button.setToolTip( delete_button.setToolTip(
translate('OpenLP.Ui', 'Delete the selected item.')) translate('OpenLP.Ui', 'Delete the selected item.'))
QtCore.QObject.connect(delete_button, QtCore.QObject.connect(delete_button,
@ -219,3 +241,28 @@ def add_widget_completer(cache, widget):
completer = QtGui.QCompleter(cache) completer = QtGui.QCompleter(cache)
completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive)
widget.setCompleter(completer) widget.setCompleter(completer)
def create_valign_combo(form, parent, layout):
"""
Creates a standard label and combo box for asking users to select a
vertical alignment.
``form``
The UI screen that the label and combo will appear on.
``parent``
The parent object. This should be a ``QWidget`` descendant.
``layout``
A layout object to add the label and combo widgets to.
"""
verticalLabel = QtGui.QLabel(parent)
verticalLabel.setObjectName(u'VerticalLabel')
verticalLabel.setText(translate('OpenLP.Ui', '&Vertical Align:'))
form.verticalComboBox = QtGui.QComboBox(parent)
form.verticalComboBox.setObjectName(u'VerticalComboBox')
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Top'))
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Middle'))
form.verticalComboBox.addItem(translate('OpenLP.Ui', 'Bottom'))
verticalLabel.setBuddy(form.verticalComboBox)
layout.addRow(verticalLabel, form.verticalComboBox)

View File

@ -34,7 +34,7 @@ import cPickle
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate, DisplayTags from openlp.core.lib import SettingsTab, translate, DisplayTags
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
class DisplayTagTab(SettingsTab): class DisplayTagTab(SettingsTab):
""" """
@ -164,8 +164,7 @@ class DisplayTagTab(SettingsTab):
self.startTagLabel.setText( self.startTagLabel.setText(
translate('OpenLP.DisplayTagTab', 'Start tag')) translate('OpenLP.DisplayTagTab', 'Start tag'))
self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag')) self.endTagLabel.setText(translate('OpenLP.DisplayTagTab', 'End tag'))
self.deletePushButton.setText( self.deletePushButton.setText(UiStrings.Delete)
translate('OpenLP.DisplayTagTab', 'Delete'))
self.defaultPushButton.setText( self.defaultPushButton.setText(
translate('OpenLP.DisplayTagTab', 'Default')) translate('OpenLP.DisplayTagTab', 'Default'))
self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New')) self.newPushButton.setText(translate('OpenLP.DisplayTagTab', 'New'))

View File

@ -30,7 +30,8 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \ from openlp.core.lib import RenderManager, build_icon, OpenLPDockWidget, \
SettingsManager, PluginManager, Receiver, translate SettingsManager, PluginManager, Receiver, translate
from openlp.core.lib.ui import base_action, checkable_action, icon_action from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \
icon_action
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \ from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
ThemeManager, SlideController, PluginForm, MediaDockManager, \ ThemeManager, SlideController, PluginForm, MediaDockManager, \
ShortcutListForm ShortcutListForm
@ -295,7 +296,7 @@ class Ui_MainWindow(object):
""" """
Set up the translation system Set up the translation system
""" """
mainWindow.mainTitle = translate('OpenLP.MainWindow', 'OpenLP 2.0') mainWindow.mainTitle = UiStrings.OLPV2
mainWindow.setWindowTitle(mainWindow.mainTitle) mainWindow.setWindowTitle(mainWindow.mainTitle)
self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File')) self.FileMenu.setTitle(translate('OpenLP.MainWindow', '&File'))
self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import')) self.FileImportMenu.setTitle(translate('OpenLP.MainWindow', '&Import'))

View File

@ -32,7 +32,7 @@ from PyQt4.phonon import Phonon
from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \ from openlp.core.lib import OpenLPToolbar, Receiver, resize_image, \
ItemCapabilities, translate ItemCapabilities, translate
from openlp.core.lib.ui import shortcut_action from openlp.core.lib.ui import UiStrings, shortcut_action
from openlp.core.ui import HideMode, MainDisplay from openlp.core.ui import HideMode, MainDisplay
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -87,12 +87,11 @@ class SlideController(QtGui.QWidget):
# Type label for the top of the slide controller # Type label for the top of the slide controller
self.typeLabel = QtGui.QLabel(self.panel) self.typeLabel = QtGui.QLabel(self.panel)
if self.isLive: if self.isLive:
self.typeLabel.setText(translate('OpenLP.SlideController', 'Live')) self.typeLabel.setText(UiStrings.Live)
self.split = 1 self.split = 1
self.typePrefix = u'live' self.typePrefix = u'live'
else: else:
self.typeLabel.setText(translate('OpenLP.SlideController', self.typeLabel.setText(UiStrings.Preview)
'Preview'))
self.split = 0 self.split = 0
self.typePrefix = u'preview' self.typePrefix = u'preview'
self.typeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;') self.typeLabel.setStyleSheet(u'font-weight: bold; font-size: 12pt;')
@ -874,7 +873,8 @@ class SlideController(QtGui.QWidget):
using *Blank to Theme*. using *Blank to Theme*.
""" """
log.debug(u'updatePreview %s ' % self.screens.current[u'primary']) log.debug(u'updatePreview %s ' % self.screens.current[u'primary'])
if not self.screens.current[u'primary']: if not self.screens.current[u'primary'] and \
self.serviceItem.is_capable(ItemCapabilities.ProvidesOwnDisplay):
# Grab now, but try again in a couple of seconds if slide change # Grab now, but try again in a couple of seconds if slide change
# is slow # is slow
QtCore.QTimer.singleShot(0.5, self.grabMainDisplay) QtCore.QTimer.singleShot(0.5, self.grabMainDisplay)

View File

@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \ from openlp.core.lib import translate, BackgroundType, BackgroundGradientType, \
Receiver Receiver
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.utils import get_images_filter from openlp.core.utils import get_images_filter
from themewizard import Ui_ThemeWizard from themewizard import Ui_ThemeWizard
@ -483,8 +483,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard):
Background Image button pushed. Background Image button pushed.
""" """
images_filter = get_images_filter() images_filter = get_images_filter()
images_filter = '%s;;%s (*.*) (*)' % (images_filter, images_filter = '%s;;%s (*.*) (*)' % (images_filter, UiStrings.AllFiles)
translate('OpenLP.ThemeForm', 'All Files'))
filename = QtGui.QFileDialog.getOpenFileName(self, filename = QtGui.QFileDialog.getOpenFileName(self,
translate('OpenLP.ThemeForm', 'Select Image'), u'', translate('OpenLP.ThemeForm', 'Select Image'), u'',
images_filter) images_filter)

View File

@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate from openlp.core.lib import SettingsTab, Receiver, ThemeLevel, translate
from openlp.core.lib.ui import UiStrings
class ThemesTab(SettingsTab): class ThemesTab(SettingsTab):
""" """
@ -98,7 +99,7 @@ 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.tabTitleVisible = translate('OpenLP.ThemesTab', 'Themes') self.tabTitleVisible = UiStrings.Themes
self.GlobalGroupBox.setTitle( self.GlobalGroupBox.setTitle(
translate('OpenLP.ThemesTab', 'Global Theme')) translate('OpenLP.ThemesTab', 'Global Theme'))
self.LevelGroupBox.setTitle( self.LevelGroupBox.setTitle(

View File

@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate, build_icon from openlp.core.lib import translate, build_icon
from openlp.core.lib.ui import add_welcome_page from openlp.core.lib.ui import add_welcome_page, create_valign_combo
class Ui_ThemeWizard(object): class Ui_ThemeWizard(object):
def setupUi(self, themeWizard): def setupUi(self, themeWizard):
@ -242,12 +242,8 @@ class Ui_ThemeWizard(object):
self.horizontalComboBox.setObjectName(u'HorizontalComboBox') self.horizontalComboBox.setObjectName(u'HorizontalComboBox')
self.alignmentLayout.addRow(self.horizontalLabel, self.alignmentLayout.addRow(self.horizontalLabel,
self.horizontalComboBox) self.horizontalComboBox)
self.verticalLabel = QtGui.QLabel(self.alignmentPage) create_valign_combo(themeWizard, self.alignmentPage,
self.verticalLabel.setObjectName(u'VerticalLabel') self.alignmentLayout)
self.verticalComboBox = QtGui.QComboBox(self.alignmentPage)
self.verticalComboBox.addItems([u'', u'', u''])
self.verticalComboBox.setObjectName(u'VerticalComboBox')
self.alignmentLayout.addRow(self.verticalLabel, self.verticalComboBox)
self.transitionsLabel = QtGui.QLabel(self.alignmentPage) self.transitionsLabel = QtGui.QLabel(self.alignmentPage)
self.transitionsLabel.setObjectName(u'TransitionsLabel') self.transitionsLabel.setObjectName(u'TransitionsLabel')
self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage) self.transitionsCheckBox = QtGui.QCheckBox(self.alignmentPage)
@ -450,8 +446,7 @@ class Ui_ThemeWizard(object):
self.mainAreaPage.setSubTitle( self.mainAreaPage.setSubTitle(
translate('OpenLP.ThemeWizard', 'Define the font and display ' translate('OpenLP.ThemeWizard', 'Define the font and display '
'characteristics for the Display text')) 'characteristics for the Display text'))
self.mainFontLabel.setText( self.mainFontLabel.setText(translate('OpenLP.ThemeWizard', 'Font:'))
translate('OpenLP.ThemeWizard', 'Font:'))
self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:')) self.mainColorLabel.setText(translate('OpenLP.ThemeWizard', 'Color:'))
self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.mainSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) self.mainSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
@ -465,8 +460,7 @@ class Ui_ThemeWizard(object):
self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadowCheckBox.setText(translate('OpenLP.ThemeWizard', '&Shadow:'))
self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:')) self.shadowSizeLabel.setText(translate('OpenLP.ThemeWizard', 'Size:'))
self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt')) self.shadowSizeSpinBox.setSuffix(translate('OpenLP.ThemeWizard', 'pt'))
self.mainBoldCheckBox.setText( self.mainBoldCheckBox.setText(translate('OpenLP.ThemeWizard', 'Bold'))
translate('OpenLP.ThemeWizard', 'Bold'))
self.mainItalicsCheckBox.setText( self.mainItalicsCheckBox.setText(
translate('OpenLP.ThemeWizard', 'Italic')) translate('OpenLP.ThemeWizard', 'Italic'))
self.footerAreaPage.setTitle( self.footerAreaPage.setTitle(
@ -491,14 +485,6 @@ class Ui_ThemeWizard(object):
translate('OpenLP.ThemeWizard', 'Right')) translate('OpenLP.ThemeWizard', 'Right'))
self.horizontalComboBox.setItemText(2, self.horizontalComboBox.setItemText(2,
translate('OpenLP.ThemeWizard', 'Center')) translate('OpenLP.ThemeWizard', 'Center'))
self.verticalLabel.setText(
translate('OpenLP.ThemeWizard', 'Vertical Align:'))
self.verticalComboBox.setItemText(0,
translate('OpenLP.ThemeWizard', 'Top'))
self.verticalComboBox.setItemText(1,
translate('OpenLP.ThemeWizard', 'Middle'))
self.verticalComboBox.setItemText(2,
translate('OpenLP.ThemeWizard', 'Bottom'))
self.transitionsLabel.setText( self.transitionsLabel.setText(
translate('OpenLP.ThemeWizard', 'Transitions:')) translate('OpenLP.ThemeWizard', 'Transitions:'))
self.areaPositionPage.setTitle( self.areaPositionPage.setTitle(

View File

@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate from openlp.core.lib import SettingsTab, translate
from openlp.core.lib.ui import UiStrings, create_valign_combo
class AlertsTab(SettingsTab): class AlertsTab(SettingsTab):
""" """
@ -40,48 +41,43 @@ class AlertsTab(SettingsTab):
def setupUi(self): def setupUi(self):
self.setObjectName(u'AlertsTab') self.setObjectName(u'AlertsTab')
SettingsTab.setupUi(self) SettingsTab.setupUi(self)
self.FontGroupBox = QtGui.QGroupBox(self.leftColumn) self.fontGroupBox = QtGui.QGroupBox(self.leftColumn)
self.FontGroupBox.setObjectName(u'FontGroupBox') self.fontGroupBox.setObjectName(u'fontGroupBox')
self.FontLayout = QtGui.QFormLayout(self.FontGroupBox) self.fontLayout = QtGui.QFormLayout(self.fontGroupBox)
self.FontLayout.setObjectName(u'FontLayout') self.fontLayout.setObjectName(u'fontLayout')
self.FontLabel = QtGui.QLabel(self.FontGroupBox) self.FontLabel = QtGui.QLabel(self.fontGroupBox)
self.FontLabel.setObjectName(u'FontLabel') self.FontLabel.setObjectName(u'FontLabel')
self.FontComboBox = QtGui.QFontComboBox(self.FontGroupBox) self.FontComboBox = QtGui.QFontComboBox(self.fontGroupBox)
self.FontComboBox.setObjectName(u'FontComboBox') self.FontComboBox.setObjectName(u'FontComboBox')
self.FontLayout.addRow(self.FontLabel, self.FontComboBox) self.fontLayout.addRow(self.FontLabel, self.FontComboBox)
self.FontColorLabel = QtGui.QLabel(self.FontGroupBox) self.FontColorLabel = QtGui.QLabel(self.fontGroupBox)
self.FontColorLabel.setObjectName(u'FontColorLabel') self.FontColorLabel.setObjectName(u'FontColorLabel')
self.ColorLayout = QtGui.QHBoxLayout() self.ColorLayout = QtGui.QHBoxLayout()
self.ColorLayout.setObjectName(u'ColorLayout') self.ColorLayout.setObjectName(u'ColorLayout')
self.FontColorButton = QtGui.QPushButton(self.FontGroupBox) self.FontColorButton = QtGui.QPushButton(self.fontGroupBox)
self.FontColorButton.setObjectName(u'FontColorButton') self.FontColorButton.setObjectName(u'FontColorButton')
self.ColorLayout.addWidget(self.FontColorButton) self.ColorLayout.addWidget(self.FontColorButton)
self.ColorLayout.addSpacing(20) self.ColorLayout.addSpacing(20)
self.BackgroundColorLabel = QtGui.QLabel(self.FontGroupBox) self.BackgroundColorLabel = QtGui.QLabel(self.fontGroupBox)
self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel') self.BackgroundColorLabel.setObjectName(u'BackgroundColorLabel')
self.ColorLayout.addWidget(self.BackgroundColorLabel) self.ColorLayout.addWidget(self.BackgroundColorLabel)
self.BackgroundColorButton = QtGui.QPushButton(self.FontGroupBox) self.BackgroundColorButton = QtGui.QPushButton(self.fontGroupBox)
self.BackgroundColorButton.setObjectName(u'BackgroundColorButton') self.BackgroundColorButton.setObjectName(u'BackgroundColorButton')
self.ColorLayout.addWidget(self.BackgroundColorButton) self.ColorLayout.addWidget(self.BackgroundColorButton)
self.FontLayout.addRow(self.FontColorLabel, self.ColorLayout) self.fontLayout.addRow(self.FontColorLabel, self.ColorLayout)
self.FontSizeLabel = QtGui.QLabel(self.FontGroupBox) self.FontSizeLabel = QtGui.QLabel(self.fontGroupBox)
self.FontSizeLabel.setObjectName(u'FontSizeLabel') self.FontSizeLabel.setObjectName(u'FontSizeLabel')
self.FontSizeSpinBox = QtGui.QSpinBox(self.FontGroupBox) self.FontSizeSpinBox = QtGui.QSpinBox(self.fontGroupBox)
self.FontSizeSpinBox.setObjectName(u'FontSizeSpinBox') self.FontSizeSpinBox.setObjectName(u'FontSizeSpinBox')
self.FontLayout.addRow(self.FontSizeLabel, self.FontSizeSpinBox) self.fontLayout.addRow(self.FontSizeLabel, self.FontSizeSpinBox)
self.TimeoutLabel = QtGui.QLabel(self.FontGroupBox) self.TimeoutLabel = QtGui.QLabel(self.fontGroupBox)
self.TimeoutLabel.setObjectName(u'TimeoutLabel') self.TimeoutLabel.setObjectName(u'TimeoutLabel')
self.TimeoutSpinBox = QtGui.QSpinBox(self.FontGroupBox) self.TimeoutSpinBox = QtGui.QSpinBox(self.fontGroupBox)
self.TimeoutSpinBox.setMaximum(180) self.TimeoutSpinBox.setMaximum(180)
self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox') self.TimeoutSpinBox.setObjectName(u'TimeoutSpinBox')
self.FontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox) self.fontLayout.addRow(self.TimeoutLabel, self.TimeoutSpinBox)
self.LocationLabel = QtGui.QLabel(self.FontGroupBox) create_valign_combo(self, self.fontGroupBox, self.fontLayout)
self.LocationLabel.setObjectName(u'LocationLabel') self.leftLayout.addWidget(self.fontGroupBox)
self.LocationComboBox = QtGui.QComboBox(self.FontGroupBox)
self.LocationComboBox.addItems([u'', u'', u''])
self.LocationComboBox.setObjectName(u'LocationComboBox')
self.FontLayout.addRow(self.LocationLabel, self.LocationComboBox)
self.leftLayout.addWidget(self.FontGroupBox)
self.leftLayout.addStretch() self.leftLayout.addStretch()
self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn) self.PreviewGroupBox = QtGui.QGroupBox(self.rightColumn)
self.PreviewGroupBox.setObjectName(u'PreviewGroupBox') self.PreviewGroupBox.setObjectName(u'PreviewGroupBox')
@ -99,15 +95,13 @@ class AlertsTab(SettingsTab):
QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked) QtCore.SIGNAL(u'pressed()'), self.onFontColorButtonClicked)
QtCore.QObject.connect(self.FontComboBox, QtCore.QObject.connect(self.FontComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked) QtCore.SIGNAL(u'activated(int)'), self.onFontComboBoxClicked)
QtCore.QObject.connect(self.LocationComboBox,
QtCore.SIGNAL(u'activated(int)'), self.onLocationComboBoxClicked)
QtCore.QObject.connect(self.TimeoutSpinBox, QtCore.QObject.connect(self.TimeoutSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onTimeoutSpinBoxChanged)
QtCore.QObject.connect(self.FontSizeSpinBox, QtCore.QObject.connect(self.FontSizeSpinBox,
QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged) QtCore.SIGNAL(u'valueChanged(int)'), self.onFontSizeSpinBoxChanged)
def retranslateUi(self): def retranslateUi(self):
self.FontGroupBox.setTitle( self.fontGroupBox.setTitle(
translate('AlertsPlugin.AlertsTab', 'Font')) translate('AlertsPlugin.AlertsTab', 'Font'))
self.FontLabel.setText( self.FontLabel.setText(
translate('AlertsPlugin.AlertsTab', 'Font name:')) translate('AlertsPlugin.AlertsTab', 'Font name:'))
@ -123,18 +117,8 @@ class AlertsTab(SettingsTab):
translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) translate('AlertsPlugin.AlertsTab', 'Alert timeout:'))
self.TimeoutSpinBox.setSuffix( self.TimeoutSpinBox.setSuffix(
translate('AlertsPlugin.AlertsTab', 's')) translate('AlertsPlugin.AlertsTab', 's'))
self.LocationLabel.setText( self.PreviewGroupBox.setTitle(UiStrings.Preview)
translate('AlertsPlugin.AlertsTab', 'Location:')) self.FontPreview.setText(UiStrings.OLPV2)
self.PreviewGroupBox.setTitle(
translate('AlertsPlugin.AlertsTab', 'Preview'))
self.FontPreview.setText(
translate('AlertsPlugin.AlertsTab', 'OpenLP 2.0'))
self.LocationComboBox.setItemText(0,
translate('AlertsPlugin.AlertsTab', 'Top'))
self.LocationComboBox.setItemText(1,
translate('AlertsPlugin.AlertsTab', 'Middle'))
self.LocationComboBox.setItemText(2,
translate('AlertsPlugin.AlertsTab', 'Bottom'))
def onBackgroundColorButtonClicked(self): def onBackgroundColorButtonClicked(self):
new_color = QtGui.QColorDialog.getColor( new_color = QtGui.QColorDialog.getColor(
@ -148,9 +132,6 @@ class AlertsTab(SettingsTab):
def onFontComboBoxClicked(self): def onFontComboBoxClicked(self):
self.updateDisplay() self.updateDisplay()
def onLocationComboBoxClicked(self, location):
self.location = location
def onFontColorButtonClicked(self): def onFontColorButtonClicked(self):
new_color = QtGui.QColorDialog.getColor( new_color = QtGui.QColorDialog.getColor(
QtGui.QColor(self.font_color), self) QtGui.QColor(self.font_color), self)
@ -188,7 +169,7 @@ class AlertsTab(SettingsTab):
u'background-color: %s' % self.font_color) u'background-color: %s' % self.font_color)
self.BackgroundColorButton.setStyleSheet( self.BackgroundColorButton.setStyleSheet(
u'background-color: %s' % self.bg_color) u'background-color: %s' % self.bg_color)
self.LocationComboBox.setCurrentIndex(self.location) self.verticalComboBox.setCurrentIndex(self.location)
font = QtGui.QFont() font = QtGui.QFont()
font.setFamily(self.font_face) font.setFamily(self.font_face)
self.FontComboBox.setCurrentFont(font) self.FontComboBox.setCurrentFont(font)
@ -197,14 +178,14 @@ class AlertsTab(SettingsTab):
def save(self): def save(self):
settings = QtCore.QSettings() settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection) settings.beginGroup(self.settingsSection)
self.font_face = self.FontComboBox.currentFont().family()
settings.setValue(u'background color', QtCore.QVariant(self.bg_color)) settings.setValue(u'background color', QtCore.QVariant(self.bg_color))
settings.setValue(u'font color', QtCore.QVariant(self.font_color)) settings.setValue(u'font color', QtCore.QVariant(self.font_color))
settings.setValue(u'font size', QtCore.QVariant(self.font_size)) settings.setValue(u'font size', QtCore.QVariant(self.font_size))
self.font_face = self.FontComboBox.currentFont().family()
settings.setValue(u'font face', QtCore.QVariant(self.font_face)) settings.setValue(u'font face', QtCore.QVariant(self.font_face))
settings.setValue(u'timeout', QtCore.QVariant(self.timeout)) settings.setValue(u'timeout', QtCore.QVariant(self.timeout))
settings.setValue(u'location', self.location = self.verticalComboBox.currentIndex()
QtCore.QVariant(self.LocationComboBox.currentIndex())) settings.setValue(u'location', QtCore.QVariant(self.location))
settings.endGroup() settings.endGroup()
def updateDisplay(self): def updateDisplay(self):

View File

@ -29,6 +29,7 @@ import logging
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem from openlp.plugins.bibles.lib import BibleManager, BiblesTab, BibleMediaItem
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -137,38 +138,38 @@ class BiblePlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Import Action ## ## Import Action ##
self.textStrings[StringContent.Import] = { self.textStrings[StringContent.Import] = {
u'title': translate('BiblesPlugin', '&Import'), u'title': UiStrings.Import,
u'tooltip': translate('BiblesPlugin', 'Import a Bible') u'tooltip': translate('BiblesPlugin', 'Import a Bible')
} }
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('BiblesPlugin', '&Add'), u'title': UiStrings.Add,
u'tooltip': translate('BiblesPlugin', 'Add a new Bible') u'tooltip': translate('BiblesPlugin', 'Add a new Bible')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('BiblesPlugin', '&Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible') u'tooltip': translate('BiblesPlugin', 'Edit the selected Bible')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('BiblesPlugin', '&Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible') u'tooltip': translate('BiblesPlugin', 'Delete the selected Bible')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('BiblesPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible') u'tooltip': translate('BiblesPlugin', 'Preview the selected Bible')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('BiblesPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('BiblesPlugin', u'tooltip': translate('BiblesPlugin',
'Send the selected Bible live') 'Send the selected Bible live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('BiblesPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('BiblesPlugin', u'tooltip': translate('BiblesPlugin',
'Add the selected Bible to the service') 'Add the selected Bible to the service')
} }

View File

@ -35,7 +35,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.lib.db import delete_database from openlp.core.lib.db import delete_database
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.ui.wizard import OpenLPWizard from openlp.core.ui.wizard import OpenLPWizard
from openlp.core.utils import AppLocation, string_is_unicode from openlp.core.utils import AppLocation, string_is_unicode
from openlp.plugins.bibles.lib.manager import BibleFormat from openlp.plugins.bibles.lib.manager import BibleFormat
@ -745,8 +745,7 @@ class BibleImportForm(OpenLPWizard):
""" """
if filters: if filters:
filters += u';;' filters += u';;'
filters += u'%s (*)' % translate('BiblesPlugin.ImportWizardForm', filters += u'%s (*)' % UiStrings.AllFiles
'All Files')
filename = QtGui.QFileDialog.getOpenFileName(self, title, filename = QtGui.QFileDialog.getOpenFileName(self, title,
os.path.dirname(SettingsManager.get_last_dir( os.path.dirname(SettingsManager.get_last_dir(
self.plugin.settingsSection, 1)), filters) self.plugin.settingsSection, 1)), filters)

View File

@ -30,6 +30,7 @@ from forms import EditCustomForm
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.db import Manager from openlp.core.lib.db import Manager
from openlp.core.lib.ui import UiStrings
from openlp.plugins.custom.lib import CustomMediaItem, CustomTab from openlp.plugins.custom.lib import CustomMediaItem, CustomTab
from openlp.plugins.custom.lib.db import CustomSlide, init_schema from openlp.plugins.custom.lib.db import CustomSlide, init_schema
@ -114,49 +115,49 @@ class CustomPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Import Action ## ## Import Action ##
self.textStrings[StringContent.Import] = { self.textStrings[StringContent.Import] = {
u'title': translate('CustomsPlugin', 'Import'), u'title': UiStrings.Import,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Import a Custom') 'Import a Custom')
} }
## Load Action ## ## Load Action ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('CustomsPlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Load a new Custom') 'Load a new Custom')
} }
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('CustomsPlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Add a new Custom') 'Add a new Custom')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('CustomsPlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Edit the selected Custom') 'Edit the selected Custom')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('CustomsPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Delete the selected Custom') 'Delete the selected Custom')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('CustomsPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Preview the selected Custom') 'Preview the selected Custom')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('CustomsPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Send the selected Custom live') 'Send the selected Custom live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('CustomsPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('CustomsPlugin', u'tooltip': translate('CustomsPlugin',
'Add the selected Custom to the service') 'Add the selected Custom to the service')
} }

View File

@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import create_save_cancel_button_box, \ from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box, \
create_delete_push_button, create_up_down_push_button_set create_delete_push_button, create_up_down_push_button_set
class Ui_CustomEditDialog(object): class Ui_CustomEditDialog(object):
@ -107,13 +107,11 @@ class Ui_CustomEditDialog(object):
translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides')) translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides'))
self.titleLabel.setText( self.titleLabel.setText(
translate('CustomPlugin.EditCustomForm', '&Title:')) translate('CustomPlugin.EditCustomForm', '&Title:'))
self.addButton.setText( self.addButton.setText(UiStrings.Add)
translate('CustomPlugin.EditCustomForm', '&Add'))
self.addButton.setToolTip( self.addButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Add a new slide at ' translate('CustomPlugin.EditCustomForm', 'Add a new slide at '
'bottom.')) 'bottom.'))
self.editButton.setText( self.editButton.setText(UiStrings.Edit)
translate('CustomPlugin.EditCustomForm', '&Edit'))
self.editButton.setToolTip( self.editButton.setToolTip(
translate('CustomPlugin.EditCustomForm', 'Edit the selected ' translate('CustomPlugin.EditCustomForm', 'Edit the selected '
'slide.')) 'slide.'))

View File

@ -27,6 +27,7 @@
import logging import logging
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.plugins.images.lib import ImageMediaItem from openlp.plugins.images.lib import ImageMediaItem
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -74,43 +75,43 @@ class ImagePlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Load Button ## ## Load Button ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('ImagePlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Load a new Image') 'Load a new Image')
} }
## New Button ## ## New Button ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('ImagePlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Add a new Image') 'Add a new Image')
} }
## Edit Button ## ## Edit Button ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('ImagePlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Edit the selected Image') 'Edit the selected Image')
} }
## Delete Button ## ## Delete Button ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('ImagePlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Delete the selected Image') 'Delete the selected Image')
} }
## Preview ## ## Preview ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('ImagePlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Preview the selected Image') 'Preview the selected Image')
} }
## Live Button ## ## Live Button ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('ImagePlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Send the selected Image live') 'Send the selected Image live')
} }
## Add to service Button ## ## Add to service Button ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('ImagePlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('ImagePlugin', u'tooltip': translate('ImagePlugin',
'Add the selected Image to the service') 'Add the selected Image to the service')
} }

View File

@ -32,7 +32,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, translate, check_item_selected, \ ItemCapabilities, SettingsManager, translate, check_item_selected, \
check_directory_exists, Receiver check_directory_exists, Receiver
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.utils import AppLocation, delete_file, get_images_filter from openlp.core.utils import AppLocation, delete_file, get_images_filter
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -64,7 +64,7 @@ class ImageMediaItem(MediaManagerItem):
'Select Image(s)') 'Select Image(s)')
file_formats = get_images_filter() file_formats = get_images_filter()
self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats, self.OnNewFileMasks = u'%s;;%s (*.*) (*)' % (file_formats,
unicode(translate('ImagePlugin.MediaItem', 'All Files'))) unicode(UiStrings.AllFiles))
self.replaceAction.setText( self.replaceAction.setText(
translate('ImagePlugin.MediaItem', 'Replace Background')) translate('ImagePlugin.MediaItem', 'Replace Background'))
self.replaceAction.setToolTip( self.replaceAction.setToolTip(

View File

@ -30,6 +30,7 @@ import mimetypes
from PyQt4.phonon import Phonon from PyQt4.phonon import Phonon
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.plugins.media.lib import MediaMediaItem, MediaTab from openlp.plugins.media.lib import MediaMediaItem, MediaTab
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -103,43 +104,43 @@ class MediaPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Load Action ## ## Load Action ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('MediaPlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Load a new Media') 'Load a new Media')
} }
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('MediaPlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Add a new Media') 'Add a new Media')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('MediaPlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Edit the selected Media') 'Edit the selected Media')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('MediaPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Delete the selected Media') 'Delete the selected Media')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('MediaPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Preview the selected Media') 'Preview the selected Media')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('MediaPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Send the selected Media live') 'Send the selected Media live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('MediaPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('MediaPlugin', u'tooltip': translate('MediaPlugin',
'Add the selected Media to the service') 'Add the selected Media to the service')
} }

View File

@ -31,6 +31,7 @@ import os
import logging import logging
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.ui import UiStrings
from openlp.core.utils import AppLocation from openlp.core.utils import AppLocation
from openlp.plugins.presentations.lib import PresentationController, \ from openlp.plugins.presentations.lib import PresentationController, \
PresentationMediaItem, PresentationTab PresentationMediaItem, PresentationTab
@ -169,31 +170,31 @@ class PresentationPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## Load Action ## ## Load Action ##
self.textStrings[StringContent.Load] = { self.textStrings[StringContent.Load] = {
u'title': translate('PresentationPlugin', 'Load'), u'title': UiStrings.Load,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Load a new Presentation') 'Load a new Presentation')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('PresentationPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Delete the selected Presentation') 'Delete the selected Presentation')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('PresentationPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Preview the selected Presentation') 'Preview the selected Presentation')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('PresentationPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Send the selected Presentation live') 'Send the selected Presentation live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('PresentationPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('PresentationPlugin', u'tooltip': translate('PresentationPlugin',
'Add the selected Presentation to the service') 'Add the selected Presentation to the service')
} }

View File

@ -27,7 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import create_save_cancel_button_box from openlp.core.lib.ui import UiStrings, create_save_cancel_button_box
class Ui_EditSongDialog(object): class Ui_EditSongDialog(object):
def setupUi(self, editSongDialog): def setupUi(self, editSongDialog):
@ -257,19 +257,15 @@ class Ui_EditSongDialog(object):
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(UiStrings.Add)
translate('SongsPlugin.EditSongForm', '&Add')) self.verseEditButton.setText(UiStrings.Edit)
self.verseEditButton.setText(
translate('SongsPlugin.EditSongForm', '&Edit'))
self.verseEditAllButton.setText( self.verseEditAllButton.setText(
translate('SongsPlugin.EditSongForm', 'Ed&it All')) translate('SongsPlugin.EditSongForm', 'Ed&it All'))
self.verseDeleteButton.setText( self.verseDeleteButton.setText(UiStrings.Delete)
translate('SongsPlugin.EditSongForm', '&Delete'))
self.songTabWidget.setTabText( self.songTabWidget.setTabText(
self.songTabWidget.indexOf(self.lyricsTab), self.songTabWidget.indexOf(self.lyricsTab),
translate('SongsPlugin.EditSongForm', 'Title && Lyrics')) translate('SongsPlugin.EditSongForm', 'Title && Lyrics'))
self.authorsGroupBox.setTitle( self.authorsGroupBox.setTitle(UiStrings.Authors)
translate('SongsPlugin.EditSongForm', 'Authors'))
self.authorAddButton.setText( self.authorAddButton.setText(
translate('SongsPlugin.EditSongForm', '&Add to Song')) translate('SongsPlugin.EditSongForm', '&Add to Song'))
self.authorRemoveButton.setText( self.authorRemoveButton.setText(
@ -292,8 +288,7 @@ class Ui_EditSongDialog(object):
self.songTabWidget.indexOf(self.authorsTab), self.songTabWidget.indexOf(self.authorsTab),
translate('SongsPlugin.EditSongForm', translate('SongsPlugin.EditSongForm',
'Authors, Topics && Song Book')) 'Authors, Topics && Song Book'))
self.themeGroupBox.setTitle( self.themeGroupBox.setTitle(UiStrings.Theme)
translate('SongsPlugin.EditSongForm', 'Theme'))
self.themeAddButton.setText( self.themeAddButton.setText(
translate('SongsPlugin.EditSongForm', 'New &Theme')) translate('SongsPlugin.EditSongForm', 'New &Theme'))
self.rightsGroupBox.setTitle( self.rightsGroupBox.setTitle(

View File

@ -32,7 +32,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import Receiver, SettingsManager, translate from openlp.core.lib import Receiver, SettingsManager, translate
from openlp.core.lib.ui import critical_error_message_box from openlp.core.lib.ui import UiStrings, critical_error_message_box
from openlp.core.ui.wizard import OpenLPWizard from openlp.core.ui.wizard import OpenLPWizard
from openlp.plugins.songs.lib.importer import SongFormat from openlp.plugins.songs.lib.importer import SongFormat
@ -215,8 +215,7 @@ class SongImportForm(OpenLPWizard):
'Select the import format, and where to import from.')) 'Select the import format, and where to import from.'))
self.formatLabel.setText( self.formatLabel.setText(
translate('SongsPlugin.ImportWizardForm', 'Format:')) translate('SongsPlugin.ImportWizardForm', 'Format:'))
self.formatComboBox.setItemText(0, self.formatComboBox.setItemText(0, UiStrings.OLPV2)
translate('SongsPlugin.ImportWizardForm', 'OpenLP 2.0'))
self.formatComboBox.setItemText(1, self.formatComboBox.setItemText(1,
translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x')) translate('SongsPlugin.ImportWizardForm', 'openlp.org 1.x'))
self.formatComboBox.setItemText(2, self.formatComboBox.setItemText(2,
@ -489,8 +488,7 @@ class SongImportForm(OpenLPWizard):
""" """
if filters: if filters:
filters += u';;' filters += u';;'
filters += u'%s (*)' % translate('SongsPlugin.ImportWizardForm', filters += u'%s (*)' % UiStrings.AllFiles
'All Files')
filenames = QtGui.QFileDialog.getOpenFileNames(self, title, filenames = QtGui.QFileDialog.getOpenFileNames(self, title,
SettingsManager.get_last_dir(self.plugin.settingsSection, 1), SettingsManager.get_last_dir(self.plugin.settingsSection, 1),
filters) filters)

View File

@ -27,6 +27,7 @@
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import build_icon, translate from openlp.core.lib import build_icon, translate
from openlp.core.lib.ui import UiStrings
class Ui_SongMaintenanceDialog(object): class Ui_SongMaintenanceDialog(object):
def setupUi(self, songMaintenanceDialog): def setupUi(self, songMaintenanceDialog):
@ -145,30 +146,21 @@ class Ui_SongMaintenanceDialog(object):
def retranslateUi(self, songMaintenanceDialog): def retranslateUi(self, songMaintenanceDialog):
songMaintenanceDialog.setWindowTitle( songMaintenanceDialog.setWindowTitle(
translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance')) translate('SongsPlugin.SongMaintenanceForm', 'Song Maintenance'))
authorsString = translate('SongsPlugin.SongMaintenanceForm', 'Authors') authorsString = UiStrings.Authors
topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics') topicsString = translate('SongsPlugin.SongMaintenanceForm', 'Topics')
booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books') booksString = translate('SongsPlugin.SongMaintenanceForm', 'Song Books')
self.listItemAuthors.setText(authorsString) self.listItemAuthors.setText(authorsString)
self.listItemTopics.setText(topicsString) self.listItemTopics.setText(topicsString)
self.listItemBooks.setText(booksString) self.listItemBooks.setText(booksString)
self.authorsAddButton.setText( self.authorsAddButton.setText(UiStrings.Add)
translate('SongsPlugin.SongMaintenanceForm', '&Add')) self.authorsEditButton.setText(UiStrings.Edit)
self.authorsEditButton.setText( self.authorsDeleteButton.setText(UiStrings.Delete)
translate('SongsPlugin.SongMaintenanceForm', '&Edit')) self.topicsAddButton.setText(UiStrings.Add)
self.authorsDeleteButton.setText( self.topicsEditButton.setText(UiStrings.Edit)
translate('SongsPlugin.SongMaintenanceForm', '&Delete')) self.topicsDeleteButton.setText(UiStrings.Delete)
self.topicsAddButton.setText( self.booksAddButton.setText(UiStrings.Add)
translate('SongsPlugin.SongMaintenanceForm', '&Add')) self.booksEditButton.setText(UiStrings.Edit)
self.topicsEditButton.setText( self.booksDeleteButton.setText(UiStrings.Delete)
translate('SongsPlugin.SongMaintenanceForm', '&Edit'))
self.topicsDeleteButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Delete'))
self.booksAddButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Add'))
self.booksEditButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Edit'))
self.booksDeleteButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Delete'))
typeListWidth = max(self.fontMetrics().width(authorsString), typeListWidth = max(self.fontMetrics().width(authorsString),
self.fontMetrics().width(topicsString), self.fontMetrics().width(topicsString),
self.fontMetrics().width(booksString)) self.fontMetrics().width(booksString))

View File

@ -81,14 +81,14 @@ class EasiSlidesImport(SongImport):
def _parse_song(self, song): def _parse_song(self, song):
self._success = True self._success = True
self._add_title(self.title, song.Title1, True) self._add_unicode_attribute(self.title, song.Title1, True)
self._add_alttitle(self.alternate_title, song.Title2) self._add_unicode_attribute(self.alternate_title, song.Title2)
self._add_number(self.song_number, song.SongNumber) self._add_unicode_attribute(self.song_number, song.SongNumber)
if self.song_number == u'0': if self.song_number == u'0':
self.song_number = u'' self.song_number = u''
self._add_authors(song) self._add_authors(song)
self._add_copyright(song) self._add_copyright(song)
self._add_book(self.song_book_name, song.BookReference) self._add_unicode_attribute(self.song_book_name, song.BookReference)
self._parse_and_add_lyrics(song) self._parse_and_add_lyrics(song)
return self._success return self._success

View File

@ -33,6 +33,7 @@ from sqlalchemy.sql import or_
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, Receiver, \
ItemCapabilities, translate, check_item_selected, PluginStatus ItemCapabilities, translate, check_item_selected, PluginStatus
from openlp.core.lib.ui import UiStrings
from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \ from openlp.plugins.songs.forms import EditSongForm, SongMaintenanceForm, \
SongImportForm, SongExportForm SongImportForm, SongExportForm
from openlp.plugins.songs.lib import OpenLyrics, SongXML from openlp.plugins.songs.lib import OpenLyrics, SongXML
@ -147,10 +148,8 @@ class SongMediaItem(MediaManagerItem):
translate('SongsPlugin.MediaItem', 'Titles')), translate('SongsPlugin.MediaItem', 'Titles')),
(3, u':/songs/song_search_lyrics.png', (3, u':/songs/song_search_lyrics.png',
translate('SongsPlugin.MediaItem', 'Lyrics')), translate('SongsPlugin.MediaItem', 'Lyrics')),
(4, u':/songs/song_search_author.png', (4, u':/songs/song_search_author.png', UiStrings.Authors),
translate('SongsPlugin.MediaItem', 'Authors')), (5, u':/slides/slide_theme.png', UiStrings.Themes)
(5, u':/slides/slide_theme.png',
translate('SongsPlugin.MediaItem', 'Themes'))
]) ])
self.configUpdated() self.configUpdated()

View File

@ -31,6 +31,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import Plugin, StringContent, build_icon, translate from openlp.core.lib import Plugin, StringContent, build_icon, translate
from openlp.core.lib.db import Manager 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 import SongMediaItem, SongsTab, SongXML
from openlp.plugins.songs.lib.db import init_schema, Song from openlp.plugins.songs.lib.db import init_schema, Song
from openlp.plugins.songs.lib.importer import SongFormat from openlp.plugins.songs.lib.importer import SongFormat
@ -240,37 +241,37 @@ class SongsPlugin(Plugin):
# Middle Header Bar # Middle Header Bar
## New Action ## ## New Action ##
self.textStrings[StringContent.New] = { self.textStrings[StringContent.New] = {
u'title': translate('SongsPlugin', 'Add'), u'title': UiStrings.Add,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Add a new Song') 'Add a new Song')
} }
## Edit Action ## ## Edit Action ##
self.textStrings[StringContent.Edit] = { self.textStrings[StringContent.Edit] = {
u'title': translate('SongsPlugin', 'Edit'), u'title': UiStrings.Edit,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Edit the selected Song') 'Edit the selected Song')
} }
## Delete Action ## ## Delete Action ##
self.textStrings[StringContent.Delete] = { self.textStrings[StringContent.Delete] = {
u'title': translate('SongsPlugin', 'Delete'), u'title': UiStrings.Delete,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Delete the selected Song') 'Delete the selected Song')
} }
## Preview Action ## ## Preview Action ##
self.textStrings[StringContent.Preview] = { self.textStrings[StringContent.Preview] = {
u'title': translate('SongsPlugin', 'Preview'), u'title': UiStrings.Preview,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Preview the selected Song') 'Preview the selected Song')
} }
## Send Live Action ## ## Send Live Action ##
self.textStrings[StringContent.Live] = { self.textStrings[StringContent.Live] = {
u'title': translate('SongsPlugin', 'Live'), u'title': UiStrings.Live,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Send the selected Song live') 'Send the selected Song live')
} }
## Add to Service Action ## ## Add to Service Action ##
self.textStrings[StringContent.Service] = { self.textStrings[StringContent.Service] = {
u'title': translate('SongsPlugin', 'Service'), u'title': UiStrings.Service,
u'tooltip': translate('SongsPlugin', u'tooltip': translate('SongsPlugin',
'Add the selected Song to the service') 'Add the selected Song to the service')
} }