From 87b9ae3600ebdd1a01cbb0f942daff2fdfa7f011 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Thu, 3 Mar 2016 02:07:52 +0200 Subject: [PATCH] Added "Unblank display when changing slide in Live" to advanced tab. Added automatic unblanking when starting loopped playback. Now, only the tests remain! --- openlp/core/common/settings.py | 1 + openlp/core/ui/advancedtab.py | 7 +++++++ openlp/core/ui/slidecontroller.py | 6 ++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 8ef2b3c8b..ea554e6a3 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -119,6 +119,7 @@ class Settings(QtCore.QSettings): 'advanced/default service name': UiStrings().DefaultServiceName, 'advanced/display size': 0, 'advanced/double click live': False, + 'advanced/click live slide to unblank': True, 'advanced/enable exit confirmation': True, 'advanced/expand service item': False, 'advanced/hide mouse': True, diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 4421b432f..d63c7385a 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -73,7 +73,10 @@ class AdvancedTab(SettingsTab): self.ui_layout.addRow(self.media_plugin_check_box) self.double_click_live_check_box = QtWidgets.QCheckBox(self.ui_group_box) self.double_click_live_check_box.setObjectName('double_click_live_check_box') + self.click_live_slide_to_unblank_check_box = QtWidgets.QCheckBox(self.ui_group_box) + self.click_live_slide_to_unblank_check_box.setObjectName('click_live_slide_to_unblank_') self.ui_layout.addRow(self.double_click_live_check_box) + self.ui_layout.addRow(self.click_live_slide_to_unblank_check_box) self.single_click_preview_check_box = QtWidgets.QCheckBox(self.ui_group_box) self.single_click_preview_check_box.setObjectName('single_click_preview_check_box') self.ui_layout.addRow(self.single_click_preview_check_box) @@ -268,6 +271,8 @@ class AdvancedTab(SettingsTab): 'Remember active media manager tab on startup')) self.double_click_live_check_box.setText(translate('OpenLP.AdvancedTab', 'Double-click to send items straight to live')) + self.click_live_slide_to_unblank_check_box.setText(translate('OpenLP.AdvancedTab', + 'Unblank display when changing slide in Live')) self.single_click_preview_check_box.setText(translate('OpenLP.AdvancedTab', 'Preview items when clicked in Media Manager')) self.expand_service_item_check_box.setText(translate('OpenLP.AdvancedTab', @@ -338,6 +343,7 @@ class AdvancedTab(SettingsTab): self.recent_spin_box.setValue(settings.value('recent file count')) self.media_plugin_check_box.setChecked(settings.value('save current plugin')) self.double_click_live_check_box.setChecked(settings.value('double click live')) + self.click_live_slide_to_unblank_check_box.setChecked(settings.value('click live slide to unblank')) self.single_click_preview_check_box.setChecked(settings.value('single click preview')) self.expand_service_item_check_box.setChecked(settings.value('expand service item')) self.enable_auto_close_check_box.setChecked(settings.value('enable exit confirmation')) @@ -419,6 +425,7 @@ class AdvancedTab(SettingsTab): settings.setValue('recent file count', self.recent_spin_box.value()) settings.setValue('save current plugin', self.media_plugin_check_box.isChecked()) settings.setValue('double click live', self.double_click_live_check_box.isChecked()) + settings.setValue('click live slide to unblank', self.click_live_slide_to_unblank_check_box.isChecked()) settings.setValue('single click preview', self.single_click_preview_check_box.isChecked()) settings.setValue('expand service item', self.expand_service_item_check_box.isChecked()) settings.setValue('enable exit confirmation', self.enable_auto_close_check_box.isChecked()) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 518995242..7292d7975 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1085,13 +1085,13 @@ class SlideController(DisplayController, RegistryProperties): # done by the thread holding the lock. If it is a "start" slide, we must wait for the lock, but only for 0.2 # seconds, since we don't want to cause a deadlock timeout = 0.2 if start else -1 - if self.is_live: - Registry().execute('slidecontroller_live_unblank') if not self.slide_selected_lock.acquire(start, timeout): if start: self.log_debug('Could not get lock in slide_selected after waiting %f, skip to avoid deadlock.' % timeout) return + if self.is_live and Settings().value('advanced/click live slide to unblank'): + Registry().execute('slidecontroller_live_unblank') row = self.preview_widget.current_slide_number() old_selected_row = self.selected_row self.selected_row = 0 @@ -1248,6 +1248,7 @@ class SlideController(DisplayController, RegistryProperties): :param checked: is the check box checked. """ + Registry().execute('slidecontroller_live_unblank') if checked is None: checked = self.play_slides_loop.isChecked() else: @@ -1271,6 +1272,7 @@ class SlideController(DisplayController, RegistryProperties): :param checked: is the check box checked. """ + Registry().execute('slidecontroller_live_unblank') if checked is None: checked = self.play_slides_once.isChecked() else: