diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py
index 35cd14bd2..2d3e55355 100644
--- a/openlp/core/lib/__init__.py
+++ b/openlp/core/lib/__init__.py
@@ -36,58 +36,6 @@ from PyQt4 import QtCore, QtGui
log = logging.getLogger(__name__)
-base_html_expands = []
-
-# Hex Color tags from http://www.w3schools.com/html/html_colornames.asp
-base_html_expands.append({u'desc': u'Red', u'start tag': u'{r}',
- u'start html': u'',
- u'end tag': u'{/r}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Black', u'start tag': u'{b}',
- u'start html': u'',
- u'end tag': u'{/b}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Blue', u'start tag': u'{bl}',
- u'start html': u'',
- u'end tag': u'{/bl}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Yellow', u'start tag': u'{y}',
- u'start html': u'',
- u'end tag': u'{/y}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Green', u'start tag': u'{g}',
- u'start html': u'',
- u'end tag': u'{/g}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Pink', u'start tag': u'{pk}',
- u'start html': u'',
- u'end tag': u'{/pk}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Orange', u'start tag': u'{o}',
- u'start html': u'',
- u'end tag': u'{/o}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Purple', u'start tag': u'{pp}',
- u'start html': u'',
- u'end tag': u'{/pp}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'White', u'start tag': u'{w}',
- u'start html': u'',
- u'end tag': u'{/w}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Superscript', u'start tag': u'{su}',
- u'start html': u'', u'end tag': u'{/su}', u'end html': u'',
- u'protected': True})
-base_html_expands.append({u'desc': u'Subscript', u'start tag': u'{sb}',
- u'start html': u'', u'end tag': u'{/sb}', u'end html': u'',
- u'protected': True})
-base_html_expands.append({u'desc': u'Paragraph', u'start tag': u'{p}',
- u'start html': u'
', u'end tag': u'{/p}', u'end html': u'
',
- u'protected': True})
-base_html_expands.append({u'desc': u'Bold', u'start tag': u'{st}',
- u'start html': u'', u'end tag': u'{/st}', u'end html': u'',
- u'protected': True})
-base_html_expands.append({u'desc': u'Italics', u'start tag': u'{it}',
- u'start html': u'', u'end tag': u'{/it}', u'end html': u'',
- u'protected': True})
-base_html_expands.append({u'desc': u'Underline', u'start tag': u'{u}',
- u'start html': u'',
- u'end tag': u'{/u}', u'end html': u'', u'protected': True})
-base_html_expands.append({u'desc': u'Break', u'start tag': u'{br}',
- u'start html': u'
', u'end tag': u'', u'end html': u'',
- u'protected': True})
-
def translate(context, text, comment=None,
encoding=QtCore.QCoreApplication.CodecForTr, n=-1,
translate=QtCore.QCoreApplication.translate):
diff --git a/openlp/core/lib/displaytags.py b/openlp/core/lib/displaytags.py
index c59f6e868..76273156f 100644
--- a/openlp/core/lib/displaytags.py
+++ b/openlp/core/lib/displaytags.py
@@ -28,7 +28,7 @@
Provide Html Tag management and Display Tag access class
"""
-from openlp.core.lib import base_html_expands
+from openlp.core.lib import translate
class DisplayTags(object):
"""
@@ -50,15 +50,77 @@ class DisplayTags(object):
Resets the html_expands list.
"""
DisplayTags.html_expands = []
- for html in base_html_expands:
- DisplayTags.html_expands.append(html)
+ base_tags = []
+ # Append the base tags.
+ # Hex Color tags from http://www.w3schools.com/html/html_colornames.asp
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Red'),
+ u'start tag': u'{r}',
+ u'start html': u'',
+ u'end tag': u'{/r}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Black'),
+ u'start tag': u'{b}',
+ u'start html': u'',
+ u'end tag': u'{/b}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Blue'),
+ u'start tag': u'{bl}',
+ u'start html': u'',
+ u'end tag': u'{/bl}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Yellow'),
+ u'start tag': u'{y}',
+ u'start html': u'',
+ u'end tag': u'{/y}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Green'),
+ u'start tag': u'{g}',
+ u'start html': u'',
+ u'end tag': u'{/g}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Pink'),
+ u'start tag': u'{pk}',
+ u'start html': u'',
+ u'end tag': u'{/pk}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Orange'),
+ u'start tag': u'{o}',
+ u'start html': u'',
+ u'end tag': u'{/o}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Purple'),
+ u'start tag': u'{pp}',
+ u'start html': u'',
+ u'end tag': u'{/pp}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'White'),
+ u'start tag': u'{w}',
+ u'start html': u'',
+ u'end tag': u'{/w}', u'end html': u'', u'protected': True})
+ base_tags.append({
+ u'desc': translate('OpenLP.DisplayTags', 'Superscript'),
+ u'start tag': u'{su}', u'start html': u'',
+ u'end tag': u'{/su}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Subscript'),
+ u'start tag': u'{sb}', u'start html': u'',
+ u'end tag': u'{/sb}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Paragraph'),
+ u'start tag': u'{p}', u'start html': u'', u'end tag': u'{/p}',
+ u'end html': u'
', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Bold'),
+ u'start tag': u'{st}', u'start html': u'',
+ u'end tag': u'{/st}', u'end html': u'',
+ u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Italics'),
+ u'start tag': u'{it}', u'start html': u'', u'end tag': u'{/it}',
+ u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Underline'),
+ u'start tag': u'{u}',
+ u'start html': u'',
+ u'end tag': u'{/u}', u'end html': u'', u'protected': True})
+ base_tags.append({u'desc': translate('OpenLP.DisplayTags', 'Break'),
+ u'start tag': u'{br}', u'start html': u'
', u'end tag': u'',
+ u'end html': u'', u'protected': True})
+ DisplayTags.add_html_tags(base_tags)
@staticmethod
- def add_html_tag(tag):
+ def add_html_tags(tags):
"""
- Add a new tag to the list
+ Add a list of tags to the list
"""
- DisplayTags.html_expands.append(tag)
+ DisplayTags.html_expands.extend(tags)
@staticmethod
def remove_html_tag(tag_id):
diff --git a/openlp/core/ui/displaytagdialog.py b/openlp/core/ui/displaytagdialog.py
index f501f03f6..a7701d8f3 100644
--- a/openlp/core/ui/displaytagdialog.py
+++ b/openlp/core/ui/displaytagdialog.py
@@ -69,9 +69,6 @@ class Ui_DisplayTagDialog(object):
spacerItem = QtGui.QSpacerItem(40, 20,
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
- self.defaultPushButton = QtGui.QPushButton(self.widget)
- self.defaultPushButton.setObjectName(u'defaultPushButton')
- self.horizontalLayout.addWidget(self.defaultPushButton)
self.deletePushButton = QtGui.QPushButton(self.widget)
self.deletePushButton.setObjectName(u'deletePushButton')
self.horizontalLayout.addWidget(self.deletePushButton)
@@ -141,8 +138,6 @@ class Ui_DisplayTagDialog(object):
self.endTagLabel.setText(
translate('OpenLP.DisplayTagDialog', 'End tag'))
self.deletePushButton.setText(UiStrings().Delete)
- self.defaultPushButton.setText(
- translate('OpenLP.DisplayTagDialog', 'Default'))
self.newPushButton.setText(UiStrings().New)
self.tagTableWidget.horizontalHeaderItem(0).setText(
translate('OpenLP.DisplayTagDialog', 'Description'))
diff --git a/openlp/core/ui/displaytagform.py b/openlp/core/ui/displaytagform.py
index 78a78f8fa..6aaddf2b8 100644
--- a/openlp/core/ui/displaytagform.py
+++ b/openlp/core/ui/displaytagform.py
@@ -51,8 +51,6 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
self._loadDisplayTags()
QtCore.QObject.connect(self.tagTableWidget,
QtCore.SIGNAL(u'clicked(QModelIndex)'), self.onRowSelected)
- QtCore.QObject.connect(self.defaultPushButton,
- QtCore.SIGNAL(u'pressed()'), self.onDefaultPushed)
QtCore.QObject.connect(self.newPushButton,
QtCore.SIGNAL(u'pressed()'), self.onNewPushed)
QtCore.QObject.connect(self.savePushButton,
@@ -87,8 +85,7 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
if user_expands_string:
user_tags = cPickle.loads(user_expands_string)
# If we have some user ones added them as well
- for t in user_tags:
- DisplayTags.add_html_tag(t)
+ DisplayTags.add_html_tags(user_tags)
def onRowSelected(self):
"""
@@ -128,22 +125,20 @@ class DisplayTagForm(QtGui.QDialog, Ui_DisplayTagDialog):
'Tag "n" already defined.'))
return
# Add new tag to list
- tag = {u'desc': u'New Item', u'start tag': u'{n}',
- u'start html': u'', u'end tag': u'{/n}',
- u'end html': u'', u'protected': False}
- DisplayTags.add_html_tag(tag)
+ tag = {
+ u'desc': translate('OpenLP.DisplayTagTab', 'New Tag'),
+ u'start tag': u'{n}',
+ u'start html': translate('OpenLP.DisplayTagTab', ''),
+ u'end tag': u'{/n}',
+ u'end html': translate('OpenLP.DisplayTagTab', ''),
+ u'protected': False
+ }
+ DisplayTags.add_html_tags([tag])
self._resetTable()
# Highlight new row
self.tagTableWidget.selectRow(self.tagTableWidget.rowCount() - 1)
self.onRowSelected()
- def onDefaultPushed(self):
- """
- Remove all Custom Tags and reset to base set only.
- """
- DisplayTags.reset_html_tags()
- self._resetTable()
-
def onDeletePushed(self):
"""
Delete selected custom tag.
diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py
index 05a4be414..2435b8dcc 100644
--- a/openlp/core/ui/generaltab.py
+++ b/openlp/core/ui/generaltab.py
@@ -97,6 +97,9 @@ class GeneralTab(SettingsTab):
self.autoPreviewCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
self.autoPreviewCheckBox.setObjectName(u'autoPreviewCheckBox')
self.settingsLayout.addRow(self.autoPreviewCheckBox)
+ self.enableLoopCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
+ self.enableLoopCheckBox.setObjectName(u'enableLoopCheckBox')
+ self.settingsLayout.addRow(self.enableLoopCheckBox)
# Moved here from image tab
self.timeoutLabel = QtGui.QLabel(self.settingsGroupBox)
self.timeoutLabel.setObjectName(u'timeoutLabel')
@@ -219,6 +222,8 @@ class GeneralTab(SettingsTab):
'Unblank display when adding new live item'))
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab',
'Automatically preview next item in service'))
+ self.enableLoopCheckBox.setText(translate('OpenLP.GeneralTab',
+ 'Enable slide loop'))
self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
'Slide loop delay:'))
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
@@ -271,6 +276,8 @@ class GeneralTab(SettingsTab):
QtCore.QVariant(True)).toBool())
self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview',
QtCore.QVariant(False)).toBool())
+ self.enableLoopCheckBox.setChecked(settings.value(u'enable slide loop',
+ QtCore.QVariant(True)).toBool())
self.timeoutSpinBox.setValue(settings.value(u'loop delay',
QtCore.QVariant(5)).toInt()[0])
self.overrideCheckBox.setChecked(settings.value(u'override position',
@@ -314,6 +321,8 @@ class GeneralTab(SettingsTab):
QtCore.QVariant(self.autoUnblankCheckBox.isChecked()))
settings.setValue(u'auto preview',
QtCore.QVariant(self.autoPreviewCheckBox.isChecked()))
+ settings.setValue(u'enable slide loop',
+ QtCore.QVariant(self.enableLoopCheckBox.isChecked()))
settings.setValue(u'loop delay',
QtCore.QVariant(self.timeoutSpinBox.value()))
settings.setValue(u'ccli number',
diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py
index feb67d72f..b1094bbe3 100644
--- a/openlp/core/ui/slidecontroller.py
+++ b/openlp/core/ui/slidecontroller.py
@@ -348,13 +348,6 @@ class SlideController(QtGui.QWidget):
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_%s_previous' % self.typePrefix),
self.onSlideSelectedPrevious)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'slidecontroller_%s_next_noloop' % self.typePrefix),
- self.onSlideSelectedNextNoloop)
- QtCore.QObject.connect(Receiver.get_receiver(),
- QtCore.SIGNAL(u'slidecontroller_%s_previous_noloop' %
- self.typePrefix),
- self.onSlideSelectedPreviousNoloop)
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'slidecontroller_%s_last' % self.typePrefix),
self.onSlideSelectedLast)
@@ -940,10 +933,7 @@ class SlideController(QtGui.QWidget):
rect.y(), rect.width(), rect.height())
self.slidePreview.setPixmap(winimg)
- def onSlideSelectedNextNoloop(self):
- self.onSlideSelectedNext(False)
-
- def onSlideSelectedNext(self, loop=True):
+ def onSlideSelectedNext(self):
"""
Go to the next slide.
"""
@@ -956,18 +946,15 @@ class SlideController(QtGui.QWidget):
else:
row = self.previewListWidget.currentRow() + 1
if row == self.previewListWidget.rowCount():
- if loop:
+ if QtCore.QSettings().value(self.parent.generalSettingsSection +
+ u'/enable slide loop', QtCore.QVariant(True)).toBool():
row = 0
else:
- Receiver.send_message('servicemanager_next_item')
- return
+ row = self.previewListWidget.rowCount() - 1
self.__checkUpdateSelectedSlide(row)
self.slideSelected()
- def onSlideSelectedPreviousNoloop(self):
- self.onSlideSelectedPrevious(False)
-
- def onSlideSelectedPrevious(self, loop=True):
+ def onSlideSelectedPrevious(self):
"""
Go to the previous slide.
"""
@@ -980,7 +967,8 @@ class SlideController(QtGui.QWidget):
else:
row = self.previewListWidget.currentRow() - 1
if row == -1:
- if loop:
+ if QtCore.QSettings().value(self.parent.generalSettingsSection +
+ u'/enable slide loop', QtCore.QVariant(True)).toBool():
row = self.previewListWidget.rowCount() - 1
else:
row = 0