← 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)

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

Enables the looping or disabling the loop of slides based on a checkbox in the general settings section(also contains a fix to lines edited on accident and variable corrections)
-- 
https://code.launchpad.net/~milleja46/openlp/milleja46/+merge/62223
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/generaltab.py'
--- openlp/core/ui/generaltab.py	2011-05-15 10:38:11 +0000
+++ openlp/core/ui/generaltab.py	2011-05-24 23:33:32 +0000
@@ -96,6 +96,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')
@@ -218,6 +221,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'))
@@ -270,6 +275,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',
@@ -313,6 +320,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',
@@ -378,3 +387,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-21 20:21:05 +0000
+++ openlp/core/ui/slidecontroller.py	2011-05-24 23:33:32 +0000
@@ -346,13 +346,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(),
@@ -937,10 +930,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.
         """
@@ -953,18 +943,15 @@
         else:
             row = self.previewListWidget.currentRow() + 1
             if row == self.previewListWidget.rowCount():
-                if loop:
+                if QtCore.QSettings().value(self.parent.generalSettingsSection
+                    + u'generalSettingsSection/enable slide loop', QtCore.QVariant(True).toBool):
                     row = 0
                 else:
-                    Receiver.send_message('servicemanager_next_item')
                     return
             self.__checkUpdateSelectedSlide(row)
             self.slideSelected()
 
-    def onSlideSelectedPreviousNoloop(self):
-        self.onSlideSelectedPrevious(False)
-
-    def onSlideSelectedPrevious(self, loop=True):
+    def onSlideSelectedPrevious(self):
         """
         Go to the previous slide.
         """
@@ -977,10 +964,11 @@
         else:
             row = self.previewListWidget.currentRow() - 1
             if row == -1:
-                if loop:
+                if QtCore.QSettings().value(self.parent.generalSettingsSection
+                    + u'generalSettingsSection/enable slide loop', QtCore.QVariant(True).toBool):
                     row = self.previewListWidget.rowCount() - 1
                 else:
-                    row = 0
+                    return
             self.__checkUpdateSelectedSlide(row)
             self.slideSelected()