corrections and enable slide loop updates

This commit is contained in:
Josh Miller 2011-05-24 18:32:30 -04:00
parent 541feef8ea
commit b92b733828
3 changed files with 1548 additions and 1547 deletions

View File

@ -257,4 +257,3 @@ if __name__ == u'__main__':
Instantiate and run the application. Instantiate and run the application.
""" """
main() main()

View File

@ -96,9 +96,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 = QtGui.QCheckBox(self.settingsGroupBox)
self.enableLoopCheckbox.setObjectName(u'enableLoopCheckbox') self.enableLoopCheckBox.setObjectName(u'enableLoopCheckBox')
self.settingsLayout.addRow(self.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')
@ -221,8 +221,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', self.enableLoopCheckBox.setText(translate('OpenLP.GeneralTab',
'enable slide loop')) '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'))
@ -272,10 +272,10 @@ class GeneralTab(SettingsTab):
self.showSplashCheckBox.setChecked(settings.value(u'show splash', self.showSplashCheckBox.setChecked(settings.value(u'show splash',
QtCore.QVariant(True)).toBool()) QtCore.QVariant(True)).toBool())
self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check', self.checkForUpdatesCheckBox.setChecked(settings.value(u'update check',
QtCore.QVariant(False)).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', self.enableLoopCheckBox.setChecked(settings.value(u'enable slide loop',
QtCore.QVariant(True)).toBool()) 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])
@ -321,7 +321,7 @@ class GeneralTab(SettingsTab):
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', settings.setValue(u'enable slide loop',
QtCore.QVariant(self.enableLoopCheckbox.isChecked())) 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',

View File

@ -924,11 +924,11 @@ class SlideController(QtGui.QWidget):
winimg = QtGui.QPixmap.grabWindow(winid, rect.x(), winimg = QtGui.QPixmap.grabWindow(winid, rect.x(),
rect.y(), rect.width(), rect.height()) rect.y(), rect.width(), rect.height())
self.slidePreview.setPixmap(winimg) self.slidePreview.setPixmap(winimg)
def onSlideSelectedNext(self): def onSlideSelectedNext(self):
""" """
Go to the next slide. Go to the next slide.
""" """
loopcheck = QtCore.QSettings().value( self.parent.generalSettingsSection + u'generalSettingsSection/enable slide loop', QtCore.QVariant(True).toBool)
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'%s_next' % self.serviceItem.name.lower(), Receiver.send_message(u'%s_next' % self.serviceItem.name.lower(),
@ -938,17 +938,18 @@ 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 loopcheck == True: if QtCore.QSettings().value(self.parent.generalSettingsSection
+ u'generalSettingsSection/enable slide loop', QtCore.QVariant(True).toBool):
row = 0 row = 0
else: else:
return return
self.__checkUpdateSelectedSlide(row) self.__checkUpdateSelectedSlide(row)
self.slideSelected() self.slideSelected()
def onSlideSelectedPrevious(self): def onSlideSelectedPrevious(self):
""" """
Go to the previous slide. Go to the previous slide.
""" """
loopcheck =QtCore.QSettings().value( self.parent.generalSettingsSection + u'enable slide loop', QtCore.QVariant(True).toBool)
if not self.serviceItem: if not self.serviceItem:
return return
Receiver.send_message(u'%s_previous' % self.serviceItem.name.lower(), Receiver.send_message(u'%s_previous' % self.serviceItem.name.lower(),
@ -958,7 +959,8 @@ class SlideController(QtGui.QWidget):
else: else:
row = self.previewListWidget.currentRow() - 1 row = self.previewListWidget.currentRow() - 1
if row == -1: if row == -1:
if loopcheck == True: if QtCore.QSettings().value(self.parent.generalSettingsSection
+ u'generalSettingsSection/enable slide loop', QtCore.QVariant(True).toBool):
row = self.previewListWidget.rowCount() - 1 row = self.previewListWidget.rowCount() - 1
else: else:
return return