forked from openlp/openlp
Enable or disable looping of slides based on a checkbox in the general settings
bzr-revno: 1575 Fixes: https://launchpad.net/bugs/739777
This commit is contained in:
commit
93ec7f52a1
@ -97,6 +97,9 @@ class GeneralTab(SettingsTab):
|
|||||||
self.autoPreviewCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
|
self.autoPreviewCheckBox = QtGui.QCheckBox(self.settingsGroupBox)
|
||||||
self.autoPreviewCheckBox.setObjectName(u'autoPreviewCheckBox')
|
self.autoPreviewCheckBox.setObjectName(u'autoPreviewCheckBox')
|
||||||
self.settingsLayout.addRow(self.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
|
# Moved here from image tab
|
||||||
self.timeoutLabel = QtGui.QLabel(self.settingsGroupBox)
|
self.timeoutLabel = QtGui.QLabel(self.settingsGroupBox)
|
||||||
self.timeoutLabel.setObjectName(u'timeoutLabel')
|
self.timeoutLabel.setObjectName(u'timeoutLabel')
|
||||||
@ -219,6 +222,8 @@ class GeneralTab(SettingsTab):
|
|||||||
'Unblank display when adding new live item'))
|
'Unblank display when adding new live item'))
|
||||||
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab',
|
self.autoPreviewCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||||
'Automatically preview next item in service'))
|
'Automatically preview next item in service'))
|
||||||
|
self.enableLoopCheckBox.setText(translate('OpenLP.GeneralTab',
|
||||||
|
'Enable slide loop'))
|
||||||
self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
|
self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
|
||||||
'Slide loop delay:'))
|
'Slide loop delay:'))
|
||||||
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
|
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
|
||||||
@ -271,6 +276,8 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(True)).toBool())
|
QtCore.QVariant(True)).toBool())
|
||||||
self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview',
|
self.autoPreviewCheckBox.setChecked(settings.value(u'auto preview',
|
||||||
QtCore.QVariant(False)).toBool())
|
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',
|
self.timeoutSpinBox.setValue(settings.value(u'loop delay',
|
||||||
QtCore.QVariant(5)).toInt()[0])
|
QtCore.QVariant(5)).toInt()[0])
|
||||||
self.overrideCheckBox.setChecked(settings.value(u'override position',
|
self.overrideCheckBox.setChecked(settings.value(u'override position',
|
||||||
@ -314,6 +321,8 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.autoUnblankCheckBox.isChecked()))
|
QtCore.QVariant(self.autoUnblankCheckBox.isChecked()))
|
||||||
settings.setValue(u'auto preview',
|
settings.setValue(u'auto preview',
|
||||||
QtCore.QVariant(self.autoPreviewCheckBox.isChecked()))
|
QtCore.QVariant(self.autoPreviewCheckBox.isChecked()))
|
||||||
|
settings.setValue(u'enable slide loop',
|
||||||
|
QtCore.QVariant(self.enableLoopCheckBox.isChecked()))
|
||||||
settings.setValue(u'loop delay',
|
settings.setValue(u'loop delay',
|
||||||
QtCore.QVariant(self.timeoutSpinBox.value()))
|
QtCore.QVariant(self.timeoutSpinBox.value()))
|
||||||
settings.setValue(u'ccli number',
|
settings.setValue(u'ccli number',
|
||||||
|
@ -348,13 +348,6 @@ class SlideController(QtGui.QWidget):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_previous' % self.typePrefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_previous' % self.typePrefix),
|
||||||
self.onSlideSelectedPrevious)
|
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.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'slidecontroller_%s_last' % self.typePrefix),
|
QtCore.SIGNAL(u'slidecontroller_%s_last' % self.typePrefix),
|
||||||
self.onSlideSelectedLast)
|
self.onSlideSelectedLast)
|
||||||
@ -940,10 +933,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
rect.y(), rect.width(), rect.height())
|
rect.y(), rect.width(), rect.height())
|
||||||
self.slidePreview.setPixmap(winimg)
|
self.slidePreview.setPixmap(winimg)
|
||||||
|
|
||||||
def onSlideSelectedNextNoloop(self):
|
def onSlideSelectedNext(self):
|
||||||
self.onSlideSelectedNext(False)
|
|
||||||
|
|
||||||
def onSlideSelectedNext(self, loop=True):
|
|
||||||
"""
|
"""
|
||||||
Go to the next slide.
|
Go to the next slide.
|
||||||
"""
|
"""
|
||||||
@ -956,18 +946,15 @@ class SlideController(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
row = self.previewListWidget.currentRow() + 1
|
row = self.previewListWidget.currentRow() + 1
|
||||||
if row == self.previewListWidget.rowCount():
|
if row == self.previewListWidget.rowCount():
|
||||||
if loop:
|
if QtCore.QSettings().value(self.parent.generalSettingsSection +
|
||||||
|
u'/enable slide loop', QtCore.QVariant(True)).toBool():
|
||||||
row = 0
|
row = 0
|
||||||
else:
|
else:
|
||||||
Receiver.send_message('servicemanager_next_item')
|
row = self.previewListWidget.rowCount() - 1
|
||||||
return
|
|
||||||
self.__checkUpdateSelectedSlide(row)
|
self.__checkUpdateSelectedSlide(row)
|
||||||
self.slideSelected()
|
self.slideSelected()
|
||||||
|
|
||||||
def onSlideSelectedPreviousNoloop(self):
|
def onSlideSelectedPrevious(self):
|
||||||
self.onSlideSelectedPrevious(False)
|
|
||||||
|
|
||||||
def onSlideSelectedPrevious(self, loop=True):
|
|
||||||
"""
|
"""
|
||||||
Go to the previous slide.
|
Go to the previous slide.
|
||||||
"""
|
"""
|
||||||
@ -980,7 +967,8 @@ class SlideController(QtGui.QWidget):
|
|||||||
else:
|
else:
|
||||||
row = self.previewListWidget.currentRow() - 1
|
row = self.previewListWidget.currentRow() - 1
|
||||||
if row == -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
|
row = self.previewListWidget.rowCount() - 1
|
||||||
else:
|
else:
|
||||||
row = 0
|
row = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user