This commit is contained in:
Tim Bentley 2019-04-27 16:12:24 +01:00
parent 656c1d3bfc
commit 56722b2729
4 changed files with 15 additions and 17 deletions

View File

@ -188,7 +188,7 @@ class Settings(QtCore.QSettings):
'core/click live slide to unblank': False,
'core/blank warning': False,
'core/ccli number': '',
'core/experimental': False,
'advanced/experimental': False,
'core/has run wizard': False,
'core/language': '[en]',
'core/last version test': '',

View File

@ -117,6 +117,9 @@ class AdvancedTab(SettingsTab):
self.enable_auto_close_check_box = QtWidgets.QCheckBox(self.ui_group_box)
self.enable_auto_close_check_box.setObjectName('enable_auto_close_check_box')
self.ui_layout.addRow(self.enable_auto_close_check_box)
self.experimental_check_box = QtWidgets.QCheckBox(self.ui_group_box)
self.experimental_check_box.setObjectName('experimental_check_box')
self.ui_layout.addRow(self.experimental_check_box)
self.left_layout.addWidget(self.ui_group_box)
if HAS_DARK_STYLE:
self.use_dark_style_checkbox = QtWidgets.QCheckBox(self.ui_group_box)
@ -291,6 +294,8 @@ class AdvancedTab(SettingsTab):
'Auto-scroll the next slide to bottom'))
self.enable_auto_close_check_box.setText(translate('OpenLP.AdvancedTab',
'Enable application exit confirmation'))
self.experimental_check_box.setText(translate('OpenLP.GeneralTab',
'Experimental features (use at your own risk)'))
if HAS_DARK_STYLE:
self.use_dark_style_checkbox.setText(translate('OpenLP.AdvancedTab', 'Use dark style (needs restart)'))
self.service_name_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Default Service Name'))
@ -360,6 +365,7 @@ class AdvancedTab(SettingsTab):
if self.autoscroll_map[i] == autoscroll_value and i < self.autoscroll_combo_box.count():
self.autoscroll_combo_box.setCurrentIndex(i)
self.enable_auto_close_check_box.setChecked(settings.value('enable exit confirmation'))
self.experimental_check_box.setChecked(settings.value('experimental'))
if HAS_DARK_STYLE:
self.use_dark_style_checkbox.setChecked(settings.value('use_dark_style'))
self.hide_mouse_check_box.setChecked(settings.value('hide mouse'))
@ -423,6 +429,7 @@ class AdvancedTab(SettingsTab):
slide_max_height_value = self.slide_max_height_combo_box.itemData(slide_max_height_index)
settings.setValue('slide max height', slide_max_height_value)
settings.setValue('autoscrolling', self.autoscroll_map[self.autoscroll_combo_box.currentIndex()])
settings.setValue('experimental', self.experimental_check_box.isChecked())
settings.setValue('enable exit confirmation', self.enable_auto_close_check_box.isChecked())
settings.setValue('hide mouse', self.hide_mouse_check_box.isChecked())
settings.setValue('alternate rows', self.alternate_rows_check_box.isChecked())

View File

@ -113,9 +113,6 @@ class GeneralTab(SettingsTab):
self.check_for_updates_check_box = QtWidgets.QCheckBox(self.startup_group_box)
self.check_for_updates_check_box.setObjectName('check_for_updates_check_box')
self.startup_layout.addWidget(self.check_for_updates_check_box)
self.experimental_check_box = QtWidgets.QCheckBox(self.startup_group_box)
self.experimental_check_box.setObjectName('experimental_check_box')
self.startup_layout.addWidget(self.experimental_check_box)
self.right_layout.addWidget(self.startup_group_box)
# Logo
self.logo_group_box = QtWidgets.QGroupBox(self.right_column)
@ -183,8 +180,6 @@ class GeneralTab(SettingsTab):
self.logo_file_label.setText(translate('OpenLP.GeneralTab', 'Logo file:'))
self.logo_hide_on_startup_check_box.setText(translate('OpenLP.GeneralTab', 'Don\'t show logo on startup'))
self.check_for_updates_check_box.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP'))
self.experimental_check_box.setText(translate('OpenLP.GeneralTab',
'Experimental features (use at your own risk)'))
self.settings_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Settings'))
self.save_check_service_check_box.setText(translate('OpenLP.GeneralTab',
'Prompt to save before starting a new service'))
@ -227,7 +222,6 @@ class GeneralTab(SettingsTab):
self.logo_hide_on_startup_check_box.setChecked(settings.value('logo hide on startup'))
self.logo_color_button.color = self.logo_background_color
self.check_for_updates_check_box.setChecked(settings.value('update check'))
self.experimental_check_box.setChecked(settings.value('experimental'))
self.auto_preview_check_box.setChecked(settings.value('auto preview'))
self.timeout_spin_box.setValue(settings.value('loop delay'))
self.start_paused_check_box.setChecked(settings.value('audio start paused'))
@ -247,7 +241,6 @@ class GeneralTab(SettingsTab):
settings.setValue('logo file', self.logo_file_path_edit.path)
settings.setValue('logo hide on startup', self.logo_hide_on_startup_check_box.isChecked())
settings.setValue('update check', self.check_for_updates_check_box.isChecked())
settings.setValue('experimental', self.experimental_check_box.isChecked())
settings.setValue('save prompt', self.save_check_service_check_box.isChecked())
settings.setValue('auto unblank', self.auto_unblank_check_box.isChecked())
settings.setValue('click live slide to unblank', self.click_live_slide_to_unblank_check_box.isChecked())

View File

@ -22,6 +22,7 @@
"""
The :mod:`~openlp.core.ui.media.mediatab` module holds the configuration tab for the media stuff.
"""
import logging
from PyQt5 import QtWidgets
from PyQt5.QtMultimedia import QCameraInfo, QAudioDeviceInfo, QAudio
@ -36,6 +37,8 @@ LINUX_STREAM = 'v4l2://{video} :v4l2-standard= :input-slave={audio} :live-cachin
WIN_STREAM = 'dshow://:dshow-vdev={video} :dshow-adev={audio} :live-caching=300'
OSX_STREAM = 'avcapture://{video} :qtsound://{audio} :live-caching=300'
log = logging.getLogger(__name__)
class MediaTab(SettingsTab):
"""
@ -111,17 +114,12 @@ class MediaTab(SettingsTab):
else:
self.stream_edit.setPlainText(OSX_STREAM)
self.vlc_additions_edit.setPlainText(Settings().value(self.settings_section + '/vlc additions'))
if Settings().value('core/experimental'):
print('Video input:')
if Settings().value('advanced/experimental'):
for cam in QCameraInfo.availableCameras():
print('===============')
print(cam.deviceName())
print(cam.description())
print()
print('Audio input:')
log.debug(cam.deviceName())
log.debug(cam.description())
for au in QAudioDeviceInfo.availableDevices(QAudio.AudioInput):
print('===============')
print(au.deviceName())
log.debug(au.deviceName())
def save(self):
"""