openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #13800
[Merge] lp:~staffj01/openlp/slideadvance into lp:openlp
Jonathan Stafford has proposed merging lp:~staffj01/openlp/slideadvance into lp:openlp.
Requested reviews:
Tim Bentley (trb143)
Raoul Snyman (raoul-snyman)
For more details, see:
https://code.launchpad.net/~staffj01/openlp/slideadvance/+merge/88655
Changing the "Wrap Slide" option into a three-way radio button selection to allow the option of the up/down arrow keys to jump between service items at the end of each song, etc.
--
https://code.launchpad.net/~staffj01/openlp/slideadvance/+merge/88655
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2011-12-27 10:33:55 +0000
+++ openlp/core/lib/serviceitem.py 2012-01-16 10:14:25 +0000
@@ -47,6 +47,14 @@
Image = 2
Command = 3
+class SlideAdvance(object):
+ """
+ Provides an enumeration for the service item slide advance by up/down
+ arrow keys
+ """
+ End = 1
+ Wrap = 2
+ Next = 3
class ItemCapabilities(object):
"""
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py 2011-12-27 10:33:55 +0000
+++ openlp/core/ui/generaltab.py 2012-01-16 10:14:25 +0000
@@ -30,6 +30,7 @@
from openlp.core.lib import SettingsTab, Receiver, translate
from openlp.core.lib.ui import UiStrings
+from openlp.core.lib.serviceitem import SlideAdvance
from openlp.core.ui import ScreenList
log = logging.getLogger(__name__)
@@ -97,9 +98,6 @@
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')
@@ -180,6 +178,38 @@
self.audioLayout.addWidget(self.startPausedCheckBox)
self.rightLayout.addWidget(self.audioGroupBox)
self.rightLayout.addStretch()
+ # Service Item Slide Advance
+ self.slideGroupBox = QtGui.QGroupBox(self.rightColumn)
+ self.slideGroupBox.setObjectName(u'slideGroupBox')
+ self.slideLayout = QtGui.QFormLayout(self.slideGroupBox)
+ self.slideLayout.setLabelAlignment(
+ QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
+ self.slideLayout.setFormAlignment(
+ QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
+ self.slideLayout.setObjectName(u'slideLayout')
+ self.endSlideRadioButton = QtGui.QRadioButton(self.slideGroupBox)
+ self.endSlideRadioButton.setObjectName(u'endSlideRadioButton')
+ self.endSlideLabel = QtGui.QLabel(self.slideGroupBox)
+ self.endSlideLabel.setWordWrap(True)
+ self.endSlideLabel.setObjectName(u'endSlideLabel')
+ self.slideLayout.addRow(self.endSlideRadioButton, self.endSlideLabel)
+ self.wrapSlideRadioButton = QtGui.QRadioButton(self.slideGroupBox)
+ self.wrapSlideRadioButton.setObjectName(u'wrapSlideRadioButton')
+ self.wrapSlideLabel = QtGui.QLabel(self.slideGroupBox)
+ self.wrapSlideLabel.setWordWrap(True)
+ self.wrapSlideLabel.setObjectName(u'wrapSlideLabel')
+ self.slideLayout.addRow(self.wrapSlideRadioButton,
+ self.wrapSlideLabel)
+ self.nextSlideRadioButton = QtGui.QRadioButton(self.slideGroupBox)
+ self.nextSlideRadioButton.setChecked(True)
+ self.nextSlideRadioButton.setObjectName(u'nextSlideRadioButton')
+ self.nextSlideLabel = QtGui.QLabel(self.slideGroupBox)
+ self.nextSlideLabel.setWordWrap(True)
+ self.nextSlideLabel.setObjectName(u'nextSlideLabel')
+ self.slideLayout.addRow(self.nextSlideRadioButton,
+ self.nextSlideLabel)
+ self.rightLayout.addWidget(self.slideGroupBox)
+ self.rightLayout.addStretch()
# Signals and slots
QtCore.QObject.connect(self.overrideCheckBox,
QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled)
@@ -196,6 +226,12 @@
# Reload the tab, as the screen resolution/count may have changed.
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.load)
+ QtCore.QObject.connect(self.endSlideRadioButton,
+ QtCore.SIGNAL(u'pressed()'), self.onEndSlideButtonPressed)
+ QtCore.QObject.connect(self.wrapSlideRadioButton,
+ QtCore.SIGNAL(u'pressed()'), self.onWrapSlideButtonPressed)
+ QtCore.QObject.connect(self.nextSlideRadioButton,
+ QtCore.SIGNAL(u'pressed()'), self.onNextSlideButtonPressed)
# Remove for now
self.usernameLabel.setVisible(False)
self.usernameEdit.setVisible(False)
@@ -231,8 +267,6 @@
'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 wrap-around'))
self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
'Timed slide interval:'))
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
@@ -256,6 +290,25 @@
translate('OpenLP.GeneralTab', 'Background Audio'))
self.startPausedCheckBox.setText(
translate('OpenLP.GeneralTab', 'Start background audio paused'))
+ # Slide Advance
+ self.slideGroupBox.setTitle(
+ translate('OpenLP.GeneralTab', 'Service Item Slide Advance'))
+ self.endSlideRadioButton.setText(
+ translate('OpenLP.GeneralTab', '&End Slide'))
+ self.endSlideLabel.setText(
+ translate('OpenLP.GeneralTab', 'Up and down arrow keys '
+ 'stop at the top and bottom slides of each Service Item.'))
+ self.wrapSlideRadioButton.setText(
+ translate('OpenLP.GeneralTab', '&Wrap Slide'))
+ self.wrapSlideLabel.setText(
+ translate('OpenLP.GeneralTab', 'Up and down arrow keys '
+ 'wrap around at the top and bottom slides of each Service Item.'))
+ self.nextSlideRadioButton.setText(
+ translate('OpenLP.GeneralTab', '&Next Slide'))
+ self.nextSlideLabel.setText(
+ translate('OpenLP.GeneralTab', 'Up and down arrow keys '
+ 'advance to the the next or previous Service Item from the '
+ 'top and bottom slides of each Service Item.'))
def load(self):
"""
@@ -289,8 +342,6 @@
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',
@@ -311,6 +362,16 @@
self.customHeightValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.customWidthValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.display_changed = False
+ settings.beginGroup(self.settingsSection)
+ self.slide_advance = settings.value(
+ u'slide advance', QtCore.QVariant(SlideAdvance.End)).toInt()[0]
+ settings.endGroup()
+ if self.slide_advance == SlideAdvance.End:
+ self.endSlideRadioButton.setChecked(True)
+ elif self.slide_advance == SlideAdvance.Wrap:
+ self.wrapSlideRadioButton.setChecked(True)
+ else:
+ self.nextSlideRadioButton.setChecked(True)
def save(self):
"""
@@ -336,8 +397,6 @@
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',
@@ -358,7 +417,8 @@
QtCore.QVariant(self.overrideCheckBox.isChecked()))
settings.setValue(u'audio start paused',
QtCore.QVariant(self.startPausedCheckBox.isChecked()))
- settings.endGroup()
+ settings.setValue(u'slide advance', QtCore.QVariant(self.slide_advance))
+ settings.endGroup()
# On save update the screens as well
self.postSetUp(True)
@@ -405,3 +465,12 @@
Called when the width, height, x position or y position has changed.
"""
self.display_changed = True
+
+ def onEndSlideButtonPressed(self):
+ self.slide_advance = SlideAdvance.End
+
+ def onWrapSlideButtonPressed(self):
+ self.slide_advance = SlideAdvance.Wrap
+
+ def onNextSlideButtonPressed(self):
+ self.slide_advance = SlideAdvance.Next
=== modified file 'openlp/core/ui/mainwindow.py'
--- openlp/core/ui/mainwindow.py 2011-12-27 10:33:55 +0000
+++ openlp/core/ui/mainwindow.py 2012-01-16 10:14:25 +0000
@@ -38,6 +38,7 @@
PluginManager, Receiver, translate, ImageManager, PluginStatus
from openlp.core.lib.ui import UiStrings, base_action, checkable_action, \
icon_action, shortcut_action
+from openlp.core.lib.serviceitem import SlideAdvance
from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, \
ThemeManager, SlideController, PluginForm, MediaDockManager, \
ShortcutListForm, FormattingTagForm
@@ -1307,6 +1308,18 @@
Load the main window settings.
"""
log.debug(u'Loading QSettings')
+ # Migrate Wrap Settings to Slide Advance Settings
+ if QtCore.QSettings().contains(self.generalSettingsSection +
+ u'/enable slide loop'):
+ if QtCore.QSettings().value(self.generalSettingsSection +
+ u'/enable slide loop', QtCore.QVariant(True)).toBool():
+ QtCore.QSettings().setValue(self.generalSettingsSection +
+ u'/slide advance', QtCore.QVariant(SlideAdvance.Wrap))
+ else:
+ QtCore.QSettings().setValue(self.generalSettingsSection +
+ u'/slide advance', QtCore.QVariant(SlideAdvance.End))
+ QtCore.QSettings().remove(self.generalSettingsSection +
+ u'/enable slide loop')
settings = QtCore.QSettings()
# Remove obsolete entries.
settings.remove(u'custom slide')
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2011-12-29 17:50:42 +0000
+++ openlp/core/ui/slidecontroller.py 2012-01-16 10:14:25 +0000
@@ -35,6 +35,7 @@
from openlp.core.lib import OpenLPToolbar, Receiver, ItemCapabilities, \
translate, build_icon, ServiceItem, build_html, PluginManager, ServiceItem
from openlp.core.lib.ui import UiStrings, shortcut_action
+from openlp.core.lib.serviceitem import SlideAdvance
from openlp.core.ui import HideMode, MainDisplay, Display, ScreenList
from openlp.core.utils.actions import ActionList, CategoryOrder
@@ -1177,10 +1178,18 @@
row = self.previewListWidget.currentRow() + 1
if row == self.previewListWidget.rowCount():
if wrap is None:
- wrap = QtCore.QSettings().value(
- self.parent().generalSettingsSection +
- u'/enable slide loop', QtCore.QVariant(True)).toBool()
- if wrap:
+ slide_advance = QtCore.QSettings().value(
+ self.parent().generalSettingsSection +
+ u'/slide advance',
+ QtCore.QVariant(SlideAdvance.End)).toInt()[0]
+ if slide_advance == SlideAdvance.Wrap:
+ row = 0
+ elif slide_advance == SlideAdvance.Next:
+ self.serviceNext()
+ return
+ else:
+ row = self.previewListWidget.rowCount() - 1
+ elif wrap:
row = 0
else:
row = self.previewListWidget.rowCount() - 1
@@ -1200,9 +1209,14 @@
else:
row = self.previewListWidget.currentRow() - 1
if row == -1:
- if QtCore.QSettings().value(self.parent().generalSettingsSection
- + u'/enable slide loop', QtCore.QVariant(True)).toBool():
+ slide_advance = QtCore.QSettings().value(
+ self.parent().generalSettingsSection + u'/slide advance',
+ QtCore.QVariant(SlideAdvance.End)).toInt()[0]
+ if slide_advance == SlideAdvance.Wrap:
row = self.previewListWidget.rowCount() - 1
+ elif slide_advance == SlideAdvance.Next:
+ self.servicePrevious()
+ return
else:
row = 0
self.__checkUpdateSelectedSlide(row)
Follow ups