This commit is contained in:
Andreas Preikschat 2010-12-26 14:07:52 +01:00
commit e6a89652e4
8 changed files with 62 additions and 25 deletions

View File

@ -214,7 +214,7 @@ class RenderManager(object):
if self.force_page: if self.force_page:
verse = verse + verse + verse verse = verse + verse + verse
else: else:
self.image_manager.del_image(self.theme_data.theme_name) self.image_manager.del_image(theme_data.theme_name)
footer = [] footer = []
footer.append(u'Arky Arky (Unknown)' ) footer.append(u'Arky Arky (Unknown)' )
footer.append(u'Public Domain') footer.append(u'Public Domain')

View File

@ -53,7 +53,5 @@ class Ui_FileRenameDialog(object):
QtCore.QMetaObject.connectSlotsByName(FileRenameDialog) QtCore.QMetaObject.connectSlotsByName(FileRenameDialog)
def retranslateUi(self, FileRenameDialog): def retranslateUi(self, FileRenameDialog):
FileRenameDialog.setWindowTitle(translate('OpenLP.FileRenameForm',
'File Rename'))
self.fileRenameLabel.setText(translate('OpenLP.FileRenameForm', self.fileRenameLabel.setText(translate('OpenLP.FileRenameForm',
'New File Name:')) 'New File Name:'))

View File

@ -28,6 +28,8 @@ from PyQt4 import QtCore, QtGui
from filerenamedialog import Ui_FileRenameDialog from filerenamedialog import Ui_FileRenameDialog
from openlp.core.lib import translate
class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog): class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
""" """
The exception dialog The exception dialog
@ -39,3 +41,15 @@ class FileRenameForm(QtGui.QDialog, Ui_FileRenameDialog):
self.accept) self.accept)
QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'), QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(u'rejected()'),
self.reject) self.reject)
def exec_(self, copy=False):
"""
Run the Dialog with correct heading.
"""
if copy:
self.setWindowTitle(translate('OpenLP.FileRenameForm',
'File Copy'))
else:
self.setWindowTitle(translate('OpenLP.FileRenameForm',
'File Rename'))
return QtGui.QDialog.exec_(self)

View File

