forked from openlp/openlp
Add the option to start background audio paused (default is on).
This commit is contained in:
parent
807aac95ee
commit
2b6e254b91
@ -170,6 +170,15 @@ class GeneralTab(SettingsTab):
|
|||||||
self.customHeightValueEdit.setMaximum(9999)
|
self.customHeightValueEdit.setMaximum(9999)
|
||||||
self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
|
self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
|
||||||
self.rightLayout.addWidget(self.displayGroupBox)
|
self.rightLayout.addWidget(self.displayGroupBox)
|
||||||
|
# Background audio
|
||||||
|
self.audioGroupBox = QtGui.QGroupBox(self.rightColumn)
|
||||||
|
self.audioGroupBox.setObjectName(u'audioGroupBox')
|
||||||
|
self.audioLayout = QtGui.QVBoxLayout(self.audioGroupBox)
|
||||||
|
self.audioLayout.setObjectName(u'audioLayout')
|
||||||
|
self.startPausedCheckBox = QtGui.QCheckBox(self.audioGroupBox)
|
||||||
|
self.startPausedCheckBox.setObjectName(u'startPausedCheckBox')
|
||||||
|
self.audioLayout.addWidget(self.startPausedCheckBox)
|
||||||
|
self.rightLayout.addWidget(self.audioGroupBox)
|
||||||
self.rightLayout.addStretch()
|
self.rightLayout.addStretch()
|
||||||
# Signals and slots
|
# Signals and slots
|
||||||
QtCore.QObject.connect(self.overrideCheckBox,
|
QtCore.QObject.connect(self.overrideCheckBox,
|
||||||
@ -243,6 +252,10 @@ class GeneralTab(SettingsTab):
|
|||||||
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
|
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
|
||||||
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
|
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
|
||||||
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
|
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
|
||||||
|
self.audioGroupBox.setTitle(
|
||||||
|
translate('OpenLP.GeneralTab', 'Background Audio'))
|
||||||
|
self.startPausedCheckBox.setText(
|
||||||
|
translate('OpenLP.GeneralTab', 'Start background audio paused'))
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""
|
"""
|
||||||
@ -290,6 +303,8 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0])
|
QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0])
|
||||||
self.customWidthValueEdit.setValue(settings.value(u'width',
|
self.customWidthValueEdit.setValue(settings.value(u'width',
|
||||||
QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
|
QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
|
||||||
|
self.startPausedCheckBox.setChecked(settings.value(
|
||||||
|
u'audio start paused', QtCore.QVariant(True)).toBool())
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
|
||||||
@ -341,6 +356,8 @@ class GeneralTab(SettingsTab):
|
|||||||
QtCore.QVariant(self.customWidthValueEdit.value()))
|
QtCore.QVariant(self.customWidthValueEdit.value()))
|
||||||
settings.setValue(u'override position',
|
settings.setValue(u'override position',
|
||||||
QtCore.QVariant(self.overrideCheckBox.isChecked()))
|
QtCore.QVariant(self.overrideCheckBox.isChecked()))
|
||||||
|
settings.setValue(u'audio start paused',
|
||||||
|
QtCore.QVariant(self.startPausedCheckBox.isChecked()))
|
||||||
settings.endGroup()
|
settings.endGroup()
|
||||||
# On save update the screens as well
|
# On save update the screens as well
|
||||||
self.postSetUp(True)
|
self.postSetUp(True)
|
||||||
|
@ -633,7 +633,14 @@ class SlideController(QtGui.QWidget):
|
|||||||
log.debug(u'Starting to play...')
|
log.debug(u'Starting to play...')
|
||||||
self.display.audioPlayer.addToPlaylist(
|
self.display.audioPlayer.addToPlaylist(
|
||||||
self.serviceItem.background_audio)
|
self.serviceItem.background_audio)
|
||||||
self.display.audioPlayer.play()
|
if QtCore.QSettings().value(
|
||||||
|
self.parent().generalSettingsSection + \
|
||||||
|
u'/audio start paused',
|
||||||
|
QtCore.QVariant(True)).toBool():
|
||||||
|
self.audioPauseItem.setChecked(True)
|
||||||
|
self.display.audioPlayer.pause()
|
||||||
|
else:
|
||||||
|
self.display.audioPlayer.play()
|
||||||
self.setAudioItemsVisibility(True)
|
self.setAudioItemsVisibility(True)
|
||||||
row = 0
|
row = 0
|
||||||
text = []
|
text = []
|
||||||
|
Loading…
Reference in New Issue
Block a user