← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~milleja46/openlp/milleja46 into lp:openlp

 

Joshua Miller has proposed merging lp:~milleja46/openlp/milleja46 into lp:openlp.

Requested reviews:
  Jonathan Corwin (j-corwin)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~milleja46/openlp/milleja46/+merge/62455

Adds in looping of slides based on a checkbox in the general settings. Fully functional now, and corrections as noted
-- 
https://code.launchpad.net/~milleja46/openlp/milleja46/+merge/62455
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py	2011-05-24 20:47:05 +0000
+++ openlp/core/ui/generaltab.py	2011-05-26 10:43:25 +0000
@@ -97,6 +97,9 @@
         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 @@
             '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 @@
             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 @@
             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',
@@ -379,3 +388,4 @@
         Called when the width, height, x position or y position has changed.
         """
         self.display_changed = True
+

=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py	2011-05-25 09:10:57 +0000
+++ openlp/core/ui/slidecontroller.py	2011-05-26 10:43:25 +0000
@@ -349,13 +349,6 @@
             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)
         QtCore.QObject.connect(Receiver.get_receiver(),
@@ -940,10 +933,7 @@
             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.
         """
@@ -955,19 +945,17 @@
             self.updatePreview()
         else:
             row = self.previewListWidget.currentRow() + 1
+            can_loop = QtCore.QSettings().value(self.parent.generalSettingsSection
+                + u'/enable slide loop', QtCore.QVariant(True)).toBool()
             if row == self.previewListWidget.rowCount():
-                if loop:
+                if can_loop:
                     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 +968,9 @@
         else:
             row = self.previewListWidget.currentRow() - 1
             if row == -1:
-                if loop:
+                can_loop = QtCore.QSettings().value(self.parent.generalSettingsSection
+                    + u'/enable slide loop', QtCore.QVariant(True)).toBool()
+                if can_loop:
                     row = self.previewListWidget.rowCount() - 1
                 else:
                     row = 0


Follow ups