This commit is contained in:
Tim Bentley 2019-05-03 18:25:27 +01:00
parent 56722b2729
commit 50e2c6e5e9
3 changed files with 11 additions and 34 deletions

View File

@ -180,10 +180,8 @@ class Settings(QtCore.QSettings):
'api/thumbnails': True, 'api/thumbnails': True,
'crashreport/last directory': None, 'crashreport/last directory': None,
'formattingTags/html_tags': '', 'formattingTags/html_tags': '',
'core/audio repeat list': False,
'core/auto open': False, 'core/auto open': False,
'core/auto preview': False, 'core/auto preview': False,
'core/audio start paused': True,
'core/auto unblank': False, 'core/auto unblank': False,
'core/click live slide to unblank': False, 'core/click live slide to unblank': False,
'core/blank warning': False, 'core/blank warning': False,
@ -318,7 +316,9 @@ class Settings(QtCore.QSettings):
('bibles/proxy username', '', []), ('bibles/proxy username', '', []),
('bibles/proxy password', '', []), ('bibles/proxy password', '', []),
('media/players', '', []), ('media/players', '', []),
('media/override player', '', []) ('media/override player', '', []),
('core/audio start paused', '', []),
('core/audio repeat list', '', [])
] ]
@staticmethod @staticmethod

View File

@ -83,18 +83,6 @@ class GeneralTab(SettingsTab):
self.password_edit.setObjectName('password_edit') self.password_edit.setObjectName('password_edit')
self.ccli_layout.addRow(self.password_label, self.password_edit) self.ccli_layout.addRow(self.password_label, self.password_edit)
self.left_layout.addWidget(self.ccli_group_box) self.left_layout.addWidget(self.ccli_group_box)
# Background audio
self.audio_group_box = QtWidgets.QGroupBox(self.left_column)
self.audio_group_box.setObjectName('audio_group_box')
self.audio_layout = QtWidgets.QVBoxLayout(self.audio_group_box)
self.audio_layout.setObjectName('audio_layout')
self.start_paused_check_box = QtWidgets.QCheckBox(self.audio_group_box)
self.start_paused_check_box.setObjectName('start_paused_check_box')
self.audio_layout.addWidget(self.start_paused_check_box)
self.repeat_list_check_box = QtWidgets.QCheckBox(self.audio_group_box)
self.repeat_list_check_box.setObjectName('repeat_list_check_box')
self.audio_layout.addWidget(self.repeat_list_check_box)
self.left_layout.addWidget(self.audio_group_box)
self.left_layout.addStretch() self.left_layout.addStretch()
# Application Startup # Application Startup
self.startup_group_box = QtWidgets.QGroupBox(self.right_column) self.startup_group_box = QtWidgets.QGroupBox(self.right_column)
@ -195,9 +183,7 @@ class GeneralTab(SettingsTab):
self.number_label.setText(UiStrings().CCLINumberLabel) self.number_label.setText(UiStrings().CCLINumberLabel)
self.username_label.setText(translate('OpenLP.GeneralTab', 'SongSelect username:')) self.username_label.setText(translate('OpenLP.GeneralTab', 'SongSelect username:'))
self.password_label.setText(translate('OpenLP.GeneralTab', 'SongSelect password:')) self.password_label.setText(translate('OpenLP.GeneralTab', 'SongSelect password:'))
self.audio_group_box.setTitle(translate('OpenLP.GeneralTab', 'Background Audio')) self.logo_file_path_edit.dialog_caption = translate('OpenLP.AdvancedTab', 'Select Logo File')
self.start_paused_check_box.setText(translate('OpenLP.GeneralTab', 'Start background audio paused'))
self.repeat_list_check_box.setText(translate('OpenLP.GeneralTab', 'Repeat track list'))
self.logo_file_path_edit.dialog_caption = translate('OpenLP.AdvancedTab', 'Select Logo File') self.logo_file_path_edit.dialog_caption = translate('OpenLP.AdvancedTab', 'Select Logo File')
self.logo_file_path_edit.filters = '{text};;{names} (*)'.format( self.logo_file_path_edit.filters = '{text};;{names} (*)'.format(
text=get_images_filter(), names=UiStrings().AllFiles) text=get_images_filter(), names=UiStrings().AllFiles)
@ -224,8 +210,6 @@ class GeneralTab(SettingsTab):
self.check_for_updates_check_box.setChecked(settings.value('update check')) self.check_for_updates_check_box.setChecked(settings.value('update check'))
self.auto_preview_check_box.setChecked(settings.value('auto preview')) self.auto_preview_check_box.setChecked(settings.value('auto preview'))
self.timeout_spin_box.setValue(settings.value('loop delay')) self.timeout_spin_box.setValue(settings.value('loop delay'))
self.start_paused_check_box.setChecked(settings.value('audio start paused'))
self.repeat_list_check_box.setChecked(settings.value('audio repeat list'))
settings.endGroup() settings.endGroup()
def save(self): def save(self):
@ -249,8 +233,6 @@ class GeneralTab(SettingsTab):
settings.setValue('ccli number', self.number_edit.displayText()) settings.setValue('ccli number', self.number_edit.displayText())
settings.setValue('songselect username', self.username_edit.displayText()) settings.setValue('songselect username', self.username_edit.displayText())
settings.setValue('songselect password', self.password_edit.displayText()) settings.setValue('songselect password', self.password_edit.displayText())
settings.setValue('audio start paused', self.start_paused_check_box.isChecked())
settings.setValue('audio repeat list', self.repeat_list_check_box.isChecked())
settings.endGroup() settings.endGroup()
self.post_set_up() self.post_set_up()

