forked from openlp/openlp
Remove Media dynamic backgrounds for now.
Clean up Media, Image and Custom translate strings
This commit is contained in:
parent
c5a35e8354
commit
18a32a2217
@ -131,7 +131,7 @@ class Ui_customEditDialog(object):
|
||||
self.horizontalLayout_2.addWidget(self.CreditEdit)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
|
||||
self.buttonBox = QtGui.QDialogButtonBox(customEditDialog)
|
||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
|
||||
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel |
|
||||
QtGui.QDialogButtonBox.Save)
|
||||
self.buttonBox.setObjectName(u'buttonBox')
|
||||
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1)
|
||||
@ -156,43 +156,43 @@ class Ui_customEditDialog(object):
|
||||
|
||||
def retranslateUi(self, customEditDialog):
|
||||
customEditDialog.setWindowTitle(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit Custom Slides'))
|
||||
self.UpButton.setToolTip(translate(u'CustomPlugin.EditCustomForm'
|
||||
u'CustomPlugin.EditCustomForm', u'Move slide Up 1'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Edit Custom Slides'))
|
||||
self.UpButton.setToolTip(
|
||||
translate('CustomPlugin.EditCustomForm', 'Move slide Up 1'))
|
||||
self.DownButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Move slide down 1'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Move slide down 1'))
|
||||
self.TitleLabel.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Title:'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Title:'))
|
||||
self.AddButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Add New'))
|
||||
self.AddButton.setToolTip(translate(u'CustomPlugin.EditCustomForm',
|
||||
u'Add new slide at bottom'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Add New'))
|
||||
self.AddButton.setToolTip(
|
||||
translate('CustomPlugin.EditCustomForm', 'Add new slide at bottom'))
|
||||
self.EditButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Edit'))
|
||||
self.EditButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit selected slide'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Edit selected slide'))
|
||||
self.EditAllButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit All'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Edit All'))
|
||||
self.EditAllButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Edit all slides'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Edit all slides'))
|
||||
self.SaveButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Save'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Save'))
|
||||
self.SaveButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Replace edited slide'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Replace edited slide'))
|
||||
self.DeleteButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Delete'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Delete'))
|
||||
self.DeleteButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Delete selected slide'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Delete selected slide'))
|
||||
self.ClearButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Clear'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Clear'))
|
||||
self.ClearButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Clear edit area'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Clear edit area'))
|
||||
self.SplitButton.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Split Slide'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Split Slide'))
|
||||
self.SplitButton.setToolTip(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Add slide split'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Add slide split'))
|
||||
self.ThemeLabel.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Theme:'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Theme:'))
|
||||
self.CreditLabel.setText(
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Credits:'))
|
||||
translate('CustomPlugin.EditCustomForm', 'Credits:'))
|
||||
|
||||
|
@ -47,8 +47,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
self.setupUi(self)
|
||||
# Connecting signals and slots
|
||||
self.previewButton = QtGui.QPushButton()
|
||||
self.previewButton.setText(translate(u'CustomPlugin.EditCustomForm',
|
||||
u'Save && Preview'))
|
||||
self.previewButton.setText(
|
||||
translate('CustomPlugin.EditCustomForm', 'Save && Preview'))
|
||||
self.buttonBox.addButton(
|
||||
self.previewButton, QtGui.QDialogButtonBox.ActionRole)
|
||||
QtCore.QObject.connect(self.buttonBox,
|
||||
@ -85,8 +85,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
|
||||
def onPreview(self, button):
|
||||
log.debug(u'onPreview')
|
||||
if button.text() == unicode(translate(u'CustomPlugin.EditCustomForm',
|
||||
u'Save && Preview')) \
|
||||
if button.text() == \
|
||||
unicode(translate('CustomPlugin.EditCustomForm', 'Save && Preview')) \
|
||||
and self.saveCustom():
|
||||
Receiver.send_message(u'custom_preview')
|
||||
|
||||
@ -149,8 +149,8 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
def saveCustom(self):
|
||||
valid, message = self._validate()
|
||||
if not valid:
|
||||
QtGui.QMessageBox.critical(self,
|
||||
translate(u'CustomPlugin.EditCustomForm', u'Error'), message,
|
||||
QtGui.QMessageBox.critical(self,
|
||||
translate('CustomPlugin.EditCustomForm', 'Error'), message,
|
||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||
return False
|
||||
sxml = SongXMLBuilder()
|
||||
@ -269,15 +269,15 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog):
|
||||
def _validate(self):
|
||||
if len(self.TitleEdit.displayText()) == 0:
|
||||
self.TitleEdit.setFocus()
|
||||
return False, translate(u'CustomPlugin.EditCustomForm',
|
||||
u'You need to enter a title')
|
||||
return False, translate('CustomPlugin.EditCustomForm',
|
||||
'You need to enter a title')
|
||||
# must have 1 slide
|
||||
if self.VerseListView.count() == 0:
|
||||
self.VerseTextEdit.setFocus()
|
||||
return False, translate(u'CustomPlugin.EditCustomForm',
|
||||
u'You need to enter a slide')
|
||||
return False, translate('CustomPlugin.EditCustomForm',
|
||||
'You need to enter a slide')
|
||||
if self.VerseTextEdit.toPlainText():
|
||||
self.VerseTextEdit.setFocus()
|
||||
return False, translate(u'CustomPlugin.editCustomForm',
|
||||
u'You have unsaved data, please save or clear')
|
||||
return False, translate('CustomPlugin.editCustomForm',
|
||||
'You have unsaved data, please save or clear')
|
||||
return True, u''
|
||||
|
@ -56,12 +56,12 @@ class ImagePlugin(Plugin):
|
||||
return ImageMediaItem(self, self.icon, self.name)
|
||||
|
||||
def about(self):
|
||||
about_text = translate(u'ImagePlugin', u'<b>Image Plugin'
|
||||
u'</b><br>Allows images of all types to be displayed. If a number '
|
||||
u'of images are selected together and presented on the live '
|
||||
u'controller it is possible to turn them into a timed loop.<br<br>'
|
||||
u'From the plugin if the <i>Override background</i> is chosen and '
|
||||
u'an image is selected any songs which are rendered will use the '
|
||||
u'selected image from the background instead of the one provied by '
|
||||
u'the theme.<br>')
|
||||
about_text = translate('ImagePlugin', '<b>Image Plugin'
|
||||
'</b><br>Allows images of all types to be displayed. If a number '
|
||||
'of images are selected together and presented on the live '
|
||||
'controller it is possible to turn them into a timed loop.<br<br>'
|
||||
'From the plugin if the <i>Override background</i> is chosen and '
|
||||
'an image is selected any songs which are rendered will use the '
|
||||
'selected image from the background instead of the one provied by '
|
||||
'the theme.<br>')
|
||||
return about_text
|
||||
|
@ -36,7 +36,7 @@ class ImageTab(SettingsTab):
|
||||
|
||||
def setupUi(self):
|
||||
self.setObjectName(u'ImageTab')
|
||||
self.tabTitleVisible = translate(u'ImagePlugin.ImageTab', u'Images')
|
||||
self.tabTitleVisible = translate('ImagePlugin.ImageTab', 'Images')
|
||||
self.ImageLayout = QtGui.QFormLayout(self)
|
||||
self.ImageLayout.setObjectName(u'ImageLayout')
|
||||
self.ImageSettingsGroupBox = QtGui.QGroupBox(self)
|
||||
@ -64,11 +64,11 @@ class ImageTab(SettingsTab):
|
||||
|
||||
def retranslateUi(self):
|
||||
self.ImageSettingsGroupBox.setTitle(
|
||||
translate(u'ImagePlugin.ImageTab', u'Image Settings'))
|
||||
translate('ImagePlugin.ImageTab', 'Image Settings'))
|
||||
self.TimeoutLabel.setText(
|
||||
translate(u'ImagePlugin.ImageTab', u'Slide Loop Delay:'))
|
||||
translate('ImagePlugin.ImageTab', 'Slide Loop Delay:'))
|
||||
self.TimeoutSpinBox.setSuffix(
|
||||
translate(u'ImagePlugin.ImageTab', u'sec'))
|
||||
translate('ImagePlugin.ImageTab', 'sec'))
|
||||
|
||||
def onTimeoutSpinBoxChanged(self):
|
||||
self.loop_delay = self.TimeoutSpinBox.value()
|
||||
@ -82,9 +82,9 @@ class ImageTab(SettingsTab):
|
||||
def save(self):
|
||||
QtCore.QSettings().setValue(self.settingsSection + u'/loop delay',
|
||||
QtCore.QVariant(self.loop_delay))
|
||||
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
||||
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
||||
self.loop_delay)
|
||||
|
||||
def postSetUp(self):
|
||||
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
||||
Receiver.send_message(u'slidecontroller_live_spin_delay',
|
||||
self.loop_delay)
|
||||
|
@ -56,17 +56,17 @@ class ImageMediaItem(MediaManagerItem):
|
||||
MediaManagerItem.__init__(self, parent, icon, title)
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate(u'ImagePlugin.MediaItem', u'Image')
|
||||
self.PluginNameVisible = translate('ImagePlugin.MediaItem', 'Image')
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = translate(u'ImagePlugin.MediaItem',
|
||||
u'Select Image(s)')
|
||||
self.OnNewPrompt = translate('ImagePlugin.MediaItem',
|
||||
'Select Image(s)')
|
||||
file_formats = u''
|
||||
for file_format in QtGui.QImageReader.supportedImageFormats():
|
||||
file_formats += u'*.%s ' % file_format
|
||||
self.OnNewFileMasks = unicode(
|
||||
translate(u'ImagePlugin.MediaItem',
|
||||
u'Images (%s);; All files (*)')) % file_formats
|
||||
translate('ImagePlugin.MediaItem',
|
||||
'Images (%s);; All files (*)')) % file_formats
|
||||
|
||||
def requiredIcons(self):
|
||||
MediaManagerItem.requiredIcons(self)
|
||||
@ -95,7 +95,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
self.ListView.addAction(
|
||||
context_menu_action(
|
||||
self.ListView, u':/slides/slide_blank.png',
|
||||
translate(u'ImagePlugin.MediaItem', u'Replace Live Background'),
|
||||
translate('ImagePlugin.MediaItem', 'Replace Live Background'),
|
||||
self.onReplaceClick))
|
||||
|
||||
def addEndHeaderBar(self):
|
||||
@ -110,7 +110,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
self.ImageWidget.setObjectName(u'ImageWidget')
|
||||
self.blankButton = self.Toolbar.addToolbarButton(
|
||||
u'Replace Background', u':/slides/slide_blank.png',
|
||||
translate(u'ImagePlugin.MediaItem', u'Replace Live Background'),
|
||||
translate('ImagePlugin.MediaItem', 'Replace Live Background'),
|
||||
self.onReplaceClick, False)
|
||||
# Add the song widget to the page layout
|
||||
self.PageLayout.addWidget(self.ImageWidget)
|
||||
@ -119,8 +119,8 @@ class ImageMediaItem(MediaManagerItem):
|
||||
"""
|
||||
Remove an image item from the list
|
||||
"""
|
||||
if self.checkItemSelected(translate(u'ImagePlugin.MediaItem',
|
||||
u'You must select an item to delete.')):
|
||||
if self.checkItemSelected(translate('ImagePlugin.MediaItem',
|
||||
'You must select an item to delete.')):
|
||||
items = self.ListView.selectedIndexes()
|
||||
for item in items:
|
||||
text = self.ListView.item(item.row())
|
||||
@ -155,7 +155,7 @@ class ImageMediaItem(MediaManagerItem):
|
||||
items = self.ListView.selectedIndexes()
|
||||
if items:
|
||||
service_item.title = unicode(
|
||||
translate(u'ImagePlugin.MediaItem', u'Image(s)'))
|
||||
translate('ImagePlugin.MediaItem', 'Image(s)'))
|
||||
service_item.add_capability(ItemCapabilities.AllowsMaintain)
|
||||
service_item.add_capability(ItemCapabilities.AllowsPreview)
|
||||
service_item.add_capability(ItemCapabilities.AllowsLoop)
|
||||
@ -173,9 +173,9 @@ class ImageMediaItem(MediaManagerItem):
|
||||
def onReplaceClick(self):
|
||||
if not self.ListView.selectedIndexes():
|
||||
QtGui.QMessageBox.information(self,
|
||||
translate(u'ImagePlugin.MediaItem', u'No item selected'),
|
||||
translate(u'ImagePlugin.MediaItem',
|
||||
u'You must select one item'))
|
||||
translate('ImagePlugin.MediaItem', 'No item selected'),
|
||||
translate('ImagePlugin.MediaItem',
|
||||
'You must select one item'))
|
||||
items = self.ListView.selectedIndexes()
|
||||
for item in items:
|
||||
bitem = self.ListView.item(item.row())
|
||||
|
@ -58,11 +58,11 @@ class MediaMediaItem(MediaManagerItem):
|
||||
self.ServiceItemIconName = u':/media/media_video.png'
|
||||
|
||||
def initPluginNameVisible(self):
|
||||
self.PluginNameVisible = translate(u'MediaPlugin.MediaItem', u'Media')
|
||||
self.PluginNameVisible = translate('MediaPlugin.MediaItem', 'Media')
|
||||
|
||||
def retranslateUi(self):
|
||||
self.OnNewPrompt = translate(u'MediaPlugin.MediaItem', u'Select Media')
|
||||
self.OnNewFileMasks = translate(u'MediaPlugin.MediaItem',
|
||||
self.OnNewPrompt = translate('MediaPlugin.MediaItem', 'Select Media')
|
||||
self.OnNewFileMasks = translate('MediaPlugin.MediaItem',
|
||||
u'Videos (%s);;'
|
||||
u'Audio (%s);;'
|
||||
u'All files (*)' % (self.parent.video_list, self.parent.audio_list))
|
||||
@ -73,13 +73,13 @@ class MediaMediaItem(MediaManagerItem):
|
||||
self.hasNewIcon = False
|
||||
self.hasEditIcon = False
|
||||
|
||||
def addListViewToToolBar(self):
|
||||
MediaManagerItem.addListViewToToolBar(self)
|
||||
self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
||||
self.ListView.addAction(
|
||||
context_menu_action(self.ListView, u':/slides/slide_blank.png',
|
||||
translate(u'MediaPlugin.MediaItem', u'Replace Live Background'),
|
||||
self.onReplaceClick))
|
||||
# def addListViewToToolBar(self):
|
||||
# MediaManagerItem.addListViewToToolBar(self)
|
||||
# self.ListView.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)
|
||||
# self.ListView.addAction(
|
||||
# context_menu_action(self.ListView, u':/slides/slide_blank.png',
|
||||
# translate('MediaPlugin.MediaItem', 'Replace Live Background'),
|
||||
# self.onReplaceClick))
|
||||
|
||||
def addEndHeaderBar(self):
|
||||
self.ImageWidget = QtGui.QWidget(self)
|
||||
@ -91,29 +91,30 @@ class MediaMediaItem(MediaManagerItem):
|
||||
self.ImageWidget.sizePolicy().hasHeightForWidth())
|
||||
self.ImageWidget.setSizePolicy(sizePolicy)
|
||||
self.ImageWidget.setObjectName(u'ImageWidget')
|
||||
self.blankButton = self.Toolbar.addToolbarButton(
|
||||
u'Replace Background', u':/slides/slide_blank.png',
|
||||
translate(u'MediaPlugin.MediaItem', u'Replace Live Background'),
|
||||
self.onReplaceClick, False)
|
||||
#Replace backgrounds do not work at present so remove functionality.
|
||||
# self.blankButton = self.Toolbar.addToolbarButton(
|
||||
# u'Replace Background', u':/slides/slide_blank.png',
|
||||
# translate('MediaPlugin.MediaItem', 'Replace Live Background'),
|
||||
# self.onReplaceClick, False)
|
||||
# Add the song widget to the page layout
|
||||
self.PageLayout.addWidget(self.ImageWidget)
|
||||
|
||||
def onReplaceClick(self):
|
||||
if self.background:
|
||||
self.background = False
|
||||
Receiver.send_message(u'videodisplay_stop')
|
||||
else:
|
||||
self.background = True
|
||||
if not self.ListView.selectedIndexes():
|
||||
QtGui.QMessageBox.information(self,
|
||||
translate(u'MediaPlugin.MediaItem', u'No item selected'),
|
||||
translate(u'MediaPlugin.MediaItem',
|
||||
u'You must select one item'))
|
||||
items = self.ListView.selectedIndexes()
|
||||
for item in items:
|
||||
bitem = self.ListView.item(item.row())
|
||||
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
|
||||
Receiver.send_message(u'videodisplay_background', filename)
|
||||
# def onReplaceClick(self):
|
||||
# if self.background:
|
||||
# self.background = False
|
||||
# Receiver.send_message(u'videodisplay_stop')
|
||||
# else:
|
||||
# self.background = True
|
||||
# if not self.ListView.selectedIndexes():
|
||||
# QtGui.QMessageBox.information(self,
|
||||
# translate('MediaPlugin.MediaItem', 'No item selected'),
|
||||
# translate('MediaPlugin.MediaItem',
|
||||
# 'You must select one item'))
|
||||
# items = self.ListView.selectedIndexes()
|
||||
# for item in items:
|
||||
# bitem = self.ListView.item(item.row())
|
||||
# filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
|
||||
# Receiver.send_message(u'videodisplay_background', filename)
|
||||
|
||||
def generateSlideData(self, service_item, item=None):
|
||||
if item is None:
|
||||
@ -122,7 +123,7 @@ class MediaMediaItem(MediaManagerItem):
|
||||
return False
|
||||
filename = unicode(item.data(QtCore.Qt.UserRole).toString())
|
||||
service_item.title = unicode(
|
||||
translate(u'MediaPlugin.MediaItem', u'Media'))
|
||||
translate('MediaPlugin.MediaItem', 'Media'))
|
||||
service_item.add_capability(ItemCapabilities.RequiresMedia)
|
||||
frame = u':/media/image_clapperboard.png'
|
||||
(path, name) = os.path.split(filename)
|
||||
@ -140,8 +141,8 @@ class MediaMediaItem(MediaManagerItem):
|
||||
"""
|
||||
Remove a media item from the list
|
||||
"""
|
||||
if self.checkItemSelected(translate(u'MediaPlugin.MediaItem',
|
||||
u'You must select an item to delete.')):
|
||||
if self.checkItemSelected(translate('MediaPlugin.MediaItem',
|
||||
'You must select an item to delete.')):
|
||||
item = self.ListView.currentItem()
|
||||
row = self.ListView.row(item)
|
||||
self.ListView.takeItem(row)
|
||||
|
@ -81,8 +81,8 @@ class MediaPlugin(Plugin):
|
||||
return MediaMediaItem(self, self.icon, self.name)
|
||||
|
||||
def about(self):
|
||||
about_text = translate(u'MediaPlugin',
|
||||
u'<b>Media Plugin</b><br>This plugin '
|
||||
u'allows the playing of audio and video media')
|
||||
about_text = translate('MediaPlugin',
|
||||
'<b>Media Plugin</b><br>This plugin '
|
||||
'allows the playing of audio and video media')
|
||||
return about_text
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user