@ -312,6 +312,18 @@ class GeneralTab(SettingsTab):
# Signals and slots # Signals and slots
QtCore.QObject.connect(self.overrideCheckBox, QtCore.QObject.connect(self.overrideCheckBox,
QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled) QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled)
QtCore.QObject.connect(self.customHeightValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
QtCore.QObject.connect(self.customWidthValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
QtCore.QObject.connect(self.customYValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
QtCore.QObject.connect(self.customXValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
def retranslateUi(self): def retranslateUi(self):
""" """
@ -503,10 +515,19 @@ class GeneralTab(SettingsTab):
def onOverrideCheckBoxToggled(self, checked): def onOverrideCheckBoxToggled(self, checked):
""" """
Toggle screen state depending on check box state Toggle screen state depending on check box state.
``checked``
The state of the check box (boolean).
""" """
self.customXValueEdit.setEnabled(checked) self.customXValueEdit.setEnabled(checked)
self.customYValueEdit.setEnabled(checked) self.customYValueEdit.setEnabled(checked)
self.customHeightValueEdit.setEnabled(checked) self.customHeightValueEdit.setEnabled(checked)
self.customWidthValueEdit.setEnabled(checked) self.customWidthValueEdit.setEnabled(checked)
self.overrideChanged = True self.overrideChanged = True
def onDisplayPositionChanged(self):
"""
Called when the width, height, x position or y position has changed.
"""
self.overrideChanged = True

View File

@ -79,7 +79,7 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
status_text = unicode( status_text = unicode(
translate('OpenLP.PluginForm', '%s (Disabled)')) translate('OpenLP.PluginForm', '%s (Disabled)'))
name_string = plugin.getString(StringContent.Name) name_string = plugin.getString(StringContent.Name)
item.setText(status_text % name_string[u'plural']) item.setText(status_text % name_string[u'singular'])
# If the plugin has an icon, set it! # If the plugin has an icon, set it!
if plugin.icon: if plugin.icon:
item.setIcon(plugin.icon) item.setIcon(plugin.icon)
@ -107,12 +107,12 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
if self.pluginListWidget.currentItem() is None: if self.pluginListWidget.currentItem() is None:
self._clearDetails() self._clearDetails()
return return
plugin_name_plural = \ plugin_name_singular = \
self.pluginListWidget.currentItem().text().split(u' ')[0] self.pluginListWidget.currentItem().text().split(u' ')[0]
self.activePlugin = None self.activePlugin = None
for plugin in self.parent.pluginManager.plugins: for plugin in self.parent.pluginManager.plugins:
name_string = plugin.getString(StringContent.Name) name_string = plugin.getString(StringContent.Name)
if name_string[u'plural'] == plugin_name_plural: if name_string[u'singular'] == plugin_name_singular:
self.activePlugin = plugin self.activePlugin = plugin
break break
if self.activePlugin: if self.activePlugin:
@ -142,4 +142,4 @@ class PluginForm(QtGui.QDialog, Ui_PluginViewDialog):
translate('OpenLP.PluginForm', '%s (Disabled)')) translate('OpenLP.PluginForm', '%s (Disabled)'))
name_string = self.activePlugin.getString(StringContent.Name) name_string = self.activePlugin.getString(StringContent.Name)
self.pluginListWidget.currentItem().setText( self.pluginListWidget.currentItem().setText(
status_text % name_string[u'plural']) status_text % name_string[u'singular'])

View File

@ -224,11 +224,11 @@ class ThemeManager(QtGui.QWidget):
Renames an existing theme to a new name Renames an existing theme to a new name
""" """
action = unicode(translate('OpenLP.ThemeManager', 'Rename')) action = unicode(translate('OpenLP.ThemeManager', 'Rename'))
if self._validate_theme_action(action): if self._validate_theme_action(action, False):
item = self.themeListWidget.currentItem() item = self.themeListWidget.currentItem()
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
self.fileRenameForm.fileNameEdit.setText(oldThemeName) self.fileRenameForm.fileNameEdit.setText(oldThemeName)
self.saveThemeName = u'' self.saveThemeName = oldThemeName
if self.fileRenameForm.exec_(): if self.fileRenameForm.exec_():
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
oldThemeData = self.getThemeData(oldThemeName) oldThemeData = self.getThemeData(oldThemeName)
@ -243,7 +243,7 @@ class ThemeManager(QtGui.QWidget):
oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString()) oldThemeName = unicode(item.data(QtCore.Qt.UserRole).toString())
self.fileRenameForm.fileNameEdit.setText(oldThemeName) self.fileRenameForm.fileNameEdit.setText(oldThemeName)
self.saveThemeName = u'' self.saveThemeName = u''
if self.fileRenameForm.exec_(): if self.fileRenameForm.exec_(True):
newThemeName = unicode(self.fileRenameForm.fileNameEdit.text()) newThemeName = unicode(self.fileRenameForm.fileNameEdit.text())
themeData = self.getThemeData(oldThemeName) themeData = self.getThemeData(oldThemeName)
self.cloneThemeData(themeData, newThemeName) self.cloneThemeData(themeData, newThemeName)
@ -636,7 +636,6 @@ class ThemeManager(QtGui.QWidget):
plugin.renameTheme(self.saveThemeName, name) plugin.renameTheme(self.saveThemeName, name)
if unicode(self.serviceComboBox.currentText()) == name: if unicode(self.serviceComboBox.currentText()) == name:
editedServiceTheme = True editedServiceTheme = True
self.deleteTheme(self.saveThemeName)
if result == QtGui.QMessageBox.Yes: if result == QtGui.QMessageBox.Yes:
# Save the theme, overwriting the existing theme if necessary. # Save the theme, overwriting the existing theme if necessary.
if imageTo and self.oldBackgroundImage and \ if imageTo and self.oldBackgroundImage and \
@ -751,7 +750,7 @@ class ThemeManager(QtGui.QWidget):
theme.extend_image_filename(path) theme.extend_image_filename(path)
return theme return theme
def _validate_theme_action(self, action): def _validate_theme_action(self, action, testPlugin=True):
""" """
Check to see if theme has been selected and the destructive action Check to see if theme has been selected and the destructive action
is allowed. is allowed.
@ -781,14 +780,15 @@ class ThemeManager(QtGui.QWidget):
translate('OpenLP.ThemeManager', translate('OpenLP.ThemeManager',
'You are unable to delete the default theme.')) 'You are unable to delete the default theme.'))
else: else:
for plugin in self.parent.pluginManager.plugins: if testPlugin:
if plugin.usesTheme(theme): for plugin in self.parent.pluginManager.plugins:
QtGui.QMessageBox.critical(self, if plugin.usesTheme(theme):
translate('OpenLP.ThemeManager', 'Error'), QtGui.QMessageBox.critical(self,
unicode(translate('OpenLP.ThemeManager', translate('OpenLP.ThemeManager', 'Error'),
'Theme %s is used in the %s plugin.')) % \ unicode(translate('OpenLP.ThemeManager',
(theme, plugin.name)) 'Theme %s is used in the %s plugin.')) % \
return False (theme, plugin.name))
return False
if unicode(self.serviceComboBox.currentText()) == theme: if unicode(self.serviceComboBox.currentText()) == theme:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('OpenLP.ThemeManager', 'Error'), translate('OpenLP.ThemeManager', 'Error'),

View File

@ -206,8 +206,12 @@ OpenLP.Namespace.create("OpenLP.Remote", {
}, },
sendLiveSet: function (e) sendLiveSet: function (e)
{ {
var id = OpenLP.Events.getElement(e).parent().attr("value"); var tr = OpenLP.Events.getElement(e).parent();
OpenLP.Remote.sendEvent("slidecontroller_live_set", id); if (tr[0].tagName != "TR")
{
tr = tr.parent();
}
OpenLP.Remote.sendEvent("slidecontroller_live_set", tr.attr("value"));
return false; return false;
}, },
sendSetItem: function (e) sendSetItem: function (e)

View File

@ -89,5 +89,5 @@ class RemotesPlugin(Plugin):
} }
## Name for MediaDockManager, SettingsManager ## ## Name for MediaDockManager, SettingsManager ##
self.textStrings[StringContent.VisibleName] = { self.textStrings[StringContent.VisibleName] = {
u'title': translate('RemotePlugin', 'Remotes') u'title': translate('RemotePlugin', 'Remote')
} }