View File

@ -71,11 +71,8 @@ class MediaTab(SettingsTab):
self.stream_media_layout = QtWidgets.QHBoxLayout(self.stream_media_group_box) self.stream_media_layout = QtWidgets.QHBoxLayout(self.stream_media_group_box)
self.stream_media_layout.setObjectName('stream_media_layout') self.stream_media_layout.setObjectName('stream_media_layout')
self.stream_media_layout.setContentsMargins(0, 0, 0, 0) self.stream_media_layout.setContentsMargins(0, 0, 0, 0)
self.stream_edit = QtWidgets.QPlainTextEdit(self) self.stream_edit = QtWidgets.QLabel(self)
self.stream_media_layout.addWidget(self.stream_edit) self.stream_media_layout.addWidget(self.stream_edit)
self.browse_button = QtWidgets.QToolButton(self)
self.browse_button.setIcon(UiIcons().undo)
self.stream_media_layout.addWidget(self.browse_button)
self.left_layout.addWidget(self.stream_media_group_box) self.left_layout.addWidget(self.stream_media_group_box)
self.vlc_additions_group_box = QtWidgets.QGroupBox(self.left_column) self.vlc_additions_group_box = QtWidgets.QGroupBox(self.left_column)
self.vlc_additions_group_box.setObjectName('vlc_additions_group_box') self.vlc_additions_group_box.setObjectName('vlc_additions_group_box')
@ -84,12 +81,10 @@ class MediaTab(SettingsTab):
self.vlc_additions_layout.setContentsMargins(0, 0, 0, 0) self.vlc_additions_layout.setContentsMargins(0, 0, 0, 0)
self.vlc_additions_edit = QtWidgets.QPlainTextEdit(self) self.vlc_additions_edit = QtWidgets.QPlainTextEdit(self)
self.vlc_additions_layout.addWidget(self.vlc_additions_edit) self.vlc_additions_layout.addWidget(self.vlc_additions_edit)
self.vlc_additions_layout.addWidget(self.browse_button)
self.left_layout.addWidget(self.vlc_additions_group_box) self.left_layout.addWidget(self.vlc_additions_group_box)
self.left_layout.addStretch() self.left_layout.addStretch()
self.right_layout.addStretch() self.right_layout.addStretch()
# # Signals and slots # # Signals and slots
self.browse_button.clicked.connect(self.on_revert)
def retranslate_ui(self): def retranslate_ui(self):
""" """
@ -105,14 +100,14 @@ class MediaTab(SettingsTab):
Load the settings Load the settings
""" """
self.auto_start_check_box.setChecked(Settings().value(self.settings_section + '/media auto start')) self.auto_start_check_box.setChecked(Settings().value(self.settings_section + '/media auto start'))
self.stream_edit.setPlainText(Settings().value(self.settings_section + '/stream command')) self.stream_edit.setText(Settings().value(self.settings_section + '/stream command'))
if not self.stream_edit.toPlainText(): if not self.stream_edit.text():
if is_linux: if is_linux:
self.stream_edit.setPlainText(LINUX_STREAM) self.stream_edit.setText(LINUX_STREAM)
elif is_win: elif is_win:
self.stream_edit.setPlainText(WIN_STREAM) self.stream_edit.setText(WIN_STREAM)
else: else:
self.stream_edit.setPlainText(OSX_STREAM) self.stream_edit.setText(OSX_STREAM)
self.vlc_additions_edit.setPlainText(Settings().value(self.settings_section + '/vlc additions')) self.vlc_additions_edit.setPlainText(Settings().value(self.settings_section + '/vlc additions'))
if Settings().value('advanced/experimental'): if Settings().value('advanced/experimental'):
for cam in QCameraInfo.availableCameras(): for cam in QCameraInfo.availableCameras():
@ -128,7 +123,7 @@ class MediaTab(SettingsTab):
setting_key = self.settings_section + '/media auto start' setting_key = self.settings_section + '/media auto start'
if Settings().value(setting_key) != self.auto_start_check_box.checkState(): if Settings().value(setting_key) != self.auto_start_check_box.checkState():
Settings().setValue(setting_key, self.auto_start_check_box.checkState()) Settings().setValue(setting_key, self.auto_start_check_box.checkState())
Settings().setValue(self.settings_section + '/stream command', self.stream_edit.toPlainText()) Settings().setValue(self.settings_section + '/stream command', self.stream_edit.text())
Settings().setValue(self.settings_section + '/vlc additions', self.vlc_additions_edit.toPlainText()) Settings().setValue(self.settings_section + '/vlc additions', self.vlc_additions_edit.toPlainText())
def post_set_up(self, post_update=False): def post_set_up(self, post_update=False):