From 770843e0c6657b30d8fea7e2318165d3f4fc855f Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Thu, 3 Mar 2016 00:49:49 +0200 Subject: [PATCH 01/66] This branch adds the functionality of un-blanking display from: blank to desktop, black and theme by clicking slides in "Live" panel. This also adds this functionality for: - Starting loops - Go to verse x - Next/Previous verse --- openlp/core/ui/slidecontroller.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d2e2fe4ae..518995242 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1085,6 +1085,8 @@ 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.' From 87b9ae3600ebdd1a01cbb0f942daff2fdfa7f011 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Thu, 3 Mar 2016 02:07:52 +0200 Subject: [PATCH 02/66] 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: From 43df6739b0f1cbe459b01b1c032a8d6ffccd92d7 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Thu, 3 Mar 2016 04:49:04 +0200 Subject: [PATCH 03/66] Now including fix for bug: https://bugs.launchpad.net/openlp/+bug/1531691 --- openlp/core/ui/slidecontroller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 7292d7975..506f8ffcd 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -789,10 +789,12 @@ class SlideController(DisplayController, RegistryProperties): def replace_service_manager_item(self, item): """ Replacement item following a remote edit - + This action takes place when a song that is sent to live from Service Manager is edited. + "not self.hide_mode()" prevents this from happening when display is blanked. + If same song is currently in live, it updates the lyrics. If display i blanked, it won't update. (bug) :param item: The current service item """ - if item == self.service_item: + if item == self.service_item and not self.hide_mode(): self._process_item(item, self.preview_widget.current_slide_number()) def add_service_manager_item(self, item, slide_no): From 546ed5682360a2774288305764e55a53f89510aa Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Mon, 14 Mar 2016 04:11:13 +0200 Subject: [PATCH 04/66] - If display is blanked when song in Live is edited, now re-blanks display after updating the song. (Improved fix) - Improved un-blanking when starting Loop, pressing "Stop loop" no longer unblanks display. - Improved comment(s) To do: - Write test(s) --- openlp/core/ui/slidecontroller.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 506f8ffcd..8266a80de 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -786,16 +786,30 @@ class SlideController(DisplayController, RegistryProperties): self.song_edit = False self._process_item(item, slide_no) - def replace_service_manager_item(self, item): + def replace_service_manager_item (self, item): """ Replacement item following a remote edit - This action takes place when a song that is sent to live from Service Manager is edited. - "not self.hide_mode()" prevents this from happening when display is blanked. - If same song is currently in live, it updates the lyrics. If display i blanked, it won't update. (bug) + + This action also takes place when a song that is sent to live from Service Manager is edited. + If display is blanked, this will update the song and then re-blank the display. + As result, lyrics are flashed on screen for a very short time before re-blanking happens. (Bug) + :param item: The current service item """ - if item == self.service_item and not self.hide_mode(): - self._process_item(item, self.preview_widget.current_slide_number()) + if item == self.service_item: + if not self.hide_mode(): + self._process_item(item, self.preview_widget.current_slide_number()) + # "isChecked" method is required for checking blanks, on_xx_display(False) does not work. + elif self.hide_mode(): + if self.blank_screen.isChecked(): + self._process_item(item, self.preview_widget.current_slide_number()) + self.on_blank_display(True) + elif self.theme_screen.isChecked(): + self._process_item(item, self.preview_widget.current_slide_number()) + self.on_theme_display(True) + elif self.desktop_screen.isChecked(): + self._process_item(item, self.preview_widget.current_slide_number()) + self.on_hide_display(True) def add_service_manager_item(self, item, slide_no): """ @@ -1250,7 +1264,6 @@ 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: @@ -1263,6 +1276,7 @@ class SlideController(DisplayController, RegistryProperties): self.play_slides_once.setText(UiStrings().PlaySlidesToEnd) self.play_slides_menu.setDefaultAction(self.play_slides_loop) self.play_slides_once.setChecked(False) + Registry().execute('slidecontroller_live_unblank') else: self.play_slides_loop.setIcon(build_icon(':/media/media_time.png')) self.play_slides_loop.setText(UiStrings().PlaySlidesInLoop) @@ -1274,7 +1288,6 @@ 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: @@ -1287,6 +1300,7 @@ class SlideController(DisplayController, RegistryProperties): self.play_slides_loop.setText(UiStrings().PlaySlidesInLoop) self.play_slides_menu.setDefaultAction(self.play_slides_once) self.play_slides_loop.setChecked(False) + Registry().execute('slidecontroller_live_unblank') else: self.play_slides_once.setIcon(build_icon(':/media/media_time')) self.play_slides_once.setText(UiStrings().PlaySlidesToEnd) From 0c231353041fe543df14a9b0b616480d6f59b393 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 15 Mar 2016 11:39:54 +0200 Subject: [PATCH 05/66] - Removed Whites space before (self, item) on row 789, how did it get there in the first place? --- openlp/core/ui/slidecontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 8266a80de..d000b80e9 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -786,10 +786,9 @@ class SlideController(DisplayController, RegistryProperties): self.song_edit = False self._process_item(item, slide_no) - def replace_service_manager_item (self, item): + def replace_service_manager_item(self, item): """ Replacement item following a remote edit - This action also takes place when a song that is sent to live from Service Manager is edited. If display is blanked, this will update the song and then re-blank the display. As result, lyrics are flashed on screen for a very short time before re-blanking happens. (Bug) @@ -810,6 +809,7 @@ class SlideController(DisplayController, RegistryProperties): elif self.desktop_screen.isChecked(): self._process_item(item, self.preview_widget.current_slide_number()) self.on_hide_display(True) + self.on_hide_display(True) def add_service_manager_item(self, item, slide_no): """ From ddae0b42476f851b46ee21e8fb73c32d7d7eccf6 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 15 Mar 2016 16:11:24 +0200 Subject: [PATCH 06/66] Removed duplicate: self.on_hide_display(True) (Was trying to create/test a test but failed and forgot to take it away) --- openlp/core/ui/slidecontroller.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index d000b80e9..fac67437f 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -809,7 +809,6 @@ class SlideController(DisplayController, RegistryProperties): elif self.desktop_screen.isChecked(): self._process_item(item, self.preview_widget.current_slide_number()) self.on_hide_display(True) - self.on_hide_display(True) def add_service_manager_item(self, item, slide_no): """ From 4a6b5b7cc4db677d3d1a75f54bd61ecce0f404e1 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 15 Mar 2016 20:37:55 +0200 Subject: [PATCH 07/66] In this merge: - Moved setting for controlling unblanking behaviour to General options tab. - Removed it from advanced tab - Changed default setting to "no" - Looped playback (once or to end) is now linked to this setting - Unblanking slides on click -.- no longer unblanks display when sending new items live if "Unblank display when sending new item to live" is not enabled. -.- - Doubleclicking preview -.- ^^ - Improved some comments To do: Test(s)? --- openlp/core/common/settings.py | 2 +- openlp/core/ui/advancedtab.py | 7 ------- openlp/core/ui/generaltab.py | 7 +++++++ openlp/core/ui/slidecontroller.py | 21 ++++++++++++++++----- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index ea554e6a3..cca78bd2d 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -119,7 +119,6 @@ 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, @@ -141,6 +140,7 @@ class Settings(QtCore.QSettings): 'core/auto preview': False, 'core/audio start paused': True, 'core/auto unblank': False, + 'core/click live slide to unblank': False, 'core/blank warning': False, 'core/ccli number': '', 'core/has run wizard': False, diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index d63c7385a..4421b432f 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -73,10 +73,7 @@ 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) @@ -271,8 +268,6 @@ 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', @@ -343,7 +338,6 @@ 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')) @@ -425,7 +419,6 @@ 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/generaltab.py b/openlp/core/ui/generaltab.py index 8ed8b3edf..da60f8311 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -173,6 +173,9 @@ class GeneralTab(SettingsTab): self.auto_unblank_check_box = QtWidgets.QCheckBox(self.settings_group_box) self.auto_unblank_check_box.setObjectName('auto_unblank_check_box') self.settings_layout.addRow(self.auto_unblank_check_box) + self.click_live_slide_to_unblank_check_box = QtWidgets.QCheckBox(self.settings_group_box) + self.click_live_slide_to_unblank_check_box.setObjectName('click_live_slide_to_unblank_') + self.settings_layout.addRow(self.click_live_slide_to_unblank_check_box) self.auto_preview_check_box = QtWidgets.QCheckBox(self.settings_group_box) self.auto_preview_check_box.setObjectName('auto_preview_check_box') self.settings_layout.addRow(self.auto_preview_check_box) @@ -217,6 +220,8 @@ class GeneralTab(SettingsTab): self.save_check_service_check_box.setText(translate('OpenLP.GeneralTab', 'Prompt to save before starting a new service')) self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item')) + self.click_live_slide_to_unblank_check_box.setText(translate('OpenLP.GeneralTab', + 'Unblank display when changing slide in Live')) self.auto_preview_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically preview next item in service')) self.timeout_label.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:')) @@ -250,6 +255,7 @@ class GeneralTab(SettingsTab): self.password_edit.setText(settings.value('songselect password')) self.save_check_service_check_box.setChecked(settings.value('save prompt')) self.auto_unblank_check_box.setChecked(settings.value('auto unblank')) + self.click_live_slide_to_unblank_check_box.setChecked(settings.value('click live slide to unblank')) self.display_on_monitor_check.setChecked(self.screens.display) self.warning_check_box.setChecked(settings.value('blank warning')) self.auto_open_check_box.setChecked(settings.value('auto open')) @@ -287,6 +293,7 @@ class GeneralTab(SettingsTab): settings.setValue('update check', self.check_for_updates_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()) settings.setValue('auto preview', self.auto_preview_check_box.isChecked()) settings.setValue('loop delay', self.timeout_spin_box.value()) settings.setValue('ccli number', self.number_edit.displayText()) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index fac67437f..d8df7d305 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -792,6 +792,8 @@ class SlideController(DisplayController, RegistryProperties): This action also takes place when a song that is sent to live from Service Manager is edited. If display is blanked, this will update the song and then re-blank the display. As result, lyrics are flashed on screen for a very short time before re-blanking happens. (Bug) + This happens only when Automatic unblanking is enabled when new item is sen to Live, + if it's not enabled they won't flash. :param item: The current service item """ @@ -1105,8 +1107,14 @@ class SlideController(DisplayController, RegistryProperties): 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') + # If "click live slide to unblank" is enabled, unblank the display. + # Note: If this if statement is placed at the bottom of this function instead of top slide transitions are lost. + if self.is_live and Settings().value('core/click live slide to unblank'): + # With this display stays blanked when "auto unblank" setting is not enabled and new item is sent to Live. + if not Settings().value('core/auto unblank') and start: + () + else: + Registry().execute('slidecontroller_live_unblank') row = self.preview_widget.current_slide_number() old_selected_row = self.selected_row self.selected_row = 0 @@ -1275,7 +1283,8 @@ class SlideController(DisplayController, RegistryProperties): self.play_slides_once.setText(UiStrings().PlaySlidesToEnd) self.play_slides_menu.setDefaultAction(self.play_slides_loop) self.play_slides_once.setChecked(False) - Registry().execute('slidecontroller_live_unblank') + if Settings().value('core/click live slide to unblank'): + Registry().execute('slidecontroller_live_unblank') else: self.play_slides_loop.setIcon(build_icon(':/media/media_time.png')) self.play_slides_loop.setText(UiStrings().PlaySlidesInLoop) @@ -1299,7 +1308,8 @@ class SlideController(DisplayController, RegistryProperties): self.play_slides_loop.setText(UiStrings().PlaySlidesInLoop) self.play_slides_menu.setDefaultAction(self.play_slides_once) self.play_slides_loop.setChecked(False) - Registry().execute('slidecontroller_live_unblank') + if Settings().value('core/click live slide to unblank'): + Registry().execute('slidecontroller_live_unblank') else: self.play_slides_once.setIcon(build_icon(':/media/media_time')) self.play_slides_once.setText(UiStrings().PlaySlidesToEnd) @@ -1361,7 +1371,8 @@ class SlideController(DisplayController, RegistryProperties): Registry().execute('%s_stop' % self.service_item.name.lower(), [self.service_item, self.is_live]) if self.service_item.is_media(): self.on_media_close() - self.on_go_live() + if Settings().value('core/auto unblank'): + self.on_go_live() else: self.on_preview_add_to_service() From 6858a7cfb5d98408a69687b03d96e13644036453 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Fri, 1 Apr 2016 16:08:44 +0300 Subject: [PATCH 08/66] Added 3 tests for replacing Live item from service manager while display is blanked. (One for each) --- .../openlp_core_ui/test_slidecontroller.py | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 20e48cbe0..487ea205e 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -538,6 +538,103 @@ class TestSlideController(TestCase): mocked_preview_widget.current_slide_number.assert_called_with() mocked_process_item.assert_called_once_with(mocked_item, 7) + def replace_service_manager_item_on_blank_display_test(self): + """ + Test that when the service item is replaced, display remains blanked if it was blanked. + """ + # GIVEN: A slide controller and a new item to add, blanked display. + mocked_item = MagicMock() + mocked_preview_widget = MagicMock() + mocked_preview_widget.current_slide_number = MagicMock() + mocked_process_item = MagicMock() + slide_controller = SlideController(None) + slide_controller.preview_widget = mocked_preview_widget + slide_controller._process_item = mocked_process_item + slide_controller.service_item = mocked_item + slide_controller.hide_menu = MagicMock() + slide_controller.hide_mode = MagicMock() + slide_controller.hide_mode.return_value = True + slide_controller.blank_screen = MagicMock() + slide_controller.blank_screen.isChecked = MagicMock() + slide_controller.blank_screen.isChecked.return_value = True + slide_controller.on_blank_display = mocked_item + slide_controller.theme_screen = MagicMock() + slide_controller.desktop_screen = MagicMock() + slide_controller.log_debug = MagicMock() + + # WHEN: The service item is replaced + slide_controller.replace_service_manager_item(mocked_item) + + # THEN: The display should remain blanked + slide_controller.on_blank_display.assert_called_once_with(True) + + def replace_service_manager_item_on_theme_display_test(self): + """ + Test that when the service item is replaced, display remains blanked if it was blanked. + """ + # GIVEN: A slide controller and a new item to add, blanked display. + mocked_item = MagicMock() + mocked_preview_widget = MagicMock() + mocked_preview_widget.current_slide_number = MagicMock() + mocked_process_item = MagicMock() + slide_controller = SlideController(None) + slide_controller.preview_widget = mocked_preview_widget + slide_controller._process_item = mocked_process_item + slide_controller.service_item = mocked_item + slide_controller.hide_menu = MagicMock() + slide_controller.hide_mode = MagicMock() + slide_controller.hide_mode.return_value = True + slide_controller.blank_screen = MagicMock() + slide_controller.blank_screen.isChecked = MagicMock() + slide_controller.blank_screen.isChecked.return_value = False + slide_controller.theme_screen = MagicMock() + slide_controller.theme_screen.isChecked = MagicMock() + slide_controller.theme_screen.isChecked.return_value = True + slide_controller.on_theme_display = mocked_item + slide_controller.desktop_screen = MagicMock() + slide_controller.log_debug = MagicMock() + + # WHEN: The service item is replaced + slide_controller.replace_service_manager_item(mocked_item) + + # THEN: The display should remain blanked + slide_controller.on_theme_display.assert_called_once_with(True) + + def replace_service_manager_item_on_hide_display_test(self): + """ + Test that when the service item is replaced, display remains blanked if it was blanked. + """ + # GIVEN: A slide controller and a new item to add, blanked display. + mocked_item = MagicMock() + mocked_preview_widget = MagicMock() + mocked_preview_widget.current_slide_number = MagicMock() + mocked_process_item = MagicMock() + slide_controller = SlideController(None) + slide_controller.preview_widget = mocked_preview_widget + slide_controller._process_item = mocked_process_item + slide_controller.service_item = mocked_item + slide_controller.hide_menu = MagicMock() + slide_controller.hide_mode = MagicMock() + slide_controller.hide_mode.return_value = True + slide_controller.blank_screen = MagicMock() + slide_controller.blank_screen.isChecked = MagicMock() + slide_controller.blank_screen.isChecked.return_value = False + slide_controller.theme_screen = MagicMock() + slide_controller.theme_screen.isChecked = MagicMock() + slide_controller.theme_screen.isChecked.return_value = False + slide_controller.on_theme_display = mocked_item + slide_controller.desktop_screen = MagicMock() + slide_controller.desktop_screen.isChecked = MagicMock() + slide_controller.desktop_screen.isChecked.return_value = True + slide_controller.on_hide_display = MagicMock() + slide_controller.log_debug = MagicMock() + + # WHEN: The service item is replaced + slide_controller.replace_service_manager_item(mocked_item) + + # THEN: The display should remain blanked + slide_controller.on_hide_display.assert_called_once_with(True) + def on_slide_blank_test(self): """ Test on_slide_blank From 10d68dad3ffe94f60d70d7c5f6eabd26614df4e3 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Fri, 1 Apr 2016 18:12:19 +0300 Subject: [PATCH 09/66] - Fixed issue where PPT/Impress is not unblanked on "Previous/Next" (Green arrows). --- openlp/plugins/presentations/lib/messagelistener.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index cc5a6f05e..566bef456 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -26,7 +26,7 @@ import os from PyQt5 import QtCore -from openlp.core.common import Registry +from openlp.core.common import Registry, Settings from openlp.core.ui import HideMode from openlp.core.lib import ServiceItemContext, ServiceItem from openlp.plugins.presentations.lib.pdfcontroller import PDF_CONTROLLER_FILETYPES @@ -419,6 +419,8 @@ class MessageListener(object): is_live = message[1] if is_live: self.live_handler.next() + if Settings().value('core/click live slide to unblank'): + Registry().execute('slidecontroller_live_unblank') else: self.preview_handler.next() @@ -431,6 +433,8 @@ class MessageListener(object): is_live = message[1] if is_live: self.live_handler.previous() + if Settings().value('core/click live slide to unblank'): + Registry().execute('slidecontroller_live_unblank') else: self.preview_handler.previous() From e8e893c842ba4516ba0972469928d07e11987382 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 3 Apr 2016 14:26:48 +0300 Subject: [PATCH 10/66] Changed Live to live (lowercaps) for controlling this setting to match other settings. --- openlp/core/ui/generaltab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index da60f8311..a7844063b 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -221,7 +221,7 @@ class GeneralTab(SettingsTab): 'Prompt to save before starting a new service')) self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item')) self.click_live_slide_to_unblank_check_box.setText(translate('OpenLP.GeneralTab', - 'Unblank display when changing slide in Live')) + 'Unblank display when changing slide in live')) self.auto_preview_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically preview next item in service')) self.timeout_label.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:')) From 1739492520b354585cb90eafdb930d808e6b1332 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 3 Apr 2016 18:54:39 +0300 Subject: [PATCH 11/66] This branch includes the following UI string changes: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These changes mainly take place on mainwindow.py but few other strings are changed as well. Media Manager, Projector Manager, Service Manager, Theme Manager, Preview Panel and Live Panel. have been renamed to: ”Library, Projectors, Service, Themes, Preview and Live." Tooltips/texts for these have been changed. In "Configurate OpenLP": - Changed typing for all labels to lowercase (Expect for starting videos automatically, that string may needs to be changed once bug related to that is fixed) - Removed "Manager" from some strings since it's no longer used. - Added dots to various tooltips / descriptions. In advanced tab: Number of recent files to display: has been changed to Number of recent Service files to display: --- openlp/core/ui/advancedtab.py | 8 +- openlp/core/ui/mainwindow.py | 75 ++++++++++--------- openlp/core/ui/media/playertab.py | 2 +- openlp/plugins/bibles/lib/biblestab.py | 8 +- openlp/plugins/media/lib/mediaitem.py | 2 +- .../presentations/lib/presentationtab.py | 4 +- 6 files changed, 51 insertions(+), 48 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 08adc0f29..9c75c4856 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -266,15 +266,15 @@ class AdvancedTab(SettingsTab): self.tab_title_visible = UiStrings().Advanced self.ui_group_box.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings')) self.data_directory_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Data Location')) - self.recent_label.setText(translate('OpenLP.AdvancedTab', 'Number of recent files to display:')) + self.recent_label.setText(translate('OpenLP.AdvancedTab', 'Number of recent service files to display:')) self.media_plugin_check_box.setText(translate('OpenLP.AdvancedTab', - 'Remember active media manager tab on startup')) + 'Open the last used library category on startup')) self.double_click_live_check_box.setText(translate('OpenLP.AdvancedTab', 'Double-click to send items straight to live')) self.single_click_preview_check_box.setText(translate('OpenLP.AdvancedTab', - 'Preview items when clicked in Media Manager')) + 'Preview items when clicked in library')) self.single_click_service_preview_check_box.setText(translate('OpenLP.AdvancedTab', - 'Preview items when clicked in Service Manager')) + 'Preview items when clicked in service')) self.expand_service_item_check_box.setText(translate('OpenLP.AdvancedTab', 'Expand new service items on creation')) self.enable_auto_close_check_box.setText(translate('OpenLP.AdvancedTab', diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 3fd154c14..7bb19934d 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -391,15 +391,15 @@ class Ui_MainWindow(object): self.file_export_menu.setTitle(translate('OpenLP.MainWindow', '&Export')) self.recent_files_menu.setTitle(translate('OpenLP.MainWindow', '&Recent Services')) self.view_menu.setTitle(translate('OpenLP.MainWindow', '&View')) - self.view_mode_menu.setTitle(translate('OpenLP.MainWindow', 'M&ode')) + self.view_mode_menu.setTitle(translate('OpenLP.MainWindow', '&Layout Presets')) self.tools_menu.setTitle(translate('OpenLP.MainWindow', '&Tools')) self.settings_menu.setTitle(translate('OpenLP.MainWindow', '&Settings')) self.settings_language_menu.setTitle(translate('OpenLP.MainWindow', '&Language')) self.help_menu.setTitle(translate('OpenLP.MainWindow', '&Help')) self.media_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Library')) - self.service_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Service Manager')) - self.theme_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Theme Manager')) - self.projector_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Projector Manager')) + self.service_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Service')) + self.theme_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Themes')) + self.projector_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Projectors')) self.file_new_item.setText(translate('OpenLP.MainWindow', '&New Service')) self.file_new_item.setToolTip(UiStrings().NewService) self.file_new_item.setStatusTip(UiStrings().CreateService) @@ -416,7 +416,7 @@ class Ui_MainWindow(object): self.print_service_order_item.setText(UiStrings().PrintService) self.print_service_order_item.setStatusTip(translate('OpenLP.MainWindow', 'Print the current service.')) self.file_exit_item.setText(translate('OpenLP.MainWindow', 'E&xit')) - self.file_exit_item.setStatusTip(translate('OpenLP.MainWindow', 'Quit OpenLP')) + self.file_exit_item.setStatusTip(translate('OpenLP.MainWindow', 'Exit OpenLP - Shut down the program.')) self.import_theme_item.setText(translate('OpenLP.MainWindow', '&Theme')) self.import_language_item.setText(translate('OpenLP.MainWindow', '&Language')) self.export_theme_item.setText(translate('OpenLP.MainWindow', '&Theme')) @@ -425,41 +425,42 @@ class Ui_MainWindow(object): self.formatting_tag_item.setText(translate('OpenLP.MainWindow', 'Configure &Formatting Tags...')) self.settings_configure_item.setText(translate('OpenLP.MainWindow', '&Configure OpenLP...')) self.settings_export_item.setStatusTip( - translate('OpenLP.MainWindow', 'Export OpenLP settings to a specified *.config file')) + translate('OpenLP.MainWindow', 'Export settings to a .config file.')) self.settings_export_item.setText(translate('OpenLP.MainWindow', 'Settings')) self.settings_import_item.setStatusTip( - translate('OpenLP.MainWindow', 'Import OpenLP settings from a specified *.config file previously ' - 'exported on this or another machine')) + translate('OpenLP.MainWindow', 'Import settings from a .config file previously exported from ' + 'this or an another machine.')) self.settings_import_item.setText(translate('OpenLP.MainWindow', 'Settings')) - self.view_projector_manager_item.setText(translate('OPenLP.MainWindow', '&Projector Manager')) - self.view_projector_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Toggle Projector Manager')) + self.view_projector_manager_item.setText(translate('OPenLP.MainWindow', '&Projectors')) + self.view_projector_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Hide or show Projectors.')) self.view_projector_manager_item.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the Projector Manager')) - self.view_media_manager_item.setText(translate('OpenLP.MainWindow', '&Media Manager')) - self.view_media_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Toggle Media Manager')) + 'Toggle the visibility of the Projectors.')) + self.view_media_manager_item.setText(translate('OpenLP.MainWindow', 'L&ibrary')) + self.view_media_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Hide or show the Library.')) self.view_media_manager_item.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the media manager.')) - self.view_theme_manager_item.setText(translate('OpenLP.MainWindow', '&Theme Manager')) - self.view_theme_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Toggle Theme Manager')) + 'Toggle the visibility of the Library.')) + self.view_theme_manager_item.setText(translate('OpenLP.MainWindow', '&Themes')) + self.view_theme_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Hide or show Themes')) self.view_theme_manager_item.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the theme manager.')) - self.view_service_manager_item.setText(translate('OpenLP.MainWindow', '&Service Manager')) - self.view_service_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Toggle Service Manager')) + 'Toggle the visibility of the Themes.')) + self.view_service_manager_item.setText(translate('OpenLP.MainWindow', '&Service')) + self.view_service_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Hide or show Service.')) self.view_service_manager_item.setStatusTip(translate('OpenLP.MainWindow', - 'Toggle the visibility of the service manager.')) - self.view_preview_panel.setText(translate('OpenLP.MainWindow', '&Preview Panel')) - self.view_preview_panel.setToolTip(translate('OpenLP.MainWindow', 'Toggle Preview Panel')) + 'Toggle the visibility of the Service.')) + self.view_preview_panel.setText(translate('OpenLP.MainWindow', '&Preview')) + self.view_preview_panel.setToolTip(translate('OpenLP.MainWindow', 'Hide or show Preview.')) self.view_preview_panel.setStatusTip( - translate('OpenLP.MainWindow', 'Toggle the visibility of the preview panel.')) - self.view_live_panel.setText(translate('OpenLP.MainWindow', '&Live Panel')) - self.view_live_panel.setToolTip(translate('OpenLP.MainWindow', 'Toggle Live Panel')) - self.lock_panel.setText(translate('OpenLP.MainWindow', 'L&ock Panels')) - self.lock_panel.setStatusTip(translate('OpenLP.MainWindow', 'Prevent the panels being moved.')) - self.view_live_panel.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the live panel.')) + translate('OpenLP.MainWindow', 'Toggle the visibility of the Preview.')) + self.view_live_panel.setText(translate('OpenLP.MainWindow', 'Li&ve')) + self.view_live_panel.setToolTip(translate('OpenLP.MainWindow', 'Hide or show Live')) + self.lock_panel.setText(translate('OpenLP.MainWindow', 'L&ock visibility of the panels')) + self.lock_panel.setStatusTip(translate('OpenLP.MainWindow', 'Lock visibility of the panels.')) + self.view_live_panel.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the Live.')) self.settings_plugin_list_item.setText(translate('OpenLP.MainWindow', '&Manage Plugins')) - self.settings_plugin_list_item.setStatusTip(translate('OpenLP.MainWindow', 'List the Plugins')) + self.settings_plugin_list_item.setStatusTip(translate('OpenLP.MainWindow', 'You can activate or disable plugins' + 'from here.')) self.about_item.setText(translate('OpenLP.MainWindow', '&About')) - self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP')) + self.about_item.setStatusTip(translate('OpenLP.MainWindow', 'More information about OpenLP.')) if is_win() or is_macosx(): self.offline_help_item.setText(translate('OpenLP.MainWindow', '&User Guide')) self.on_line_help_item.setText(translate('OpenLP.MainWindow', '&Online Help')) @@ -485,11 +486,13 @@ class Ui_MainWindow(object): self.update_theme_images.setStatusTip(translate('OpenLP.MainWindow', 'Update the preview images for all themes.')) self.mode_default_item.setText(translate('OpenLP.MainWindow', '&Default')) - self.mode_default_item.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode back to the default.')) + self.mode_default_item.setStatusTip(translate('OpenLP.MainWindow', 'Reset the interface layout back to the ' + 'default settings.')) self.mode_setup_item.setText(translate('OpenLP.MainWindow', '&Setup')) - self.mode_setup_item.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode to Setup.')) + self.mode_setup_item.setStatusTip(translate('OpenLP.MainWindow', 'Use layout that focuses on setting' + ' up the Service.')) self.mode_live_item.setText(translate('OpenLP.MainWindow', '&Live')) - self.mode_live_item.setStatusTip(translate('OpenLP.MainWindow', 'Set the view mode to Live.')) + self.mode_live_item.setStatusTip(translate('OpenLP.MainWindow', 'Use layout that focuses on Live.')) class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): @@ -851,9 +854,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): return import_file_name, filter_used = QtWidgets.QFileDialog.getOpenFileName( self, - translate('OpenLP.MainWindow', 'Open File'), + translate('OpenLP.MainWindow', 'Import settings'), '', - translate('OpenLP.MainWindow', 'OpenLP Export Settings Files (*.conf)')) + translate('OpenLP.MainWindow', 'OpenLP Settings (.conf)')) if not import_file_name: return setting_sections = [] @@ -943,7 +946,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): self, translate('OpenLP.MainWindow', 'Export Settings File'), '', - translate('OpenLP.MainWindow', 'OpenLP Export Settings File (*.conf)')) + translate('OpenLP.MainWindow', 'Exported OpenLP Settings (.conf)')) if not export_file_name: return # Make sure it's a .conf file. diff --git a/openlp/core/ui/media/playertab.py b/openlp/core/ui/media/playertab.py index 3db5e06b4..543b5d8b9 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -125,7 +125,7 @@ class PlayerTab(SettingsTab): self.media_player_group_box.setTitle(translate('OpenLP.PlayerTab', 'Available Media Players')) self.player_order_group_box.setTitle(translate('OpenLP.PlayerTab', 'Player Search Order')) self.background_color_group_box.setTitle(UiStrings().BackgroundColor) - self.background_color_label.setText(UiStrings().DefaultColor) + self.background_color_label.setText(UiStrings().BackgroundColor) self.information_label.setText(translate('OpenLP.PlayerTab', 'Visible background for videos with aspect ratio different to screen.')) self.retranslate_players() diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 5438d07f2..4fe5403cf 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -174,10 +174,10 @@ class BiblesTab(SettingsTab): 'Note:\nChanges do not affect verses already in the service.')) self.bible_second_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Display second Bible verses')) self.scripture_reference_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Custom Scripture References')) - self.verse_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Verse Separator:')) - self.range_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Range Separator:')) - self.list_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'List Separator:')) - self.end_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'End Mark:')) + self.verse_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Verse separator:')) + self.range_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Range separator:')) + self.list_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'List separator:')) + self.end_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'End mark:')) tip_text = translate('BiblesPlugin.BiblesTab', 'Multiple alternative verse separators may be defined.\nThey have to be separated by a ' 'vertical bar "|".\nPlease clear this edit line to use the default value.') diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index 09b32b308..4c48adedc 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -138,7 +138,7 @@ class MediaMediaItem(MediaManagerItem, RegistryProperties): disable_optical_button_text = True optical_button_text = translate('MediaPlugin.MediaItem', 'Load CD/DVD') optical_button_tooltip = translate('MediaPlugin.MediaItem', - 'Load CD/DVD - only supported when VLC is installed and enabled') + 'CD/DVD Playback is only supported if VLC is installed and enabled.') self.load_optical = self.toolbar.add_toolbar_action('load_optical', icon=self.optical_icon, text=optical_button_text, tooltip=optical_button_tooltip, diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index cbe881853..592854b45 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -125,7 +125,7 @@ class PresentationTab(SettingsTab): translate('PresentationPlugin.PresentationTab', 'Allow presentation application to be overridden')) self.ppt_slide_click_check_box.setText( translate('PresentationPlugin.PresentationTab', - 'Clicking on a selected slide in the slidecontroller advances to next effect.')) + 'Clicking on a selected slide in Live advances to the next effect.')) self.ppt_window_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Let PowerPoint control the size and position of the presentation window ' @@ -151,7 +151,7 @@ class PresentationTab(SettingsTab): if controller.name == 'Powerpoint' and controller.is_available(): powerpoint_available = True self.override_app_check_box.setChecked(Settings().value(self.settings_section + '/override app')) - # Load Powerpoint settings + # Load PowerPoint settings self.ppt_slide_click_check_box.setChecked(Settings().value(self.settings_section + '/powerpoint slide click advance')) self.ppt_slide_click_check_box.setEnabled(powerpoint_available) From dafbc3f0542dfd91d4e1818f59e5e48970707205 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 10 Apr 2016 02:51:41 +0300 Subject: [PATCH 12/66] In this commit: - Removed version number from main window name - Removed version number from remote window names - Reworked the traceback error message (New text, added margin to right) --- openlp/core/ui/exceptiondialog.py | 21 +++++++++++++-------- openlp/core/ui/exceptionform.py | 2 +- openlp/core/ui/mainwindow.py | 6 +++--- openlp/plugins/media/lib/mediatab.py | 2 +- openlp/plugins/remotes/lib/httprouter.py | 10 +++++----- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 9b835ea81..bad89f2ca 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -43,6 +43,8 @@ class Ui_ExceptionDialog(object): self.exception_layout.setObjectName('exception_layout') self.message_layout = QtWidgets.QHBoxLayout() self.message_layout.setObjectName('messageLayout') + # Set margin to make the box a bit wider so the traceback is easier to read. (left, top, right, bottom) + self.message_layout.setContentsMargins(0, 0, 50, 0) self.message_layout.addSpacing(12) self.bug_label = QtWidgets.QLabel(exception_dialog) self.bug_label.setPixmap(QtGui.QPixmap(':/graphics/exception.png')) @@ -90,15 +92,18 @@ class Ui_ExceptionDialog(object): """ exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) self.description_explanation.setText( - translate('OpenLP.ExceptionDialog', 'Please enter a description of what you were doing to cause this error.' - ' If possible, write in English.' - '\n(Minimum 20 characters)')) + translate('OpenLP.ExceptionDialog', 'Please describe what you were trying to do. ' + ' If possible, write in English.')) self.message_label.setText( - translate('OpenLP.ExceptionDialog', 'Oops! OpenLP hit a problem, and couldn\'t recover. The text in the ' - 'box below contains information that might be helpful to the OpenLP ' - 'developers, so please e-mail it to bugs@openlp.org, along with a ' - 'detailed description of what you were doing when the problem ' - 'occurred. Also attach any files that triggered the problem.')) + translate('OpenLP.ExceptionDialog', 'Oops, OpenLP hit a problem ' + 'and couldn\'t recover!

' + 'You can help OpenLP developers to fix this by
' + 'sending them a bug report ' + 'to bugs@openlp.org

' + 'No email app? You can save this ' + 'information to a file and
' + 'send it from your mail on browser via an attachement.

' + 'Thank you for being part of making OpenLP better!')) self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail')) self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File')) self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File')) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 2e4661579..f161e9b3b 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -200,7 +200,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): else: self.__button_state(False) self.description_word_count.setText( - translate('OpenLP.ExceptionDialog', 'Description characters to enter : %s') % count) + translate('OpenLP.ExceptionDialog', '%s Characters from the minimum description remaining.') % count) def on_attach_file_button_clicked(self): """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 7bb19934d..2e5ff2c39 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -385,7 +385,7 @@ class Ui_MainWindow(object): """ Set up the translation system """ - main_window.setWindowTitle(UiStrings().OLPV2x) + main_window.setWindowTitle(UiStrings().OLP) self.file_menu.setTitle(translate('OpenLP.MainWindow', '&File')) self.file_import_menu.setTitle(translate('OpenLP.MainWindow', '&Import')) self.file_export_menu.setTitle(translate('OpenLP.MainWindow', '&Export')) @@ -1156,9 +1156,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): :param file_name: The file name of the service file. """ if modified: - title = '%s - %s*' % (UiStrings().OLPV2x, file_name) + title = '%s - %s*' % (UiStrings().OLP, file_name) else: - title = '%s - %s' % (UiStrings().OLPV2x, file_name) + title = '%s - %s' % (UiStrings().OLP, file_name) self.setWindowTitle(title) def show_status_message(self, message): diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 5b8fb7c2f..fcd899b0c 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -54,7 +54,7 @@ class MediaTab(SettingsTab): def retranslateUi(self): self.advanced_group_box.setTitle(UiStrings().Advanced) self.override_player_check_box.setText(translate('MediaPlugin.MediaTab', 'Allow media player to be overridden')) - self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start Live items automatically')) + self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start live items automatically')) def load(self): self.override_player_check_box.setChecked(Settings().value(self.settings_section + '/override player')) diff --git a/openlp/plugins/remotes/lib/httprouter.py b/openlp/plugins/remotes/lib/httprouter.py index d5e8cda1c..0a8e44432 100644 --- a/openlp/plugins/remotes/lib/httprouter.py +++ b/openlp/plugins/remotes/lib/httprouter.py @@ -312,12 +312,12 @@ class HttpRouter(RegistryProperties): Translate various strings in the mobile app. """ remote = translate('RemotePlugin.Mobile', 'Remote') - stage = translate('RemotePlugin.Mobile', 'Stage View') - live = translate('RemotePlugin.Mobile', 'Live View') + stage = translate('RemotePlugin.Mobile', 'Stage') + #live = translate('RemotePlugin.Mobile', 'Live') self.template_vars = { - 'app_title': "%s %s" % (UiStrings().OLPV2x, remote), - 'stage_title': "%s %s" % (UiStrings().OLPV2x, stage), - 'live_title': "%s %s" % (UiStrings().OLPV2x, live), + 'app_title': "OpenLP | %s" % remote, + 'stage_title': "OpenLP | %s" % stage, + 'live_title': "OpenLP | %s" % (UiStrings().Live), 'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'), 'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'), 'alerts': translate('RemotePlugin.Mobile', 'Alerts'), From c5f0f86cbbeaa75f9d288828ea99f0fa215f669e Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 10 Apr 2016 02:55:24 +0300 Subject: [PATCH 13/66] In this commit: - Removed version number from main window name - Removed version number from remote window names - Reworked the traceback error message (New text, added margin to right) - Changed typing of "Live" to live in start live items automatically on media tab. - This is the actual changelog for last rev, commited it by mistake before removing one comment. --- openlp/plugins/remotes/lib/httprouter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/openlp/plugins/remotes/lib/httprouter.py b/openlp/plugins/remotes/lib/httprouter.py index 0a8e44432..f91a3fe35 100644 --- a/openlp/plugins/remotes/lib/httprouter.py +++ b/openlp/plugins/remotes/lib/httprouter.py @@ -313,11 +313,10 @@ class HttpRouter(RegistryProperties): """ remote = translate('RemotePlugin.Mobile', 'Remote') stage = translate('RemotePlugin.Mobile', 'Stage') - #live = translate('RemotePlugin.Mobile', 'Live') self.template_vars = { 'app_title': "OpenLP | %s" % remote, 'stage_title': "OpenLP | %s" % stage, - 'live_title': "OpenLP | %s" % (UiStrings().Live), + 'live_title': "OpenLP | %s" % UiStrings().Live, 'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'), 'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'), 'alerts': translate('RemotePlugin.Mobile', 'Alerts'), From 0275b067117e8ab6d7340413a92975c44dea32cd Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 10 Apr 2016 03:12:18 +0300 Subject: [PATCH 14/66] Hopefully fixed the test for checking the main window name... --- tests/functional/openlp_core_ui/test_mainwindow.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/functional/openlp_core_ui/test_mainwindow.py b/tests/functional/openlp_core_ui/test_mainwindow.py index a49ded25c..7f962609e 100644 --- a/tests/functional/openlp_core_ui/test_mainwindow.py +++ b/tests/functional/openlp_core_ui/test_mainwindow.py @@ -108,9 +108,9 @@ class TestMainWindow(TestCase, TestMixin): # WHEN no changes are made to the service - # THEN the main window's title shoud be the same as the OLPV2x string in the UiStrings class - self.assertEqual(self.main_window.windowTitle(), UiStrings().OLPV2x, - 'The main window\'s title should be the same as the OLPV2x string in UiStrings class') + # THEN the main window's title shoud be the same as the OLP string in the UiStrings class + self.assertEqual(self.main_window.windowTitle(), UiStrings().OLP, + 'The main window\'s title should be the same as the OLP string in UiStrings class') def set_service_modifed_test(self): """ @@ -122,8 +122,8 @@ class TestMainWindow(TestCase, TestMixin): self.main_window.set_service_modified(True, 'test.osz') # THEN the main window's title should be set to the - self.assertEqual(self.main_window.windowTitle(), '%s - %s*' % (UiStrings().OLPV2x, 'test.osz'), - 'The main window\'s title should be set to " - test.osz*"') + self.assertEqual(self.main_window.windowTitle(), '%s - %s*' % (UiStrings().OLP, 'test.osz'), + 'The main window\'s title should be set to " - test.osz*"') def set_service_unmodified_test(self): """ @@ -135,8 +135,8 @@ class TestMainWindow(TestCase, TestMixin): self.main_window.set_service_modified(False, 'test.osz') # THEN the main window's title should be set to the - self.assertEqual(self.main_window.windowTitle(), '%s - %s' % (UiStrings().OLPV2x, 'test.osz'), - 'The main window\'s title should be set to " - test.osz"') + self.assertEqual(self.main_window.windowTitle(), '%s - %s' % (UiStrings().OLP, 'test.osz'), + 'The main window\'s title should be set to " - test.osz"') def mainwindow_configuration_test(self): """ From 4af785bf1dd2e78fc1a2aa152ea879ea74f7cd77 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 12 Apr 2016 05:29:10 +0300 Subject: [PATCH 15/66] - Re-did some of the changes. - Fixed Powerpoint to PowerPoint in presentation controllers and one error. --- openlp/core/ui/mainwindow.py | 8 ++++---- openlp/plugins/presentations/lib/powerpointcontroller.py | 4 ++-- openlp/plugins/presentations/lib/pptviewcontroller.py | 2 +- openlp/plugins/presentations/lib/presentationtab.py | 6 +++--- openlp/plugins/presentations/presentationplugin.py | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 2e5ff2c39..ec4d5e237 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -416,7 +416,7 @@ class Ui_MainWindow(object): self.print_service_order_item.setText(UiStrings().PrintService) self.print_service_order_item.setStatusTip(translate('OpenLP.MainWindow', 'Print the current service.')) self.file_exit_item.setText(translate('OpenLP.MainWindow', 'E&xit')) - self.file_exit_item.setStatusTip(translate('OpenLP.MainWindow', 'Exit OpenLP - Shut down the program.')) + self.file_exit_item.setStatusTip(translate('OpenLP.MainWindow', 'Close OpenLP - Shut down the program.')) self.import_theme_item.setText(translate('OpenLP.MainWindow', '&Theme')) self.import_language_item.setText(translate('OpenLP.MainWindow', '&Language')) self.export_theme_item.setText(translate('OpenLP.MainWindow', '&Theme')) @@ -425,10 +425,10 @@ class Ui_MainWindow(object): self.formatting_tag_item.setText(translate('OpenLP.MainWindow', 'Configure &Formatting Tags...')) self.settings_configure_item.setText(translate('OpenLP.MainWindow', '&Configure OpenLP...')) self.settings_export_item.setStatusTip( - translate('OpenLP.MainWindow', 'Export settings to a .config file.')) + translate('OpenLP.MainWindow', 'Export settings to a *.config file.')) self.settings_export_item.setText(translate('OpenLP.MainWindow', 'Settings')) self.settings_import_item.setStatusTip( - translate('OpenLP.MainWindow', 'Import settings from a .config file previously exported from ' + translate('OpenLP.MainWindow', 'Import OpenLP settings from a *.config file previously exported from ' 'this or an another machine.')) self.settings_import_item.setText(translate('OpenLP.MainWindow', 'Settings')) self.view_projector_manager_item.setText(translate('OPenLP.MainWindow', '&Projectors')) @@ -946,7 +946,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): self, translate('OpenLP.MainWindow', 'Export Settings File'), '', - translate('OpenLP.MainWindow', 'Exported OpenLP Settings (.conf)')) + translate('OpenLP.MainWindow', 'Exported OpenLP Settings (*.conf)')) if not export_file_name: return # Make sure it's a .conf file. diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 6cc6a8450..e5e7c40b9 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -60,7 +60,7 @@ class PowerpointController(PresentationController): Initialise the class """ log.debug('Initialising') - super(PowerpointController, self).__init__(plugin, 'Powerpoint', PowerpointDocument) + super(PowerpointController, self).__init__(plugin, 'PowerPoint', PowerpointDocument) self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm'] self.process = None @@ -514,7 +514,7 @@ class PowerpointDocument(PresentationDocument): log.exception('Failed to exit Powerpoint presentation after error') log.exception(e) critical_error_message_box(UiStrings().Error, translate('PresentationPlugin.PowerpointDocument', - 'An error occurred in the Powerpoint integration ' + 'An error occurred in the PowerPoint integration ' 'and the presentation will be stopped. ' 'Restart the presentation if you wish to present it.')) diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index aba0aa88e..f1a3a49f8 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -55,7 +55,7 @@ class PptviewController(PresentationController): """ log.debug('Initialising') self.process = None - super(PptviewController, self).__init__(plugin, 'Powerpoint Viewer', PptviewDocument) + super(PptviewController, self).__init__(plugin, 'PowerPoint Viewer', PptviewDocument) self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm'] def check_available(self): diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 592854b45..55bffbb2b 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -125,11 +125,11 @@ class PresentationTab(SettingsTab): translate('PresentationPlugin.PresentationTab', 'Allow presentation application to be overridden')) self.ppt_slide_click_check_box.setText( translate('PresentationPlugin.PresentationTab', - 'Clicking on a selected slide in Live advances to the next effect.')) + 'Clicking on a selected slide in live advances to the next effect')) self.ppt_window_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Let PowerPoint control the size and position of the presentation window ' - '(workaround for Windows 8 scaling issue).')) + '(workaround for Windows 8 scaling issue)')) self.pdf_program_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Use given full path for mudraw or ghostscript binary:')) @@ -148,7 +148,7 @@ class PresentationTab(SettingsTab): controller = self.controllers[key] checkbox = self.presenter_check_boxes[controller.name] checkbox.setChecked(Settings().value(self.settings_section + '/' + controller.name)) - if controller.name == 'Powerpoint' and controller.is_available(): + if controller.name == 'PowerPoint' and controller.is_available(): powerpoint_available = True self.override_app_check_box.setChecked(Settings().value(self.settings_section + '/override app')) # Load PowerPoint settings diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index ff14d821c..330ff0cc5 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -40,8 +40,8 @@ __default_settings__ = {'presentations/override app': QtCore.Qt.Unchecked, 'presentations/enable_pdf_program': QtCore.Qt.Unchecked, 'presentations/pdf_program': '', 'presentations/Impress': QtCore.Qt.Checked, - 'presentations/Powerpoint': QtCore.Qt.Checked, - 'presentations/Powerpoint Viewer': QtCore.Qt.Checked, + 'presentations/PowerPoint': QtCore.Qt.Checked, + 'presentations/PowerPoint Viewer': QtCore.Qt.Checked, 'presentations/Pdf': QtCore.Qt.Checked, 'presentations/presentations files': [], 'presentations/thumbnail_scheme': '', From 2c9502418fbb0e695f60b64d51c3439eced1825f Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 12 Apr 2016 05:54:23 +0300 Subject: [PATCH 16/66] - Fixed PPT name tests by changing Powerpoint into PowerPoint - Replaced resources.py with trunk version. --- tests/functional/openlp_plugins/presentations/test_mediaitem.py | 2 +- .../openlp_plugins/presentations/test_powerpointcontroller.py | 2 +- .../openlp_plugins/presentations/test_pptviewcontroller.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional/openlp_plugins/presentations/test_mediaitem.py b/tests/functional/openlp_plugins/presentations/test_mediaitem.py index a689966ec..daa2886f6 100644 --- a/tests/functional/openlp_plugins/presentations/test_mediaitem.py +++ b/tests/functional/openlp_plugins/presentations/test_mediaitem.py @@ -69,7 +69,7 @@ class TestMediaItem(TestCase, TestMixin): self.media_item.controllers = { 'Impress': impress_controller, 'Powerpoint': presentation_controller, - 'Powerpoint Viewer': presentation_viewer_controller, + 'PowerPoint Viewer': presentation_viewer_controller, 'Pdf': pdf_controller } diff --git a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py index c6ddb8238..935aa7881 100644 --- a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py @@ -76,7 +76,7 @@ class TestPowerpointController(TestCase, TestMixin): controller = PowerpointController(plugin=self.mock_plugin) # THEN: The name of the presentation controller should be correct - self.assertEqual('Powerpoint', controller.name, + self.assertEqual('PowerPoint', controller.name, 'The name of the presentation controller should be correct') diff --git a/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py b/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py index 104c0e1fa..d54379db7 100644 --- a/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py @@ -76,7 +76,7 @@ class TestPptviewController(TestCase, TestMixin): controller = PptviewController(plugin=self.mock_plugin) # THEN: The name of the presentation controller should be correct - self.assertEqual('Powerpoint Viewer', controller.name, + self.assertEqual('PowerPoint Viewer', controller.name, 'The name of the presentation controller should be correct') def check_available_test(self): From 42b72ab3a6da8a91ff5eaf814e71d19d538cf294 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 12 Apr 2016 06:08:47 +0300 Subject: [PATCH 17/66] Added back the last missing * --- openlp/core/ui/mainwindow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ec4d5e237..676a38098 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -856,7 +856,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): self, translate('OpenLP.MainWindow', 'Import settings'), '', - translate('OpenLP.MainWindow', 'OpenLP Settings (.conf)')) + translate('OpenLP.MainWindow', 'OpenLP Settings (*.conf)')) if not import_file_name: return setting_sections = [] From 6a0108ced152a172430e79b894db36a8a11783d0 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 12 Apr 2016 15:58:00 +0300 Subject: [PATCH 18/66] - Changed: Clicking on selected slide in live advances to the next effect to Clicking on current slide in live advances to the next effect --- openlp/plugins/presentations/lib/presentationtab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 55bffbb2b..5d272ceda 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -125,7 +125,7 @@ class PresentationTab(SettingsTab): translate('PresentationPlugin.PresentationTab', 'Allow presentation application to be overridden')) self.ppt_slide_click_check_box.setText( translate('PresentationPlugin.PresentationTab', - 'Clicking on a selected slide in live advances to the next effect')) + 'Clicking on current slide in live advances to the next effect')) self.ppt_window_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Let PowerPoint control the size and position of the presentation window ' From 33078b426ff8860ccefecbdd19d62b5d0254c0da Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Wed, 13 Apr 2016 17:10:47 +0300 Subject: [PATCH 19/66] - Reverted the Powerpoint > PowerPoint changes. --- openlp/plugins/presentations/lib/powerpointcontroller.py | 2 +- openlp/plugins/presentations/lib/pptviewcontroller.py | 2 +- openlp/plugins/presentations/lib/presentationtab.py | 2 +- openlp/plugins/presentations/presentationplugin.py | 4 ++-- .../functional/openlp_plugins/presentations/test_mediaitem.py | 2 +- .../openlp_plugins/presentations/test_powerpointcontroller.py | 2 +- .../openlp_plugins/presentations/test_pptviewcontroller.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index e5e7c40b9..2e6959ade 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -60,7 +60,7 @@ class PowerpointController(PresentationController): Initialise the class """ log.debug('Initialising') - super(PowerpointController, self).__init__(plugin, 'PowerPoint', PowerpointDocument) + super(PowerpointController, self).__init__(plugin, 'Powerpoint', PowerpointDocument) self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm'] self.process = None diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index f1a3a49f8..aba0aa88e 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -55,7 +55,7 @@ class PptviewController(PresentationController): """ log.debug('Initialising') self.process = None - super(PptviewController, self).__init__(plugin, 'PowerPoint Viewer', PptviewDocument) + super(PptviewController, self).__init__(plugin, 'Powerpoint Viewer', PptviewDocument) self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm'] def check_available(self): diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 5d272ceda..62c94832b 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -148,7 +148,7 @@ class PresentationTab(SettingsTab): controller = self.controllers[key] checkbox = self.presenter_check_boxes[controller.name] checkbox.setChecked(Settings().value(self.settings_section + '/' + controller.name)) - if controller.name == 'PowerPoint' and controller.is_available(): + if controller.name == 'Powerpoint' and controller.is_available(): powerpoint_available = True self.override_app_check_box.setChecked(Settings().value(self.settings_section + '/override app')) # Load PowerPoint settings diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 330ff0cc5..ff14d821c 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -40,8 +40,8 @@ __default_settings__ = {'presentations/override app': QtCore.Qt.Unchecked, 'presentations/enable_pdf_program': QtCore.Qt.Unchecked, 'presentations/pdf_program': '', 'presentations/Impress': QtCore.Qt.Checked, - 'presentations/PowerPoint': QtCore.Qt.Checked, - 'presentations/PowerPoint Viewer': QtCore.Qt.Checked, + 'presentations/Powerpoint': QtCore.Qt.Checked, + 'presentations/Powerpoint Viewer': QtCore.Qt.Checked, 'presentations/Pdf': QtCore.Qt.Checked, 'presentations/presentations files': [], 'presentations/thumbnail_scheme': '', diff --git a/tests/functional/openlp_plugins/presentations/test_mediaitem.py b/tests/functional/openlp_plugins/presentations/test_mediaitem.py index daa2886f6..a689966ec 100644 --- a/tests/functional/openlp_plugins/presentations/test_mediaitem.py +++ b/tests/functional/openlp_plugins/presentations/test_mediaitem.py @@ -69,7 +69,7 @@ class TestMediaItem(TestCase, TestMixin): self.media_item.controllers = { 'Impress': impress_controller, 'Powerpoint': presentation_controller, - 'PowerPoint Viewer': presentation_viewer_controller, + 'Powerpoint Viewer': presentation_viewer_controller, 'Pdf': pdf_controller } diff --git a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py index 935aa7881..c6ddb8238 100644 --- a/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_powerpointcontroller.py @@ -76,7 +76,7 @@ class TestPowerpointController(TestCase, TestMixin): controller = PowerpointController(plugin=self.mock_plugin) # THEN: The name of the presentation controller should be correct - self.assertEqual('PowerPoint', controller.name, + self.assertEqual('Powerpoint', controller.name, 'The name of the presentation controller should be correct') diff --git a/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py b/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py index d54379db7..104c0e1fa 100644 --- a/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py +++ b/tests/functional/openlp_plugins/presentations/test_pptviewcontroller.py @@ -76,7 +76,7 @@ class TestPptviewController(TestCase, TestMixin): controller = PptviewController(plugin=self.mock_plugin) # THEN: The name of the presentation controller should be correct - self.assertEqual('PowerPoint Viewer', controller.name, + self.assertEqual('Powerpoint Viewer', controller.name, 'The name of the presentation controller should be correct') def check_available_test(self): From 5fa068776213080b9d6b49b33ba66cc6d110c140 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Wed, 13 Apr 2016 17:22:56 +0300 Subject: [PATCH 20/66] Changed spelling of live back to Live (Capitalized) on settings. --- openlp/core/ui/generaltab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index a7844063b..da60f8311 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -221,7 +221,7 @@ class GeneralTab(SettingsTab): 'Prompt to save before starting a new service')) self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item')) self.click_live_slide_to_unblank_check_box.setText(translate('OpenLP.GeneralTab', - 'Unblank display when changing slide in live')) + 'Unblank display when changing slide in Live')) self.auto_preview_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically preview next item in service')) self.timeout_label.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:')) From feb549a8e7ba10f5b92a0cb0271f657dc767de94 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Wed, 13 Apr 2016 19:14:35 +0300 Subject: [PATCH 21/66] - Capitalized references to plugin/panel names in settings. (Live etc.) - Added: self.BackgroundColorColon = translate('OpenLP.Ui', 'Background color:') to uistrings. This is now used in players tab, alerts tab and images tab. - Added space before "s" and "pt" units. --- openlp/core/common/uistrings.py | 5 +++-- openlp/core/ui/advancedtab.py | 20 +++++++++---------- openlp/core/ui/generaltab.py | 8 ++++---- openlp/core/ui/media/playertab.py | 2 +- openlp/plugins/alerts/lib/alertstab.py | 2 +- openlp/plugins/bibles/lib/biblestab.py | 2 +- openlp/plugins/images/lib/imagetab.py | 2 +- openlp/plugins/media/lib/mediatab.py | 2 +- .../presentations/lib/presentationtab.py | 6 +++--- openlp/plugins/songs/lib/songstab.py | 6 +++--- 10 files changed, 28 insertions(+), 27 deletions(-) diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index 33ebb0a5b..f5d0514cb 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -56,6 +56,7 @@ class UiStrings(object): self.AllFiles = translate('OpenLP.Ui', 'All Files') self.Automatic = translate('OpenLP.Ui', 'Automatic') self.BackgroundColor = translate('OpenLP.Ui', 'Background Color') + self.BackgroundColorColon = translate('OpenLP.Ui', 'Background color:') self.Bottom = translate('OpenLP.Ui', 'Bottom') self.Browse = translate('OpenLP.Ui', 'Browse...') self.Cancel = translate('OpenLP.Ui', 'Cancel') @@ -80,7 +81,7 @@ class UiStrings(object): self.File = translate('OpenLP.Ui', 'File') self.FileNotFound = translate('OpenLP.Ui', 'File Not Found') self.FileNotFoundMessage = translate('OpenLP.Ui', 'File %s not found.\nPlease try selecting it individually.') - self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font pointsize unit') + self.FontSizePtUnit = translate('OpenLP.Ui', ' pt', 'Abbreviated font pointsize unit') self.Help = translate('OpenLP.Ui', 'Help') self.Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours') self.IFdSs = translate('OpenLP.Ui', 'Invalid Folder Selected', 'Singular') @@ -126,7 +127,7 @@ class UiStrings(object): 'player is disabled.') self.ResetBG = translate('OpenLP.Ui', 'Reset Background') self.ResetLiveBG = translate('OpenLP.Ui', 'Reset live background.') - self.Seconds = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') + self.Seconds = translate('OpenLP.Ui', ' s', 'The abbreviated unit for seconds') self.SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview') self.Search = translate('OpenLP.Ui', 'Search') self.SearchThemes = translate('OpenLP.Ui', 'Search Themes...', 'Search bar place holder text ') diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 378670376..c96743e65 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -273,24 +273,24 @@ class AdvancedTab(SettingsTab): self.tab_title_visible = UiStrings().Advanced self.ui_group_box.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings')) self.data_directory_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Data Location')) - self.recent_label.setText(translate('OpenLP.AdvancedTab', 'Number of recent service files to display:')) + self.recent_label.setText(translate('OpenLP.AdvancedTab', 'Number of recent Service files to display:')) self.media_plugin_check_box.setText(translate('OpenLP.AdvancedTab', - 'Open the last used library category on startup')) + 'Open the last used Library category on startup')) self.double_click_live_check_box.setText(translate('OpenLP.AdvancedTab', - 'Double-click to send items straight to live')) + 'Double-click to send items straight to Live')) self.single_click_preview_check_box.setText(translate('OpenLP.AdvancedTab', - 'Preview items when clicked in library')) + 'Preview items when clicked in Library')) self.single_click_service_preview_check_box.setText(translate('OpenLP.AdvancedTab', - 'Preview items when clicked in service')) + 'Preview items when clicked in Service')) self.expand_service_item_check_box.setText(translate('OpenLP.AdvancedTab', - 'Expand new service items on creation')) + 'Expand new Service items on creation')) self.slide_max_height_label.setText(translate('OpenLP.AdvancedTab', 'Max height for non-text slides\nin slide controller:')) self.slide_max_height_spin_box.setSpecialValueText(translate('OpenLP.AdvancedTab', 'Disabled')) self.enable_auto_close_check_box.setText(translate('OpenLP.AdvancedTab', 'Enable application exit confirmation')) self.service_name_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Default Service Name')) - self.service_name_check_box.setText(translate('OpenLP.AdvancedTab', 'Enable default service name')) + self.service_name_check_box.setText(translate('OpenLP.AdvancedTab', 'Enable default Service name')) self.service_name_time_label.setText(translate('OpenLP.AdvancedTab', 'Date and Time:')) self.service_name_day.setItemText(0, translate('OpenLP.AdvancedTab', 'Monday')) self.service_name_day.setItemText(1, translate('OpenLP.AdvancedTab', 'Tuesday')) @@ -300,11 +300,11 @@ class AdvancedTab(SettingsTab): self.service_name_day.setItemText(5, translate('OpenLP.AdvancedTab', 'Saturday')) self.service_name_day.setItemText(6, translate('OpenLP.AdvancedTab', 'Sunday')) self.service_name_day.setItemText(7, translate('OpenLP.AdvancedTab', 'Now')) - self.service_name_time.setToolTip(translate('OpenLP.AdvancedTab', 'Time when usual service starts.')) + self.service_name_time.setToolTip(translate('OpenLP.AdvancedTab', 'Time when usual Service starts.')) self.service_name_label.setText(translate('OpenLP.AdvancedTab', 'Name:')) self.service_name_edit.setToolTip(translate('OpenLP.AdvancedTab', 'Consult the OpenLP manual for usage.')) self.service_name_revert_button.setToolTip( - translate('OpenLP.AdvancedTab', 'Revert to the default service name "%s".') % + translate('OpenLP.AdvancedTab', 'Revert to the default Service name "%s".') % UiStrings().DefaultServiceName) self.service_name_example_label.setText(translate('OpenLP.AdvancedTab', 'Example:')) self.hide_mouse_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor')) @@ -337,7 +337,7 @@ class AdvancedTab(SettingsTab): self.slide_label.setText(translate('OpenLP.GeneralTab', 'Behavior of next/previous on the last/first slide:')) self.end_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Remain on Slide')) self.wrap_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Wrap around')) - self.next_item_radio_button.setText(translate('OpenLP.GeneralTab', '&Move to next/previous service item')) + self.next_item_radio_button.setText(translate('OpenLP.GeneralTab', '&Move to next/previous Service item')) self.search_as_type_check_box.setText(translate('SongsPlugin.GeneralTab', 'Enable search as you type')) def load(self): diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 8ed8b3edf..1d72caccd 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -210,15 +210,15 @@ class GeneralTab(SettingsTab): self.display_on_monitor_check.setText(translate('OpenLP.GeneralTab', 'Display if a single screen')) self.startup_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Startup')) self.warning_check_box.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning')) - self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the last service')) + self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the last Service')) self.show_splash_check_box.setText(translate('OpenLP.GeneralTab', 'Show the splash screen')) self.check_for_updates_check_box.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP')) 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')) - self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new live item')) + 'Prompt to save before starting a new Service')) + self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new Live item')) self.auto_preview_check_box.setText(translate('OpenLP.GeneralTab', - 'Automatically preview next item in service')) + 'Automatically preview next item in Service')) self.timeout_label.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:')) self.timeout_spin_box.setSuffix(translate('OpenLP.GeneralTab', ' sec')) self.ccli_group_box.setTitle(translate('OpenLP.GeneralTab', 'CCLI Details')) diff --git a/openlp/core/ui/media/playertab.py b/openlp/core/ui/media/playertab.py index 543b5d8b9..6a2e866b1 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -125,7 +125,7 @@ class PlayerTab(SettingsTab): self.media_player_group_box.setTitle(translate('OpenLP.PlayerTab', 'Available Media Players')) self.player_order_group_box.setTitle(translate('OpenLP.PlayerTab', 'Player Search Order')) self.background_color_group_box.setTitle(UiStrings().BackgroundColor) - self.background_color_label.setText(UiStrings().BackgroundColor) + self.background_color_label.setText(UiStrings().BackgroundColorColon) self.information_label.setText(translate('OpenLP.PlayerTab', 'Visible background for videos with aspect ratio different to screen.')) self.retranslate_players() diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 2875493b6..f97530a7b 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -98,7 +98,7 @@ class AlertsTab(SettingsTab): self.font_group_box.setTitle(translate('AlertsPlugin.AlertsTab', 'Font')) self.font_label.setText(translate('AlertsPlugin.AlertsTab', 'Font name:')) self.font_color_label.setText(translate('AlertsPlugin.AlertsTab', 'Font color:')) - self.background_color_label.setText(translate('AlertsPlugin.AlertsTab', 'Background color:')) + self.background_color_label.setText(UiStrings().BackgroundColorColon) self.font_size_label.setText(translate('AlertsPlugin.AlertsTab', 'Font size:')) self.font_size_spin_box.setSuffix(UiStrings().FontSizePtUnit) self.timeout_label.setText(translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) diff --git a/openlp/plugins/bibles/lib/biblestab.py b/openlp/plugins/bibles/lib/biblestab.py index 4fe5403cf..2d002c991 100644 --- a/openlp/plugins/bibles/lib/biblestab.py +++ b/openlp/plugins/bibles/lib/biblestab.py @@ -171,7 +171,7 @@ class BiblesTab(SettingsTab): self.display_style_combo_box.setItemText(DisplayStyle.Square, translate('BiblesPlugin.BiblesTab', '[ And ]')) self.change_note_label.setText(translate('BiblesPlugin.BiblesTab', - 'Note:\nChanges do not affect verses already in the service.')) + 'Note: Changes do not affect verses in the Service')) self.bible_second_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Display second Bible verses')) self.scripture_reference_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Custom Scripture References')) self.verse_separator_check_box.setText(translate('BiblesPlugin.BiblesTab', 'Verse separator:')) diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 80578dc56..0c3dcc341 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -61,7 +61,7 @@ class ImageTab(SettingsTab): def retranslateUi(self): self.background_color_group_box.setTitle(UiStrings().BackgroundColor) - self.background_color_label.setText(UiStrings().DefaultColor) + self.background_color_label.setText(UiStrings().BackgroundColorColon) self.information_label.setText( translate('ImagesPlugin.ImageTab', 'Visible background for images with aspect ratio different to screen.')) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index fcd899b0c..5b8fb7c2f 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -54,7 +54,7 @@ class MediaTab(SettingsTab): def retranslateUi(self): self.advanced_group_box.setTitle(UiStrings().Advanced) self.override_player_check_box.setText(translate('MediaPlugin.MediaTab', 'Allow media player to be overridden')) - self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start live items automatically')) + self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start Live items automatically')) def load(self): self.override_player_check_box.setChecked(Settings().value(self.settings_section + '/override player')) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index 62c94832b..6b477454a 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -125,11 +125,11 @@ class PresentationTab(SettingsTab): translate('PresentationPlugin.PresentationTab', 'Allow presentation application to be overridden')) self.ppt_slide_click_check_box.setText( translate('PresentationPlugin.PresentationTab', - 'Clicking on current slide in live advances to the next effect')) + 'Clicking on current slide in Live advances to the next effect')) self.ppt_window_check_box.setText( translate('PresentationPlugin.PresentationTab', - 'Let PowerPoint control the size and position of the presentation window ' - '(workaround for Windows 8 scaling issue)')) + 'Let PowerPoint control the size and monitor of the presentations\n' + '(This may fixes PowerPoint scaling issues in Windows)')) self.pdf_program_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Use given full path for mudraw or ghostscript binary:')) diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index 5a8c18a50..ef2ce0605 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -68,10 +68,10 @@ class SongsTab(SettingsTab): def retranslateUi(self): self.mode_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Songs Mode')) self.tool_bar_active_check_box.setText(translate('SongsPlugin.SongsTab', - 'Display verses on live tool bar')) - self.update_on_edit_check_box.setText(translate('SongsPlugin.SongsTab', 'Update service from song edit')) + 'Enable "Go to verse" button in Live panel')) + self.update_on_edit_check_box.setText(translate('SongsPlugin.SongsTab', 'Update Service from song edit')) self.add_from_service_check_box.setText(translate('SongsPlugin.SongsTab', - 'Import missing songs from service files')) + 'Import missing songs from Service files')) self.display_songbook_check_box.setText(translate('SongsPlugin.SongsTab', 'Display songbook in footer')) self.display_copyright_check_box.setText(translate('SongsPlugin.SongsTab', 'Display "%s" symbol before copyright info') % From cc9f89bfdb6f43921afe163a37ea7ade8e0c98dc Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Wed, 13 Apr 2016 19:49:30 +0300 Subject: [PATCH 22/66] Splitted mail adress away expection error text, now inserting it with %s --- openlp/core/ui/exceptiondialog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index bad89f2ca..9a2e3acbd 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -90,6 +90,8 @@ class Ui_ExceptionDialog(object): """ Translate the widgets on the fly. """ + # Note that bugs_mail is not clicable, but it adds the blue color and underlining and makes the test copyable. + bugs_mail = ' bugs@openlp.org' exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) self.description_explanation.setText( translate('OpenLP.ExceptionDialog', 'Please describe what you were trying to do. ' @@ -97,13 +99,12 @@ class Ui_ExceptionDialog(object): self.message_label.setText( translate('OpenLP.ExceptionDialog', 'Oops, OpenLP hit a problem ' 'and couldn\'t recover!

' - 'You can help OpenLP developers to fix this by
' - 'sending them a bug report ' - 'to bugs@openlp.org

' + 'You can help OpenLP developers to fix this by
' + 'sending them a bug report to %s

' 'No email app? You can save this ' 'information to a file and
' 'send it from your mail on browser via an attachement.

' - 'Thank you for being part of making OpenLP better!')) + 'Thank you for being part of making OpenLP better!
') % bugs_mail) self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail')) self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File')) self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File')) From 69af91edef1c85b5d5289a150a22c7b29cb5e684 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Apr 2016 04:13:39 +0300 Subject: [PATCH 23/66] - Fixed bug 1462420 - Double clicking Preview adds item to Service countless times (Added hidden setting for controlling this, it is set to True once double clicking has added item to Service and gets reset to False once new item is sent to preview. --- openlp/core/common/settings.py | 1 + openlp/core/lib/mediamanageritem.py | 3 +++ openlp/core/ui/slidecontroller.py | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 757cd775f..7ba77719d 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -162,6 +162,7 @@ class Settings(QtCore.QSettings): 'core/display on monitor': True, 'core/override position': False, 'core/application version': '0.0', + 'core/doubleclicking preview has added to service': False, 'images/background color': '#000000', 'media/players': 'system,webkit', 'media/override player': QtCore.Qt.Unchecked, diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 04df1d38a..c53583e06 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -481,6 +481,9 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): 'You must select one or more items to preview.')) else: log.debug('%s Preview requested' % self.plugin.name) + # If ('advanced/double click live') is not enabled, double clicking preview adds the item to Service. + # This setting prevents it from being sent to Service multiple times, in here it is reset to False. + Settings().setValue('core/doubleclicking preview has added to service', False) service_item = self.build_service_item() if service_item: service_item.from_plugin = True diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index c6699cedd..c06506795 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1371,10 +1371,13 @@ class SlideController(DisplayController, RegistryProperties): Registry().execute('%s_stop' % self.service_item.name.lower(), [self.service_item, self.is_live]) if self.service_item.is_media(): self.on_media_close() - if Settings().value('core/auto unblank'): - self.on_go_live() - else: + self.on_go_live() + # If ('advanced/double click live') is not enabled, double clicking preview adds the item to Service. + # Prevent same item in preview from being sent to Service multiple times. Changing preview slide resets + # this setting. Do note that this still allows to add item to Service multiple times if icon is clicked. + elif not Settings().value('core/doubleclicking preview has added to service'): self.on_preview_add_to_service() + Settings().setValue('core/doubleclicking preview has added to service', True) def on_go_live(self, field=None): """ From 5dbb69430f23d62adc78ab410cdf2850101f83be Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Apr 2016 04:36:53 +0300 Subject: [PATCH 24/66] Fixed bug 1462420 (Double click on the preview duplicated the element in the service manger) - Added a hidden setting for controlling this behaviour. It is reset if any item is sent to preview from library. Sending the same item to service multiple times is still possible by using the "Add icon" --- openlp/core/ui/slidecontroller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index c06506795..10e6cf25b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1374,7 +1374,8 @@ class SlideController(DisplayController, RegistryProperties): self.on_go_live() # If ('advanced/double click live') is not enabled, double clicking preview adds the item to Service. # Prevent same item in preview from being sent to Service multiple times. Changing preview slide resets - # this setting. Do note that this still allows to add item to Service multiple times if icon is clicked. + # this setting. Sending to preview from Service does not reset this setting, this is a design choise. + # Do note that this still allows to add item to Service multiple times if icon is clicked. elif not Settings().value('core/doubleclicking preview has added to service'): self.on_preview_add_to_service() Settings().setValue('core/doubleclicking preview has added to service', True) From bf3cad050c8ddbc00bd6bcbbf0098c0621687c23 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Apr 2016 04:52:45 +0300 Subject: [PATCH 25/66] Turned the new setting into question. --- openlp/core/common/settings.py | 2 +- openlp/core/lib/mediamanageritem.py | 2 +- openlp/core/ui/slidecontroller.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index 7ba77719d..f886acc1e 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -162,7 +162,7 @@ class Settings(QtCore.QSettings): 'core/display on monitor': True, 'core/override position': False, 'core/application version': '0.0', - 'core/doubleclicking preview has added to service': False, + 'core/has doubleclicking preview added item to service': False, 'images/background color': '#000000', 'media/players': 'system,webkit', 'media/override player': QtCore.Qt.Unchecked, diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index c53583e06..feea001c3 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -483,7 +483,7 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): log.debug('%s Preview requested' % self.plugin.name) # If ('advanced/double click live') is not enabled, double clicking preview adds the item to Service. # This setting prevents it from being sent to Service multiple times, in here it is reset to False. - Settings().setValue('core/doubleclicking preview has added to service', False) + Settings().setValue('core/has doubleclicking preview added item to service', False) service_item = self.build_service_item() if service_item: service_item.from_plugin = True diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 10e6cf25b..bb017ac30 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1376,9 +1376,9 @@ class SlideController(DisplayController, RegistryProperties): # Prevent same item in preview from being sent to Service multiple times. Changing preview slide resets # this setting. Sending to preview from Service does not reset this setting, this is a design choise. # Do note that this still allows to add item to Service multiple times if icon is clicked. - elif not Settings().value('core/doubleclicking preview has added to service'): + elif not Settings().value('core/has doubleclicking preview added item to service'): self.on_preview_add_to_service() - Settings().setValue('core/doubleclicking preview has added to service', True) + Settings().setValue('core/has doubleclicking preview added item to service', True) def on_go_live(self, field=None): """ From 0563c6372fb7b75a2a5f2d71e6b0e59a9d15f570 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Apr 2016 06:43:25 +0300 Subject: [PATCH 26/66] Made a better fix for fixing bug where display is unblanked on editing current live item. This now sets a hidden setting to true while processing Live item and then changes it back to false. Display is thus not unblanked at all during the process. (Old fix showed the edited slide for a small time) Downside: All the new tests were based on the old method and thus they were removed. --- openlp/core/common/settings.py | 1 + openlp/core/ui/maindisplay.py | 2 +- openlp/core/ui/slidecontroller.py | 18 +--- .../openlp_core_ui/test_slidecontroller.py | 97 ------------------- 4 files changed, 6 insertions(+), 112 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index f886acc1e..d1a8ac96f 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -162,6 +162,7 @@ class Settings(QtCore.QSettings): 'core/display on monitor': True, 'core/override position': False, 'core/application version': '0.0', + 'core/is live item edited and replaced': False, 'core/has doubleclicking preview added item to service': False, 'images/background color': '#000000', 'media/players': 'system,webkit', diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index d9a9a6468..2c80dd2f8 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -471,7 +471,7 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): self.footer(service_item.foot_text) # if was hidden keep it hidden if self.hide_mode and self.is_live and not service_item.is_media(): - if Settings().value('core/auto unblank'): + if Settings().value('core/auto unblank') and not Settings().value('core/is live item edited and replaced'): Registry().execute('slidecontroller_live_unblank') else: self.hide_display(self.hide_mode) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index bb017ac30..ee2d4a24c 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -798,19 +798,9 @@ class SlideController(DisplayController, RegistryProperties): :param item: The current service item """ if item == self.service_item: - if not self.hide_mode(): + Settings().setValue('core/is live item edited and replaced', True) self._process_item(item, self.preview_widget.current_slide_number()) - # "isChecked" method is required for checking blanks, on_xx_display(False) does not work. - elif self.hide_mode(): - if self.blank_screen.isChecked(): - self._process_item(item, self.preview_widget.current_slide_number()) - self.on_blank_display(True) - elif self.theme_screen.isChecked(): - self._process_item(item, self.preview_widget.current_slide_number()) - self.on_theme_display(True) - elif self.desktop_screen.isChecked(): - self._process_item(item, self.preview_widget.current_slide_number()) - self.on_hide_display(True) + Settings().setValue('core/is live item edited and replaced', False) def add_service_manager_item(self, item, slide_no): """ @@ -1113,7 +1103,7 @@ class SlideController(DisplayController, RegistryProperties): # With this display stays blanked when "auto unblank" setting is not enabled and new item is sent to Live. if not Settings().value('core/auto unblank') and start: () - else: + if not start and not Settings().value('core/is live item edited and replaced'): Registry().execute('slidecontroller_live_unblank') row = self.preview_widget.current_slide_number() old_selected_row = self.selected_row @@ -1364,7 +1354,7 @@ class SlideController(DisplayController, RegistryProperties): Triggered when a preview slide item is doubleclicked """ if self.service_item: - if Settings().value('advanced/double click live'): + if Settings().value('advanced/double click live') and Settings().value('core/auto unblank'): # Live and Preview have issues if we have video or presentations # playing in both at the same time. if self.service_item.is_command(): diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 487ea205e..20e48cbe0 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -538,103 +538,6 @@ class TestSlideController(TestCase): mocked_preview_widget.current_slide_number.assert_called_with() mocked_process_item.assert_called_once_with(mocked_item, 7) - def replace_service_manager_item_on_blank_display_test(self): - """ - Test that when the service item is replaced, display remains blanked if it was blanked. - """ - # GIVEN: A slide controller and a new item to add, blanked display. - mocked_item = MagicMock() - mocked_preview_widget = MagicMock() - mocked_preview_widget.current_slide_number = MagicMock() - mocked_process_item = MagicMock() - slide_controller = SlideController(None) - slide_controller.preview_widget = mocked_preview_widget - slide_controller._process_item = mocked_process_item - slide_controller.service_item = mocked_item - slide_controller.hide_menu = MagicMock() - slide_controller.hide_mode = MagicMock() - slide_controller.hide_mode.return_value = True - slide_controller.blank_screen = MagicMock() - slide_controller.blank_screen.isChecked = MagicMock() - slide_controller.blank_screen.isChecked.return_value = True - slide_controller.on_blank_display = mocked_item - slide_controller.theme_screen = MagicMock() - slide_controller.desktop_screen = MagicMock() - slide_controller.log_debug = MagicMock() - - # WHEN: The service item is replaced - slide_controller.replace_service_manager_item(mocked_item) - - # THEN: The display should remain blanked - slide_controller.on_blank_display.assert_called_once_with(True) - - def replace_service_manager_item_on_theme_display_test(self): - """ - Test that when the service item is replaced, display remains blanked if it was blanked. - """ - # GIVEN: A slide controller and a new item to add, blanked display. - mocked_item = MagicMock() - mocked_preview_widget = MagicMock() - mocked_preview_widget.current_slide_number = MagicMock() - mocked_process_item = MagicMock() - slide_controller = SlideController(None) - slide_controller.preview_widget = mocked_preview_widget - slide_controller._process_item = mocked_process_item - slide_controller.service_item = mocked_item - slide_controller.hide_menu = MagicMock() - slide_controller.hide_mode = MagicMock() - slide_controller.hide_mode.return_value = True - slide_controller.blank_screen = MagicMock() - slide_controller.blank_screen.isChecked = MagicMock() - slide_controller.blank_screen.isChecked.return_value = False - slide_controller.theme_screen = MagicMock() - slide_controller.theme_screen.isChecked = MagicMock() - slide_controller.theme_screen.isChecked.return_value = True - slide_controller.on_theme_display = mocked_item - slide_controller.desktop_screen = MagicMock() - slide_controller.log_debug = MagicMock() - - # WHEN: The service item is replaced - slide_controller.replace_service_manager_item(mocked_item) - - # THEN: The display should remain blanked - slide_controller.on_theme_display.assert_called_once_with(True) - - def replace_service_manager_item_on_hide_display_test(self): - """ - Test that when the service item is replaced, display remains blanked if it was blanked. - """ - # GIVEN: A slide controller and a new item to add, blanked display. - mocked_item = MagicMock() - mocked_preview_widget = MagicMock() - mocked_preview_widget.current_slide_number = MagicMock() - mocked_process_item = MagicMock() - slide_controller = SlideController(None) - slide_controller.preview_widget = mocked_preview_widget - slide_controller._process_item = mocked_process_item - slide_controller.service_item = mocked_item - slide_controller.hide_menu = MagicMock() - slide_controller.hide_mode = MagicMock() - slide_controller.hide_mode.return_value = True - slide_controller.blank_screen = MagicMock() - slide_controller.blank_screen.isChecked = MagicMock() - slide_controller.blank_screen.isChecked.return_value = False - slide_controller.theme_screen = MagicMock() - slide_controller.theme_screen.isChecked = MagicMock() - slide_controller.theme_screen.isChecked.return_value = False - slide_controller.on_theme_display = mocked_item - slide_controller.desktop_screen = MagicMock() - slide_controller.desktop_screen.isChecked = MagicMock() - slide_controller.desktop_screen.isChecked.return_value = True - slide_controller.on_hide_display = MagicMock() - slide_controller.log_debug = MagicMock() - - # WHEN: The service item is replaced - slide_controller.replace_service_manager_item(mocked_item) - - # THEN: The display should remain blanked - slide_controller.on_hide_display.assert_called_once_with(True) - def on_slide_blank_test(self): """ Test on_slide_blank From c046ba95d9ea3f41459a00aae5fb7615aa6d5583 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Apr 2016 06:50:54 +0300 Subject: [PATCH 27/66] Made a better fix for fixing bug where display is unblanked on editing current live item. This now sets a hidden setting to true while processing Live item and then changes it back to false. Display is thus not unblanked at all during the process. (Old fix showed the edited slide for a small time) Downside: All the new tests were based on the old method and thus they were removed. --- openlp/core/ui/slidecontroller.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index ee2d4a24c..efafadcf7 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -790,10 +790,8 @@ class SlideController(DisplayController, RegistryProperties): """ Replacement item following a remote edit This action also takes place when a song that is sent to live from Service Manager is edited. - If display is blanked, this will update the song and then re-blank the display. - As result, lyrics are flashed on screen for a very short time before re-blanking happens. (Bug) - This happens only when Automatic unblanking is enabled when new item is sen to Live, - if it's not enabled they won't flash. + If display is blanked, it will get unblanked if automatic unblanking is enabled. We prevent this from happening + by setting a hidden setting to "True" and then to "False" after the processing is done. :param item: The current service item """ From 518dde5d2daeca1ee3c67564adb2db9f1502f9f1 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Apr 2016 15:40:34 +0300 Subject: [PATCH 28/66] - Removed _ from end of one setting name. - Fixed ident on replace_service_manager --- openlp/core/ui/generaltab.py | 2 +- openlp/core/ui/slidecontroller.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index da60f8311..2ecaeaae6 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -174,7 +174,7 @@ class GeneralTab(SettingsTab): self.auto_unblank_check_box.setObjectName('auto_unblank_check_box') self.settings_layout.addRow(self.auto_unblank_check_box) self.click_live_slide_to_unblank_check_box = QtWidgets.QCheckBox(self.settings_group_box) - self.click_live_slide_to_unblank_check_box.setObjectName('click_live_slide_to_unblank_') + self.click_live_slide_to_unblank_check_box.setObjectName('click_live_slide_to_unblank') self.settings_layout.addRow(self.click_live_slide_to_unblank_check_box) self.auto_preview_check_box = QtWidgets.QCheckBox(self.settings_group_box) self.auto_preview_check_box.setObjectName('auto_preview_check_box') diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index efafadcf7..04fef6b48 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -796,9 +796,9 @@ class SlideController(DisplayController, RegistryProperties): :param item: The current service item """ if item == self.service_item: - Settings().setValue('core/is live item edited and replaced', True) - self._process_item(item, self.preview_widget.current_slide_number()) - Settings().setValue('core/is live item edited and replaced', False) + Settings().setValue('core/is live item edited and replaced', True) + self._process_item(item, self.preview_widget.current_slide_number()) + Settings().setValue('core/is live item edited and replaced', False) def add_service_manager_item(self, item, slide_no): """ From 55061b8fc17080906af5d0a5bb1cb0e1a5e7fadc Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Wed, 20 Apr 2016 18:56:10 +0300 Subject: [PATCH 29/66] - Added two tests for checking if doubleclicking preview should add item to service or send it to live. --- openlp/core/ui/slidecontroller.py | 3 +- .../openlp_core_ui/test_slidecontroller.py | 57 ++++++++++++++----- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 04fef6b48..4d11381b1 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1095,7 +1095,8 @@ class SlideController(DisplayController, RegistryProperties): self.log_debug('Could not get lock in slide_selected after waiting %f, skip to avoid deadlock.' % timeout) return - # If "click live slide to unblank" is enabled, unblank the display. + # If "click live slide to unblank" is enabled, unblank the display. And start = Item is sent to Live. + # 'core/is live item edited and replaced' is only True when replacing Live item with the same item from Service. # Note: If this if statement is placed at the bottom of this function instead of top slide transitions are lost. if self.is_live and Settings().value('core/click live slide to unblank'): # With this display stays blanked when "auto unblank" setting is not enabled and new item is sent to Live. diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 20e48cbe0..41b3317bf 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -713,6 +713,48 @@ class TestSlideController(TestCase): slide_controller.theme_screen, slide_controller.blank_screen ]) + @patch('openlp.core.ui.slidecontroller.Settings') + def on_preview_double_click_unblank_display_test(self, MockedSettings): + # GIVEN: A slide controller, actions needed, settins set to True. + slide_controller = SlideController(None) + mocked_settings = MagicMock() + mocked_settings.value.return_value = True + MockedSettings.return_value = mocked_settings + slide_controller.service_item = MagicMock() + slide_controller.service_item.is_media = MagicMock() + slide_controller.on_media_close = MagicMock() + slide_controller.on_go_live = MagicMock() + slide_controller.on_preview_add_to_service = MagicMock() + slide_controller.media_reset = MagicMock() + + # WHEN: on_preview_double_click is called + slide_controller.on_preview_double_click() + + # THEN: The call to addActions should be correct + self.assertEqual(1, slide_controller.on_go_live.call_count, 'on_go_live should have been called once.') + self.assertEqual(0, slide_controller.on_preview_add_to_service.call_count, 'Should have not been called.') + + @patch('openlp.core.ui.slidecontroller.Settings') + def on_preview_double_click_add_to_service_test(self, MockedSettings): + # GIVEN: A slide controller, actions needed, settins set to False. + slide_controller = SlideController(None) + mocked_settings = MagicMock() + mocked_settings.value.return_value = False + MockedSettings.return_value = mocked_settings + slide_controller.service_item = MagicMock() + slide_controller.service_item.is_media = MagicMock() + slide_controller.on_media_close = MagicMock() + slide_controller.on_go_live = MagicMock() + slide_controller.on_preview_add_to_service = MagicMock() + slide_controller.media_reset = MagicMock() + + # WHEN: on_preview_double_click is called + slide_controller.on_preview_double_click() + + # THEN: The call to addActions should be correct + self.assertEqual(0, slide_controller.on_go_live.call_count, 'on_go_live Should have not been called.') + self.assertEqual(1, slide_controller.on_preview_add_to_service.call_count, 'Should have been called once.') + class TestInfoLabel(TestCase): @@ -805,18 +847,3 @@ class TestLiveController(TestCase): # WHEN: the default controller is built. # THEN: The controller should not be a live controller. self.assertEqual(live_controller.is_live, True, 'The slide controller should be a live controller') - - -class TestPreviewLiveController(TestCase): - - def initial_preview_controller_test(self): - """ - Test the initial preview slide controller state. - """ - # GIVEN: A new SlideController instance. - Registry.create() - preview_controller = PreviewController(None) - - # WHEN: the default controller is built. - # THEN: The controller should not be a live controller. - self.assertEqual(preview_controller.is_live, False, 'The slide controller should be a Preview controller') From c1d9991acb5b328deac8ca8d802286b736a9e426 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Wed, 20 Apr 2016 19:01:58 +0300 Subject: [PATCH 30/66] Noticed I had removed one test from end of the file, added it back. --- .../openlp_core_ui/test_slidecontroller.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 41b3317bf..12952acb7 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -847,3 +847,18 @@ class TestLiveController(TestCase): # WHEN: the default controller is built. # THEN: The controller should not be a live controller. self.assertEqual(live_controller.is_live, True, 'The slide controller should be a live controller') + + +class TestPreviewLiveController(TestCase): + + def initial_preview_controller_test(self): + """ + Test the initial preview slide controller state. + """ + # GIVEN: A new SlideController instance. + Registry.create() + preview_controller = PreviewController(None) + + # WHEN: the default controller is built. + # THEN: The controller should not be a live controller. + self.assertEqual(preview_controller.is_live, False, 'The slide controller should be a Preview controller') From 31ede5556d986c04ade310808082517b28b33d5b Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Wed, 27 Apr 2016 23:38:46 +0300 Subject: [PATCH 31/66] Added this to program startup code, should replace_service_manager_item ever crash the program. Settings().setValue('core/is live item edited and replaced', False) --- openlp/core/ui/mainwindow.py | 3 +++ openlp/core/ui/slidecontroller.py | 1 + 2 files changed, 4 insertions(+) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 228969ad1..1640cd202 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -652,6 +652,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): """ Give all the plugins a chance to perform some tasks at startup """ + # This setting is set to false, in case def replace_service_manager_item in slidecontroller would crash the + # program and make blank to modes unavailable. + Settings().setValue('core/is live item edited and replaced', False) self.application.process_events() for plugin in self.plugin_manager.plugins: if plugin.is_active(): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 4d11381b1..67cece409 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -792,6 +792,7 @@ class SlideController(DisplayController, RegistryProperties): This action also takes place when a song that is sent to live from Service Manager is edited. If display is blanked, it will get unblanked if automatic unblanking is enabled. We prevent this from happening by setting a hidden setting to "True" and then to "False" after the processing is done. + The setting is also set to "False" on every start up, should the program ever crash during this process. :param item: The current service item """ From e4bce11a0305b283ab5a1bb879ee49ad1e4ceb52 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 10 May 2016 03:53:14 +0300 Subject: [PATCH 32/66] Commiting for merging trunk, some new changes. --- openlp/core/common/uistrings.py | 1 + openlp/core/ui/exceptiondialog.py | 7 ++++--- openlp/plugins/bibles/lib/mediaitem.py | 6 +++--- openlp/plugins/images/imageplugin.py | 2 +- openlp/plugins/images/lib/mediaitem.py | 6 +++--- openlp/plugins/media/lib/mediatab.py | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index f5d0514cb..15cb67f27 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -52,6 +52,7 @@ class UiStrings(object): self.About = translate('OpenLP.Ui', 'About') self.Add = translate('OpenLP.Ui', '&Add') self.AddGroup = translate('OpenLP.Ui', 'Add group') + self.AddGroupDot = translate('OpenLP.Ui', 'Add group.') self.Advanced = translate('OpenLP.Ui', 'Advanced') self.AllFiles = translate('OpenLP.Ui', 'All Files') self.Automatic = translate('OpenLP.Ui', 'Automatic') diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 9a2e3acbd..1782374ce 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -91,8 +91,8 @@ class Ui_ExceptionDialog(object): Translate the widgets on the fly. """ # Note that bugs_mail is not clicable, but it adds the blue color and underlining and makes the test copyable. - bugs_mail = ' bugs@openlp.org' exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) + # Explanation text,   adds a small space before: If possible, write in English. self.description_explanation.setText( translate('OpenLP.ExceptionDialog', 'Please describe what you were trying to do. ' ' If possible, write in English.')) @@ -100,11 +100,12 @@ class Ui_ExceptionDialog(object): translate('OpenLP.ExceptionDialog', 'Oops, OpenLP hit a problem ' 'and couldn\'t recover!

' 'You can help OpenLP developers to fix this by
' - 'sending them a bug report to %s

' + 'sending them a bug report to {email}

' 'No email app? You can save this ' 'information to a file and
' 'send it from your mail on browser via an attachement.

' - 'Thank you for being part of making OpenLP better!
') % bugs_mail) + 'Thank you for being part of making OpenLP better!
' + ).format(email=' bugs@openlp.org')) self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail')) self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File')) self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File')) diff --git a/openlp/plugins/bibles/lib/mediaitem.py b/openlp/plugins/bibles/lib/mediaitem.py index 1d7b5a897..fb971fa00 100644 --- a/openlp/plugins/bibles/lib/mediaitem.py +++ b/openlp/plugins/bibles/lib/mediaitem.py @@ -186,7 +186,7 @@ class BibleMediaItem(MediaManagerItem): self.search_tab_bar.setObjectName('search_tab_bar') self.page_layout.addWidget(self.search_tab_bar) # Add the Quick Search tab. - self.add_search_tab('quick', translate('BiblesPlugin.MediaItem', 'Quick')) + self.add_search_tab('quick', translate('BiblesPlugin.MediaItem', 'Search')) self.quick_search_label = QtWidgets.QLabel(self.quickTab) self.quick_search_label.setObjectName('quick_search_label') self.quickLayout.addWidget(self.quick_search_label, 0, 0, QtCore.Qt.AlignRight) @@ -195,10 +195,10 @@ class BibleMediaItem(MediaManagerItem): self.quick_search_edit.setObjectName('quick_search_edit') self.quick_search_label.setBuddy(self.quick_search_edit) self.quickLayout.addWidget(self.quick_search_edit, 0, 1, 1, 2) - self.add_search_fields('quick', translate('BiblesPlugin.MediaItem', 'Quick')) + self.add_search_fields('quick', translate('BiblesPlugin.MediaItem', 'Search')) self.quickTab.setVisible(True) # Add the Advanced Search tab. - self.add_search_tab('advanced', translate('BiblesPlugin.MediaItem', 'Advanced')) + self.add_search_tab('advanced', translate('BiblesPlugin.MediaItem', 'Select')) self.advanced_book_label = QtWidgets.QLabel(self.advancedTab) self.advanced_book_label.setObjectName('advanced_book_label') self.advancedLayout.addWidget(self.advanced_book_label, 0, 0, QtCore.Qt.AlignRight) diff --git a/openlp/plugins/images/imageplugin.py b/openlp/plugins/images/imageplugin.py index 26cba5a20..bf4c04e40 100644 --- a/openlp/plugins/images/imageplugin.py +++ b/openlp/plugins/images/imageplugin.py @@ -88,7 +88,7 @@ class ImagePlugin(Plugin): self.text_strings[StringContent.VisibleName] = {'title': translate('ImagePlugin', 'Images', 'container title')} # Middle Header Bar tooltips = { - 'load': translate('ImagePlugin', 'Load a new image.'), + 'load': translate('ImagePlugin', 'Add new image(s).'), 'import': '', 'new': translate('ImagePlugin', 'Add a new image.'), 'edit': translate('ImagePlugin', 'Edit the selected image.'), diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index f35fd48c7..ce7f1c566 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -74,8 +74,8 @@ class ImageMediaItem(MediaManagerItem): self.on_new_prompt = translate('ImagePlugin.MediaItem', 'Select Image(s)') file_formats = get_images_filter() self.on_new_file_masks = '%s;;%s (*)' % (file_formats, UiStrings().AllFiles) - self.add_group_action.setText(UiStrings().AddGroup) - self.add_group_action.setToolTip(UiStrings().AddGroup) + self.add_group_action.setText(UiStrings().AddGroupDot) + self.add_group_action.setToolTip(UiStrings().AddGroupDot) self.replace_action.setText(UiStrings().ReplaceBG) self.replace_action.setToolTip(UiStrings().ReplaceLiveBG) self.reset_action.setText(UiStrings().ResetBG) @@ -179,7 +179,7 @@ class ImageMediaItem(MediaManagerItem): text=UiStrings().AddGroup, icon=':/images/image_new_group.png', triggers=self.on_add_group_click) create_widget_action( self.list_view, - text=self.plugin.get_string(StringContent.Load)['tooltip'], + text=translate('ImagePlugin', 'Add new image(s)'), icon=':/general/general_open.png', triggers=self.on_file_click) def add_start_header_bar(self): diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 5b8fb7c2f..5944d39cf 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -54,7 +54,7 @@ class MediaTab(SettingsTab): def retranslateUi(self): self.advanced_group_box.setTitle(UiStrings().Advanced) self.override_player_check_box.setText(translate('MediaPlugin.MediaTab', 'Allow media player to be overridden')) - self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start Live items automatically')) + self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start videos Live items automatically')) def load(self): self.override_player_check_box.setChecked(Settings().value(self.settings_section + '/override player')) From d7f3e4a9f280e3b53b0de0a0f54ef09d76c71873 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 10 May 2016 04:11:49 +0300 Subject: [PATCH 33/66] Lowercapped some settings. --- openlp/core/ui/generaltab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 0b2e1df08..884e95900 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -246,7 +246,7 @@ class GeneralTab(SettingsTab): self.display_on_monitor_check.setText(translate('OpenLP.GeneralTab', 'Display if a single screen')) self.startup_group_box.setTitle(translate('OpenLP.GeneralTab', 'Application Startup')) self.warning_check_box.setText(translate('OpenLP.GeneralTab', 'Show blank screen warning')) - self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the last Service')) + self.auto_open_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically open the previous service file')) self.show_splash_check_box.setText(translate('OpenLP.GeneralTab', 'Show the splash screen')) self.logo_group_box.setTitle(translate('OpenLP.GeneralTab', 'Logo')) self.logo_color_label.setText(UiStrings().BackgroundColorColon) From 77e9e1ad27dbc3d486b06de56f4229d07f2844cb Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 10 May 2016 04:55:26 +0300 Subject: [PATCH 34/66] Lowercapped bunch of stuff, splitted expection error --- openlp/core/ui/advancedtab.py | 8 ++++---- openlp/core/ui/exceptiondialog.py | 16 +++++++++------- openlp/core/ui/exceptionform.py | 3 ++- openlp/core/ui/generaltab.py | 4 ++-- openlp/core/ui/mainwindow.py | 2 +- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 8c7fbdce1..b12b60d4f 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -294,7 +294,7 @@ class AdvancedTab(SettingsTab): self.enable_auto_close_check_box.setText(translate('OpenLP.AdvancedTab', 'Enable application exit confirmation')) self.service_name_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Default Service Name')) - self.service_name_check_box.setText(translate('OpenLP.AdvancedTab', 'Enable default Service name')) + self.service_name_check_box.setText(translate('OpenLP.AdvancedTab', 'Enable default service name')) self.service_name_time_label.setText(translate('OpenLP.AdvancedTab', 'Date and Time:')) self.service_name_day.setItemText(0, translate('OpenLP.AdvancedTab', 'Monday')) self.service_name_day.setItemText(1, translate('OpenLP.AdvancedTab', 'Tuesday')) @@ -304,11 +304,11 @@ class AdvancedTab(SettingsTab): self.service_name_day.setItemText(5, translate('OpenLP.AdvancedTab', 'Saturday')) self.service_name_day.setItemText(6, translate('OpenLP.AdvancedTab', 'Sunday')) self.service_name_day.setItemText(7, translate('OpenLP.AdvancedTab', 'Now')) - self.service_name_time.setToolTip(translate('OpenLP.AdvancedTab', 'Time when usual Service starts.')) + self.service_name_time.setToolTip(translate('OpenLP.AdvancedTab', 'Time when usual service starts.')) self.service_name_label.setText(translate('OpenLP.AdvancedTab', 'Name:')) self.service_name_edit.setToolTip(translate('OpenLP.AdvancedTab', 'Consult the OpenLP manual for usage.')) self.service_name_revert_button.setToolTip( - translate('OpenLP.AdvancedTab', 'Revert to the default Service name "%s".') % + translate('OpenLP.AdvancedTab', 'Revert to the default service name "%s".') % UiStrings().DefaultServiceName) self.service_name_example_label.setText(translate('OpenLP.AdvancedTab', 'Example:')) self.hide_mouse_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor')) @@ -336,7 +336,7 @@ class AdvancedTab(SettingsTab): self.slide_label.setText(translate('OpenLP.GeneralTab', 'Behavior of next/previous on the last/first slide:')) self.end_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Remain on Slide')) self.wrap_slide_radio_button.setText(translate('OpenLP.GeneralTab', '&Wrap around')) - self.next_item_radio_button.setText(translate('OpenLP.GeneralTab', '&Move to next/previous Service item')) + self.next_item_radio_button.setText(translate('OpenLP.GeneralTab', '&Move to next/previous service item')) self.search_as_type_check_box.setText(translate('SongsPlugin.GeneralTab', 'Enable search as you type')) def load(self): diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 1782374ce..5a4523ade 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -90,22 +90,24 @@ class Ui_ExceptionDialog(object): """ Translate the widgets on the fly. """ - # Note that bugs_mail is not clicable, but it adds the blue color and underlining and makes the test copyable. - exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) + # Note that bugs mail is not clicable, but it adds the blue color and underlining and makes the test copyable. + #exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) # Explanation text,   adds a small space before: If possible, write in English. self.description_explanation.setText( translate('OpenLP.ExceptionDialog', 'Please describe what you were trying to do. ' ' If possible, write in English.')) + expection_part1 = (translate('OpenLP.ExceptionDialog', + 'Oops, OpenLP hit a problem and couldn\'t recover!

You can ' + 'help OpenLP developers to fix this by
sending them a ' + 'bug report to {email}

' + ).format(email=' bugs@openlp.org')) self.message_label.setText( - translate('OpenLP.ExceptionDialog', 'Oops, OpenLP hit a problem ' - 'and couldn\'t recover!

' - 'You can help OpenLP developers to fix this by
' - 'sending them a bug report to {email}

' + translate('OpenLP.ExceptionDialog', '{first_part}' 'No email app? You can save this ' 'information to a file and
' 'send it from your mail on browser via an attachement.

' 'Thank you for being part of making OpenLP better!
' - ).format(email=' bugs@openlp.org')) + ).format(first_part = expection_part1)) self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail')) self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File')) self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File')) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 6430423cf..7df0d695f 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -199,7 +199,8 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): else: self.__button_state(False) self.description_word_count.setText( - translate('OpenLP.ExceptionDialog', '%s Characters from the minimum description remaining.') % count) + translate('OpenLP.ExceptionDialog', '{count} characters from the minimum description remaining.' + ).format(count = count)) def on_attach_file_button_clicked(self): """ diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 884e95900..5173f315b 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -257,10 +257,10 @@ class GeneralTab(SettingsTab): self.check_for_updates_check_box.setText(translate('OpenLP.GeneralTab', 'Check for updates to OpenLP')) 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')) + 'Prompt to save before starting a new service')) self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new Live item')) self.auto_preview_check_box.setText(translate('OpenLP.GeneralTab', - 'Automatically preview next item in Service')) + 'Automatically preview the next item in service')) self.timeout_label.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:')) self.timeout_spin_box.setSuffix(translate('OpenLP.GeneralTab', ' sec')) self.ccli_group_box.setTitle(translate('OpenLP.GeneralTab', 'CCLI Details')) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 57c67c66e..db1636518 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -442,7 +442,7 @@ class Ui_MainWindow(object): self.view_media_manager_item.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the Library.')) self.view_theme_manager_item.setText(translate('OpenLP.MainWindow', '&Themes')) - self.view_theme_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Hide or show Themes')) + self.view_theme_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Hide or show themes')) self.view_theme_manager_item.setStatusTip(translate('OpenLP.MainWindow', 'Toggle the visibility of the Themes.')) self.view_service_manager_item.setText(translate('OpenLP.MainWindow', '&Service')) From 46e7ad4983363394faba181c62cbf511b0ca6458 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 10 May 2016 14:06:00 +0300 Subject: [PATCH 35/66] - Changes based on comments by TRB143 --- openlp/core/common/uistrings.py | 4 ++-- openlp/core/ui/exceptiondialog.py | 13 +++++++------ openlp/core/ui/slidecontroller.py | 2 +- openlp/core/ui/themewizard.py | 10 +++++----- openlp/plugins/alerts/lib/alertstab.py | 4 ++-- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index 15cb67f27..fa01a44d2 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -82,7 +82,7 @@ class UiStrings(object): self.File = translate('OpenLP.Ui', 'File') self.FileNotFound = translate('OpenLP.Ui', 'File Not Found') self.FileNotFoundMessage = translate('OpenLP.Ui', 'File %s not found.\nPlease try selecting it individually.') - self.FontSizePtUnit = translate('OpenLP.Ui', ' pt', 'Abbreviated font pointsize unit') + self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font pointsize unit') self.Help = translate('OpenLP.Ui', 'Help') self.Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours') self.IFdSs = translate('OpenLP.Ui', 'Invalid Folder Selected', 'Singular') @@ -128,7 +128,7 @@ class UiStrings(object): 'player is disabled.') self.ResetBG = translate('OpenLP.Ui', 'Reset Background') self.ResetLiveBG = translate('OpenLP.Ui', 'Reset live background.') - self.Seconds = translate('OpenLP.Ui', ' s', 'The abbreviated unit for seconds') + self.Seconds = translate('OpenLP.Ui', 's', 'The abbreviated unit for seconds') self.SaveAndPreview = translate('OpenLP.Ui', 'Save && Preview') self.Search = translate('OpenLP.Ui', 'Search') self.SearchThemes = translate('OpenLP.Ui', 'Search Themes...', 'Search bar place holder text ') diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 5a4523ade..64cbdefa8 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -96,18 +96,19 @@ class Ui_ExceptionDialog(object): self.description_explanation.setText( translate('OpenLP.ExceptionDialog', 'Please describe what you were trying to do. ' ' If possible, write in English.')) - expection_part1 = (translate('OpenLP.ExceptionDialog', - 'Oops, OpenLP hit a problem and couldn\'t recover!

You can ' - 'help OpenLP developers to fix this by
sending them a ' - 'bug report to {email}

' - ).format(email=' bugs@openlp.org')) + exception_part1 = (translate('OpenLP.ExceptionDialog', + 'Oops, OpenLP hit a problem and couldn\'t recover!

' + 'You can help the OpenLP developers to fix this' + ' by
sending them a bug report to {email}{newlines}' + ).format(email=' bugs@openlp.org', + newlines='

')) self.message_label.setText( translate('OpenLP.ExceptionDialog', '{first_part}' 'No email app? You can save this ' 'information to a file and
' 'send it from your mail on browser via an attachement.

' 'Thank you for being part of making OpenLP better!
' - ).format(first_part = expection_part1)) + ).format(first_part = exception_part1)) self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail')) self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File')) self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File')) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index ea2abe5fb..228873d9b 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -290,7 +290,7 @@ class SlideController(DisplayController, RegistryProperties): self.delay_spin_box = QtWidgets.QSpinBox() self.delay_spin_box.setObjectName('delay_spin_box') self.delay_spin_box.setRange(1, 180) - self.delay_spin_box.setSuffix(UiStrings().Seconds) + self.delay_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().Seconds)) self.delay_spin_box.setToolTip(translate('OpenLP.SlideController', 'Delay between slides in seconds.')) self.receive_spin_delay() self.toolbar.add_toolbar_widget(self.delay_spin_box) diff --git a/openlp/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index ab8854ef2..51a7a6a5b 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -419,15 +419,15 @@ class Ui_ThemeWizard(object): self.main_font_label.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.main_color_label.setText(translate('OpenLP.ThemeWizard', 'color:')) self.main_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.main_size_spin_box.setSuffix(UiStrings().FontSizePtUnit) + self.main_size_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().FontSizePtUnit)) self.line_spacing_label.setText(translate('OpenLP.ThemeWizard', 'Line Spacing:')) - self.line_spacing_spin_box.setSuffix(UiStrings().FontSizePtUnit) + self.line_spacing_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().FontSizePtUnit)) self.outline_check_box.setText(translate('OpenLP.ThemeWizard', '&Outline:')) self.outline_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.outline_size_spin_box.setSuffix(UiStrings().FontSizePtUnit) + self.outline_size_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().FontSizePtUnit)) self.shadow_check_box.setText(translate('OpenLP.ThemeWizard', '&Shadow:')) self.shadow_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.shadow_size_spin_box.setSuffix(UiStrings().FontSizePtUnit) + self.shadow_size_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().FontSizePtUnit)) self.main_bold_check_box.setText(translate('OpenLP.ThemeWizard', 'Bold')) self.main_italics_check_box.setText(translate('OpenLP.ThemeWizard', 'Italic')) self.footer_area_page.setTitle(translate('OpenLP.ThemeWizard', 'Footer Area Font Details')) @@ -436,7 +436,7 @@ class Ui_ThemeWizard(object): self.footer_font_label.setText(translate('OpenLP.ThemeWizard', 'Font:')) self.footer_color_label.setText(translate('OpenLP.ThemeWizard', 'color:')) self.footer_size_label.setText(translate('OpenLP.ThemeWizard', 'Size:')) - self.footer_size_spin_box.setSuffix(UiStrings().FontSizePtUnit) + self.footer_size_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().FontSizePtUnit)) self.alignment_page.setTitle(translate('OpenLP.ThemeWizard', 'Text Formatting Details')) self.alignment_page.setSubTitle(translate('OpenLP.ThemeWizard', 'Allows additional display ' 'formatting information to be defined')) diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index e1698dbc4..bc6ae6426 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -101,9 +101,9 @@ class AlertsTab(SettingsTab): self.font_color_label.setText(translate('AlertsPlugin.AlertsTab', 'Font color:')) self.background_color_label.setText(UiStrings().BackgroundColorColon) self.font_size_label.setText(translate('AlertsPlugin.AlertsTab', 'Font size:')) - self.font_size_spin_box.setSuffix(UiStrings().FontSizePtUnit) + self.font_size_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().FontSizePtUnit)) self.timeout_label.setText(translate('AlertsPlugin.AlertsTab', 'Alert timeout:')) - self.timeout_spin_box.setSuffix(UiStrings().Seconds) + self.timeout_spin_box.setSuffix(' {unit}'.format(unit=UiStrings().Seconds)) self.preview_group_box.setTitle(UiStrings().Preview) self.font_preview.setText(UiStrings().OLPV2x) From 524adae71f1d9f0814944f339133b328e8afe8c9 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Tue, 10 May 2016 14:13:41 +0300 Subject: [PATCH 36/66] - Pep8 fixes --- openlp/core/ui/exceptiondialog.py | 4 ++-- openlp/core/ui/exceptionform.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/exceptiondialog.py b/openlp/core/ui/exceptiondialog.py index 64cbdefa8..443c22bd8 100644 --- a/openlp/core/ui/exceptiondialog.py +++ b/openlp/core/ui/exceptiondialog.py @@ -91,7 +91,7 @@ class Ui_ExceptionDialog(object): Translate the widgets on the fly. """ # Note that bugs mail is not clicable, but it adds the blue color and underlining and makes the test copyable. - #exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) + exception_dialog.setWindowTitle(translate('OpenLP.ExceptionDialog', 'Error Occurred')) # Explanation text,   adds a small space before: If possible, write in English. self.description_explanation.setText( translate('OpenLP.ExceptionDialog', 'Please describe what you were trying to do. ' @@ -108,7 +108,7 @@ class Ui_ExceptionDialog(object): 'information to a file and
' 'send it from your mail on browser via an attachement.

' 'Thank you for being part of making OpenLP better!
' - ).format(first_part = exception_part1)) + ).format(first_part=exception_part1)) self.send_report_button.setText(translate('OpenLP.ExceptionDialog', 'Send E-Mail')) self.save_report_button.setText(translate('OpenLP.ExceptionDialog', 'Save to File')) self.attach_tile_button.setText(translate('OpenLP.ExceptionDialog', 'Attach File')) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 7df0d695f..9213cf072 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -200,7 +200,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): self.__button_state(False) self.description_word_count.setText( translate('OpenLP.ExceptionDialog', '{count} characters from the minimum description remaining.' - ).format(count = count)) + ).format(count=count)) def on_attach_file_button_clicked(self): """ From 598d715de6821efed36b836059ddf189331bb560 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Fri, 3 Jun 2016 17:15:19 -0700 Subject: [PATCH 37/66] Initial string conversions for variable templates --- openlp/core/common/uistrings.py | 9 +- openlp/core/lib/__init__.py | 3 +- openlp/core/lib/filedialog.py | 4 +- openlp/core/lib/htmlbuilder.py | 152 +++++++++--------- openlp/core/lib/renderer.py | 17 +- openlp/core/lib/theme.py | 4 +- openlp/core/ui/exceptionform.py | 30 ++-- openlp/core/ui/firsttimeform.py | 16 +- openlp/core/ui/mainwindow.py | 2 +- openlp/core/ui/pluginform.py | 24 +-- openlp/core/ui/themeform.py | 6 +- openlp/core/ui/thememanager.py | 2 +- .../openlp_core_lib/test_file_dialog.py | 2 +- 13 files changed, 142 insertions(+), 129 deletions(-) diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index 91db10fcf..91d947ade 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -80,8 +80,9 @@ class UiStrings(object): self.Export = translate('OpenLP.Ui', 'Export') self.File = translate('OpenLP.Ui', 'File') self.FileNotFound = translate('OpenLP.Ui', 'File Not Found') - # TODO: Check before converting to python3 string - self.FileNotFoundMessage = translate('OpenLP.Ui', 'File %s not found.\nPlease try selecting it individually.') + # TODO: Passed nose - verify in real life example + self.FileNotFoundMessage = translate('OpenLP.Ui', + 'File {name} not found.\nPlease try selecting it individually.') self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font pointsize unit') self.Help = translate('OpenLP.Ui', 'Help') self.Hours = translate('OpenLP.Ui', 'h', 'The abbreviated unit for hours') @@ -140,8 +141,8 @@ class UiStrings(object): self.Split = translate('OpenLP.Ui', 'Optional &Split') self.SplitToolTip = translate('OpenLP.Ui', 'Split a slide into two only if it does not fit on the screen as one slide.') - # TODO: Check before converting to python3 string - self.StartTimeCode = translate('OpenLP.Ui', 'Start %s') + # TODO: WHERE is this used at? cannot find where it's used at in code. + self.StartTimeCode = translate('OpenLP.Ui', 'Start {code}') self.StopPlaySlidesInLoop = translate('OpenLP.Ui', 'Stop Play Slides in Loop') self.StopPlaySlidesToEnd = translate('OpenLP.Ui', 'Stop Play Slides to End') self.Theme = translate('OpenLP.Ui', 'Theme', 'Singular') diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index a7e01bd24..80da92cde 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -323,8 +323,7 @@ def create_separated_list(string_list): return '' elif len(string_list) == 1: return string_list[0] - # TODO: - # Cannot convert these strings to python3 yet until I can figure out how to mock translate() with the new format + # TODO: Verify mocking of translate() test before conversion elif len(string_list) == 2: return translate('OpenLP.core.lib', '%s and %s', 'Locale list separator: 2 items') % (string_list[0], string_list[1]) diff --git a/openlp/core/lib/filedialog.py b/openlp/core/lib/filedialog.py index 249f7959d..e976f9c15 100644 --- a/openlp/core/lib/filedialog.py +++ b/openlp/core/lib/filedialog.py @@ -51,9 +51,9 @@ class FileDialog(QtWidgets.QFileDialog): file = parse.unquote(file) if not os.path.exists(file): log.error('File {text} not found.'.format(text=file)) - # TODO: Test with UiStrings() before converting to python3 strings + # TODO: Should work - need to verify QtWidgets.QMessageBox.information(parent, UiStrings().FileNotFound, - UiStrings().FileNotFoundMessage % file) + UiStrings().FileNotFoundMessage.format(name=file)) continue file_list.append(file) return file_list diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index f0d8ddef2..ffe9f05cc 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -396,74 +396,74 @@ from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, Vertic log = logging.getLogger(__name__) -# TODO: Verify where this is used before converting to python3 +# TODO: Tested at home HTMLSRC = """ OpenLP Display - - -%s + + +{html_additions}
@@ -582,17 +582,17 @@ def build_html(item, screen, is_live, background, image=None, plugins=None): css_additions += plugin.get_display_css() js_additions += plugin.get_display_javascript() html_additions += plugin.get_display_html() - html = HTMLSRC % ( - build_background_css(item, width), - css_additions, - build_footer_css(item, height), - build_lyrics_css(item), - 'true' if theme_data and theme_data.display_slide_transition and is_live else 'false', - js_additions, - bgimage_src, - image_src, - html_additions - ) + html = HTMLSRC.format(background_css=build_background_css(item, width), + additions=css_additions, + footer_css=build_footer_css(item, height), + lyrics_css=build_lyrics_css(item), + transitions='true' if (theme_data and + theme_data.display_slide_transition and + is_live) else 'false', + js_additions=js_additions, + bgimage=bgimage_src, + image=image_src, + html_additions=html_additions) return html @@ -650,23 +650,23 @@ def build_lyrics_css(item): :param item: Service Item containing theme and location information """ - # TODO: Verify this before converting to python3 + # TODO: Tested at home style = """ -.lyricstable { +.lyricstable {{ z-index: 5; position: absolute; display: table; - %s -} -.lyricscell { + {stable} +}} +.lyricscell {{ display: table-cell; word-wrap: break-word; -webkit-transition: opacity 0.4s ease; - %s -} -.lyricsmain { - %s -} + {lyrics} +}} +.lyricsmain {{ + {main} +}} """ theme_data = item.theme_data lyricstable = '' @@ -680,7 +680,7 @@ def build_lyrics_css(item): lyricsmain += ' text-shadow: {theme} {shadow}px ' \ '{shadow}px;'.format(theme=theme_data.font_main_shadow_color, shadow=theme_data.font_main_shadow_size) - lyrics_css = style % (lyricstable, lyrics, lyricsmain) + lyrics_css = style.format(stable=lyricstable, lyrics=lyrics, main=lyricsmain) return lyrics_css diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 0d233a9c4..c42a55741 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -370,21 +370,22 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties): self.web.resize(self.page_width, self.page_height) self.web_frame = self.web.page().mainFrame() # Adjust width and height to account for shadow. outline done in css. - # TODO: Verify before converting to python3 strings + # TODO: Tested at home html = """ -
""" % \ - (build_lyrics_format_css(theme_data, self.page_width, self.page_height), - build_lyrics_outline_css(theme_data)) + }} + +
""".format(format_css=build_lyrics_format_css(theme_data, + self.page_width, + self.page_height), + outline_css=build_lyrics_outline_css(theme_data)) self.web.setHtml(html) self.empty_height = self.web_frame.contentsSize().height() diff --git a/openlp/core/lib/theme.py b/openlp/core/lib/theme.py index 4e84d353b..8f29d9a3d 100644 --- a/openlp/core/lib/theme.py +++ b/openlp/core/lib/theme.py @@ -513,8 +513,8 @@ class ThemeXML(object): theme_strings = [] for key in dir(self): if key[0:1] != '_': - # TODO: Verify spacing format before converting to python3 string - theme_strings.append('%30s: %s' % (key, getattr(self, key))) + # TODO: Tested at home + theme_strings.append('{key:>30}: {value}'.format(key=key, value=getattr(self, key))) return '\n'.join(theme_strings) def _build_xml_from_attrs(self): diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 216780584..849ec291c 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -91,13 +91,13 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): super(ExceptionForm, self).__init__(None, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) self.setupUi(self) self.settings_section = 'crashreport' - # TODO: Need to see how to format strings when string with tags is actually a variable + # TODO: Should work - need to test self.report_text = '**OpenLP Bug Report**\n' \ - 'Version: %s\n\n' \ - '--- Details of the Exception. ---\n\n%s\n\n ' \ - '--- Exception Traceback ---\n%s\n' \ - '--- System information ---\n%s\n' \ - '--- Library Versions ---\n%s\n' + 'Version: {version}\n\n' \ + '--- Details of the Exception. ---\n\n{description}\n\n ' \ + '--- Exception Traceback ---\n{traceback}\n' \ + '--- System information ---\n{system}\n' \ + '--- Library Versions ---\n{libs}\n' def exec(self): """ @@ -133,7 +133,15 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): system += 'Desktop: GNOME\n' elif os.environ.get('DESKTOP_SESSION') == 'xfce': system += 'Desktop: Xfce\n' - return openlp_version, description, traceback, system, libraries + # NOTE: This needs to return a string that format() will use. See __init__.self.report_text for names. + return ("version='{version}', " + "description='{description}', " + "traceback='{traceback}', " + "libs='{libs}'").format(version=openlp_version, + description=description, + traceback=traceback, + system=system, + libs=libraries) def on_save_report_button_clicked(self): """ @@ -147,7 +155,8 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): if filename: filename = str(filename).replace('/', os.path.sep) Settings().setValue(self.settings_section + '/last directory', os.path.dirname(filename)) - report_text = self.report_text % self._create_report() + # NOTE: self._create_report() should return a string with the key names for format() + report_text = self.report_text.format(self._create_report()) try: report_file = open(filename, 'w') try: @@ -167,6 +176,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): """ Opening systems default email client and inserting exception log and system information. """ + # NOTE: self._create_report() should return a string with keys for format() content = self._create_report() source = '' exception = '' @@ -178,8 +188,8 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): subject = 'Bug report: {error} in {source}'.format(error=exception, source=source) mail_urlquery = QtCore.QUrlQuery() mail_urlquery.addQueryItem('subject', subject) - # TODO: Find out how to format() text that is in a variable - mail_urlquery.addQueryItem('body', self.report_text % content) + # TODO: Should be good - need to test + mail_urlquery.addQueryItem('body', self.report_text.format(content)) if self.file_attachment: mail_urlquery.addQueryItem('attach', self.file_attachment) mail_to_url = QtCore.QUrl('mailto:bugs@openlp.org') diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index cadb4814f..b9ba00f69 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -207,8 +207,8 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): trace_error_handler(log) self.update_screen_list_combo() self.application.process_events() - # TODO: Figure out how to use a variable with format() - self.downloading = translate('OpenLP.FirstTimeWizard', 'Downloading %s...') + # TODO: Tested at home + self.downloading = translate('OpenLP.FirstTimeWizard', 'Downloading {name}...') if self.has_run_wizard: self.songs_check_box.setChecked(self.plugin_manager.get_plugin_by_name('songs').is_active()) self.bible_check_box.setChecked(self.plugin_manager.get_plugin_by_name('bibles').is_active()) @@ -564,7 +564,7 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): self.progress_bar.setValue(self.progress_bar.maximum()) if self.has_run_wizard: text = translate('OpenLP.FirstTimeWizard', - 'Download complete. Click the {button} button to return to OpenLP.' + 'Download complete. Click the {text} button to return to OpenLP.' ).format(text=clean_button_text(self.buttonText(QtWidgets.QWizard.FinishButton))) self.progress_label.setText(text) else: @@ -632,7 +632,8 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): item = self.songs_list_widget.item(i) if item.checkState() == QtCore.Qt.Checked: filename, sha256 = item.data(QtCore.Qt.UserRole) - self._increment_progress_bar(self.downloading % filename, 0) + # TODO: Tested at home + self._increment_progress_bar(self.downloading.format(name=filename), 0) self.previous_size = 0 destination = os.path.join(songs_destination, str(filename)) if not self.url_get_file('{path}{name}'.format(path=self.songs_url, name=filename), @@ -644,7 +645,8 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): item = bibles_iterator.value() if item.parent() and item.checkState(0) == QtCore.Qt.Checked: bible, sha256 = item.data(0, QtCore.Qt.UserRole) - self._increment_progress_bar(self.downloading % bible, 0) + # TODO: Tested at home + self._increment_progress_bar(self.downloading.format(name=bible), 0) self.previous_size = 0 if not self.url_get_file('{path}{name}'.format(path=self.bibles_url, name=bible), os.path.join(bibles_destination, bible), @@ -656,8 +658,8 @@ class FirstTimeForm(QtWidgets.QWizard, UiFirstTimeWizard, RegistryProperties): item = self.themes_list_widget.item(i) if item.checkState() == QtCore.Qt.Checked: theme, sha256 = item.data(QtCore.Qt.UserRole) - # TODO: Verify how to use format() with strings in a variable - self._increment_progress_bar(self.downloading % theme, 0) + # TODO: Tested at home + self._increment_progress_bar(self.downloading.format(name=theme), 0) self.previous_size = 0 if not self.url_get_file('{path}{name}'.format(path=self.themes_url, name=theme), os.path.join(themes_destination, theme), diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ccd12727c..7187ab7e3 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -1334,7 +1334,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): self.recent_files_menu.clear() for file_id, filename in enumerate(recent_files_to_display): log.debug('Recent file name: {name}'.format(name=filename)) - # TODO: Verify ''.format() before committing + # TODO: Should be good action = create_action(self, '', text='&{n} {name}'.format(n=file_id + 1, name=os.path.splitext(os.path.basename(str(filename)))[0]), diff --git a/openlp/core/ui/pluginform.py b/openlp/core/ui/pluginform.py index 4280bcd25..75bf9652d 100644 --- a/openlp/core/ui/pluginform.py +++ b/openlp/core/ui/pluginform.py @@ -60,7 +60,7 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties): self._clear_details() self.programatic_change = True plugin_list_width = 0 - # TODO: See how to use format() with variables + # TODO: Tested at home for plugin in self.plugin_manager.plugins: item = QtWidgets.QListWidgetItem(self.plugin_list_widget) # We do this just to make 100% sure the status is an integer as @@ -68,19 +68,19 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties): plugin.status = int(plugin.status) # Set the little status text in brackets next to the plugin name. if plugin.status == PluginStatus.Disabled: - status_text = translate('OpenLP.PluginForm', '%s (Disabled)') + status_text = translate('OpenLP.PluginForm', '{name} (Disabled)') elif plugin.status == PluginStatus.Active: - status_text = translate('OpenLP.PluginForm', '%s (Active)') + status_text = translate('OpenLP.PluginForm', '{name} (Active)') else: # PluginStatus.Inactive - status_text = translate('OpenLP.PluginForm', '%s (Inactive)') - item.setText(status_text % plugin.name_strings['singular']) + status_text = translate('OpenLP.PluginForm', '{name} (Inactive)') + item.setText(status_text.format(name=plugin.name_strings['singular'])) # If the plugin has an icon, set it! if plugin.icon: item.setIcon(plugin.icon) self.plugin_list_widget.addItem(item) plugin_list_width = max(plugin_list_width, self.fontMetrics().width( - translate('OpenLP.PluginForm', '%s (Inactive)') % plugin.name_strings['singular'])) + translate('OpenLP.PluginForm', '{name} (Inactive)').format(name=plugin.name_strings['singular']))) self.plugin_list_widget.setFixedWidth(plugin_list_width + self.plugin_list_widget.iconSize().width() + 48) def _clear_details(self): @@ -137,13 +137,13 @@ class PluginForm(QtWidgets.QDialog, Ui_PluginViewDialog, RegistryProperties): self.active_plugin.app_startup() else: self.active_plugin.toggle_status(PluginStatus.Inactive) - # TODO: Verify using format() with a variable - status_text = translate('OpenLP.PluginForm', '%s (Inactive)') + # TODO: Tested at home + status_text = translate('OpenLP.PluginForm', '{name} (Inactive)') if self.active_plugin.status == PluginStatus.Active: - status_text = translate('OpenLP.PluginForm', '%s (Active)') + status_text = translate('OpenLP.PluginForm', '{name} (Active)') elif self.active_plugin.status == PluginStatus.Inactive: - status_text = translate('OpenLP.PluginForm', '%s (Inactive)') + status_text = translate('OpenLP.PluginForm', '{name} (Inactive)') elif self.active_plugin.status == PluginStatus.Disabled: - status_text = translate('OpenLP.PluginForm', '%s (Disabled)') + status_text = translate('OpenLP.PluginForm', '{name} (Disabled)') self.plugin_list_widget.currentItem().setText( - status_text % self.active_plugin.name_strings['singular']) + status_text.format(name=self.active_plugin.name_strings['singular'])) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 475bfc0b7..f6faee1ec 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -464,9 +464,9 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties): """ Background video button pushed. """ - # TODO: Check this before converting - visible_formats = '(%s)' % '; '.join(VIDEO_EXT) - actual_formats = '(%s)' % ' '.join(VIDEO_EXT) + # TODO: Should work + visible_formats = '({name})'.format(name='; '.join(VIDEO_EXT)) + actual_formats = '({name})'.format(name=' '.join(VIDEO_EXT)) video_filter = '{trans} {visible} {actual}'.format(trans=translate('OpenLP', 'Video Files'), visible=visible_formats, actual=actual_formats) video_filter = '{video};;{ui} (*.*)'.format(video=video_filter, ui=UiStrings().AllFiles) diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index 70ca9fd88..928e3f6b3 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -769,7 +769,7 @@ class ThemeManager(OpenLPMixin, RegistryMixin, QtWidgets.QWidget, Ui_ThemeManage '{count} time(s) by {plugin}' ).format(name=used_count, plugin=plugin.name))) - plugin_usage = "%s\n" % plugin_usage + plugin_usage = "{text}\n".format(text=plugin_usage) if plugin_usage: critical_error_message_box(translate('OpenLP.ThemeManager', 'Unable to delete theme'), translate('OpenLP.ThemeManager', diff --git a/tests/functional/openlp_core_lib/test_file_dialog.py b/tests/functional/openlp_core_lib/test_file_dialog.py index 252ce3190..238b398d3 100644 --- a/tests/functional/openlp_core_lib/test_file_dialog.py +++ b/tests/functional/openlp_core_lib/test_file_dialog.py @@ -60,7 +60,7 @@ class TestFileDialog(TestCase): self.mocked_os.path.exists.side_effect = lambda file_name: file_name in [ '/Valid File', '/url encoded file #1'] self.mocked_ui_strings().FileNotFound = 'File Not Found' - self.mocked_ui_strings().FileNotFoundMessage = 'File %s not found.\nPlease try selecting it individually.' + self.mocked_ui_strings().FileNotFoundMessage = 'File {name} not found.\nPlease try selecting it individually.' # WHEN: FileDialog.getOpenFileNames is called result = FileDialog.getOpenFileNames(self.mocked_parent) From ed7ea01f43b318526d06def9ec36d1d69db6a2dc Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Fri, 3 Jun 2016 22:38:51 -0700 Subject: [PATCH 38/66] Tests fixes and updates --- .../test_registryproperties.py | 1 - .../openlp_core_lib/test_projector_pjlink1.py | 20 +++---------------- .../openlp_core_lib/test_projectordb.py | 13 ++++++++++++ .../openlp_plugins/bibles/test_lib.py | 1 + .../openlp_plugins/songs/test_opsproimport.py | 1 - 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/tests/functional/openlp_core_common/test_registryproperties.py b/tests/functional/openlp_core_common/test_registryproperties.py index 98408b323..45eb4d45e 100644 --- a/tests/functional/openlp_core_common/test_registryproperties.py +++ b/tests/functional/openlp_core_common/test_registryproperties.py @@ -75,4 +75,3 @@ class TestRegistryProperties(TestCase, RegistryProperties): # THEN the application should be none self.assertEqual(self.application, application, 'The application value should match') - diff --git a/tests/functional/openlp_core_lib/test_projector_pjlink1.py b/tests/functional/openlp_core_lib/test_projector_pjlink1.py index 4928e5d0c..01ddde060 100644 --- a/tests/functional/openlp_core_lib/test_projector_pjlink1.py +++ b/tests/functional/openlp_core_lib/test_projector_pjlink1.py @@ -29,26 +29,12 @@ from openlp.core.lib.projector.pjlink1 import PJLink1 from openlp.core.lib.projector.constants import E_PARAMETER, ERROR_STRING, S_OFF, S_STANDBY, S_WARMUP, S_ON, \ S_COOLDOWN, PJLINK_POWR_STATUS -from tests.functional import patch +from tests.functional import MagicMock, patch from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_CONNECT_AUTHENTICATE pjlink_test = PJLink1(name='test', ip='127.0.0.1', pin=TEST_PIN, no_poll=True) -class DummyTimer(object): - ''' - Dummy class to fake timers - ''' - def __init__(self, *args, **kwargs): - pass - - def start(self, *args, **kwargs): - pass - - def stop(self, *args, **kwargs): - pass - - class TestPJLink(TestCase): """ Tests for the PJLink module @@ -308,8 +294,8 @@ class TestPJLink(TestCase): pjlink.other_info = 'ANOTHER TEST' pjlink.send_queue = True pjlink.send_busy = True - pjlink.timer = DummyTimer() - pjlink.socket_timer = DummyTimer() + pjlink.timer = MagicMock() + pjlink.socket_timer = MagicMock() # WHEN: reset_information() is called with patch.object(pjlink.timer, 'stop') as mock_timer: diff --git a/tests/functional/openlp_core_lib/test_projectordb.py b/tests/functional/openlp_core_lib/test_projectordb.py index 61263042f..0b780acd2 100644 --- a/tests/functional/openlp_core_lib/test_projectordb.py +++ b/tests/functional/openlp_core_lib/test_projectordb.py @@ -284,3 +284,16 @@ class TestProjectorDB(TestCase): self.assertEqual(str(source), '', 'ProjectorSource.__repr__)_ should have returned a proper representation string') + + def test_get_projector_by_id_none(self): + """ + Test get_projector_by_id returns None if no db entry + """ + # GIVEN: Test object and data + projector = self.projector + + # WHEN: DB search for entry not saved + results = projector.get_projector_by_id(dbid=123134556409824506) + + # THEN: Verify return was None + self.assertEqual(results, None, 'Returned results should have equaled None') diff --git a/tests/functional/openlp_plugins/bibles/test_lib.py b/tests/functional/openlp_plugins/bibles/test_lib.py index a8dba0bd9..27d7f5e51 100644 --- a/tests/functional/openlp_plugins/bibles/test_lib.py +++ b/tests/functional/openlp_plugins/bibles/test_lib.py @@ -43,6 +43,7 @@ class TestLib(TestCase): separators = {'sep_r': '\\s*(?:e)\\s*', 'sep_e_default': 'end', 'sep_v_display': 'w', 'sep_l_display': 'r', 'sep_v_default': ':|v|V|verse|verses', 'sep_l': '\\s*(?:r)\\s*', 'sep_l_default': ',|and', 'sep_e': '\\s*(?:t)\\s*', 'sep_v': '\\s*(?:w)\\s*', 'sep_r_display': 'e', 'sep_r_default': '-|to'} + def _update_side_effect(): """ Update the references after mocking out the method diff --git a/tests/functional/openlp_plugins/songs/test_opsproimport.py b/tests/functional/openlp_plugins/songs/test_opsproimport.py index 239b77c30..8db69b609 100644 --- a/tests/functional/openlp_plugins/songs/test_opsproimport.py +++ b/tests/functional/openlp_plugins/songs/test_opsproimport.py @@ -171,4 +171,3 @@ class TestOpsProSongImport(TestCase): result_data = json.loads(result_file.read().decode()) self.assertListEqual(importer.verses, _get_item(result_data, 'verses')) self.assertListEqual(importer.verse_order_list_generated, _get_item(result_data, 'verse_order_list')) - From a4483af5b4c699142eff5658f7a3df073d219e59 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Sat, 4 Jun 2016 01:03:25 -0700 Subject: [PATCH 39/66] Revert htmlbuilder for now --- openlp/core/lib/htmlbuilder.py | 152 ++++++++++++++++----------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index ffe9f05cc..f0d8ddef2 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -396,74 +396,74 @@ from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, Vertic log = logging.getLogger(__name__) -# TODO: Tested at home +# TODO: Verify where this is used before converting to python3 HTMLSRC = """ OpenLP Display - - -{html_additions} + + +%s
@@ -582,17 +582,17 @@ def build_html(item, screen, is_live, background, image=None, plugins=None): css_additions += plugin.get_display_css() js_additions += plugin.get_display_javascript() html_additions += plugin.get_display_html() - html = HTMLSRC.format(background_css=build_background_css(item, width), - additions=css_additions, - footer_css=build_footer_css(item, height), - lyrics_css=build_lyrics_css(item), - transitions='true' if (theme_data and - theme_data.display_slide_transition and - is_live) else 'false', - js_additions=js_additions, - bgimage=bgimage_src, - image=image_src, - html_additions=html_additions) + html = HTMLSRC % ( + build_background_css(item, width), + css_additions, + build_footer_css(item, height), + build_lyrics_css(item), + 'true' if theme_data and theme_data.display_slide_transition and is_live else 'false', + js_additions, + bgimage_src, + image_src, + html_additions + ) return html @@ -650,23 +650,23 @@ def build_lyrics_css(item): :param item: Service Item containing theme and location information """ - # TODO: Tested at home + # TODO: Verify this before converting to python3 style = """ -.lyricstable {{ +.lyricstable { z-index: 5; position: absolute; display: table; - {stable} -}} -.lyricscell {{ + %s +} +.lyricscell { display: table-cell; word-wrap: break-word; -webkit-transition: opacity 0.4s ease; - {lyrics} -}} -.lyricsmain {{ - {main} -}} + %s +} +.lyricsmain { + %s +} """ theme_data = item.theme_data lyricstable = '' @@ -680,7 +680,7 @@ def build_lyrics_css(item): lyricsmain += ' text-shadow: {theme} {shadow}px ' \ '{shadow}px;'.format(theme=theme_data.font_main_shadow_color, shadow=theme_data.font_main_shadow_size) - lyrics_css = style.format(stable=lyricstable, lyrics=lyrics, main=lyricsmain) + lyrics_css = style % (lyricstable, lyrics, lyricsmain) return lyrics_css From b627736e5e4c1041c19c135a8772d5cfe4011958 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Wed, 15 Jun 2016 08:05:05 -0700 Subject: [PATCH 40/66] Convert renderer string to Template() --- openlp/core/lib/renderer.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index c42a55741..ba4a5563e 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -22,6 +22,7 @@ import re +from string import Template from PyQt5 import QtGui, QtCore, QtWebKitWidgets from openlp.core.common import Registry, RegistryProperties, OpenLPMixin, RegistryMixin, Settings @@ -371,22 +372,22 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties): self.web_frame = self.web.page().mainFrame() # Adjust width and height to account for shadow. outline done in css. # TODO: Tested at home - html = """ -
""".format(format_css=build_lyrics_format_css(theme_data, - self.page_width, - self.page_height), - outline_css=build_lyrics_outline_css(theme_data)) - self.web.setHtml(html) + } + +
""") + self.web.setHtml(html.substitute(format_css=build_lyrics_format_css(theme_data, + self.page_width, + self.page_height), + outline_css=build_lyrics_outline_css(theme_data))) self.empty_height = self.web_frame.contentsSize().height() def _paginate_slide(self, lines, line_end): From 7a8b519b8c3559c11f4728bb1565d47e2fdc97d0 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Thu, 16 Jun 2016 07:44:32 -0700 Subject: [PATCH 41/66] Add test for renderer change to template string --- openlp/core/lib/renderer.py | 9 ++-- .../openlp_core_lib/test_renderer.py | 44 +++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index ba4a5563e..2646a7f40 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -381,9 +381,12 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties): // returned value). return main.offsetHeight; } - -
""") + + +
""") self.web.setHtml(html.substitute(format_css=build_lyrics_format_css(theme_data, self.page_width, self.page_height), diff --git a/tests/functional/openlp_core_lib/test_renderer.py b/tests/functional/openlp_core_lib/test_renderer.py index a08fc8674..eac6a929b 100644 --- a/tests/functional/openlp_core_lib/test_renderer.py +++ b/tests/functional/openlp_core_lib/test_renderer.py @@ -29,6 +29,7 @@ from PyQt5 import QtCore from openlp.core.common import Registry from openlp.core.lib import Renderer, ScreenList, ServiceItem, FormattingTags from openlp.core.lib.renderer import words_split, get_start_tags +from openlp.core.lib.theme import ThemeXML from tests.functional import MagicMock, patch @@ -39,6 +40,24 @@ SCREEN = { } +# WARNING: Leave formatting alone - this is how it's returned in renderer.py +CSS_TEST_ONE = """ + +
'""" + + class TestRenderer(TestCase): def setUp(self): @@ -159,3 +178,28 @@ class TestRenderer(TestCase): # THEN: The blanks have been removed. self.assertListEqual(result_words, expected_words) + + @patch('openlp.core.lib.renderer.QtWebKitWidgets.QWebView.setHtml') + @patch('openlp.core.lib.renderer.build_lyrics_format_css') + @patch('openlp.core.lib.renderer.build_lyrics_outline_css') + def test_set_text_rectangle(self, mock_outline_css, mock_lyrics_css, mock_webview): + """ + Test set_set_text_rectangle returns a proper html string + """ + # GIVEN: test object and data + mock_lyrics_css.return_value = ' FORMAT CSS; ' + mock_outline_css.return_value = ' OUTLINE CSS; ' + theme_data = ThemeXML() + theme_data.font_main_name = 'Arial' + theme_data.font_main_size = 20 + theme_data.font_main_color = '#FFFFFF' + theme_data.font_main_outline_color = '#FFFFFF' + main = QtCore.QRect(10, 10, 1280, 900) + foot = QtCore.QRect(10, 1000, 1260, 24) + renderer = Renderer() + + # WHEN: Calling methd + renderer._set_text_rectangle(theme_data=theme_data, rect_main=main, rect_footer=foot) + + # THEN: QtWebKitWidgets should be called with the proper string + mock_webview.setHtml.called_with(CSS_TEST_ONE, 'Should be the same') From 018f6f8af5b998d7c0686c131db43fc6e38c1347 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Thu, 16 Jun 2016 08:07:34 -0700 Subject: [PATCH 42/66] Fix spelling --- tests/functional/openlp_core_lib/test_renderer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional/openlp_core_lib/test_renderer.py b/tests/functional/openlp_core_lib/test_renderer.py index eac6a929b..ebc95adc3 100644 --- a/tests/functional/openlp_core_lib/test_renderer.py +++ b/tests/functional/openlp_core_lib/test_renderer.py @@ -179,12 +179,12 @@ class TestRenderer(TestCase): # THEN: The blanks have been removed. self.assertListEqual(result_words, expected_words) - @patch('openlp.core.lib.renderer.QtWebKitWidgets.QWebView.setHtml') + @patch('openlp.core.lib.renderer.QtWebKitWidgets.QWebView') @patch('openlp.core.lib.renderer.build_lyrics_format_css') @patch('openlp.core.lib.renderer.build_lyrics_outline_css') def test_set_text_rectangle(self, mock_outline_css, mock_lyrics_css, mock_webview): """ - Test set_set_text_rectangle returns a proper html string + Test set_text_rectangle returns a proper html string """ # GIVEN: test object and data mock_lyrics_css.return_value = ' FORMAT CSS; ' @@ -198,7 +198,7 @@ class TestRenderer(TestCase): foot = QtCore.QRect(10, 1000, 1260, 24) renderer = Renderer() - # WHEN: Calling methd + # WHEN: Calling method renderer._set_text_rectangle(theme_data=theme_data, rect_main=main, rect_footer=foot) # THEN: QtWebKitWidgets should be called with the proper string From 29043f0789c22033e9ec427e871d2ab5e659e5e0 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Fri, 17 Jun 2016 08:30:23 -0700 Subject: [PATCH 43/66] string format error --- openlp/plugins/songs/lib/openlyricsxml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/lib/openlyricsxml.py b/openlp/plugins/songs/lib/openlyricsxml.py index 5adffb300..8629bbb6e 100644 --- a/openlp/plugins/songs/lib/openlyricsxml.py +++ b/openlp/plugins/songs/lib/openlyricsxml.py @@ -643,7 +643,7 @@ class OpenLyrics(object): # Append text from tail and add formatting end tag. # TODO: Verify format() with template variables if element.tag == NSMAP % 'tag' and use_endtag: - text += '{/{name}}}'.format(name=element.get('name')) + text += '{{/{name}}}'.format(name=element.get('name')) # Append text from tail. if element.tail: text += element.tail From 467c6723399f8360b82885ac68d78ced43e5de45 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Wed, 22 Jun 2016 08:07:50 -0700 Subject: [PATCH 44/66] Typo --- openlp/plugins/bibles/lib/manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/bibles/lib/manager.py b/openlp/plugins/bibles/lib/manager.py index d1465475d..1c55222f2 100644 --- a/openlp/plugins/bibles/lib/manager.py +++ b/openlp/plugins/bibles/lib/manager.py @@ -370,7 +370,7 @@ class BibleManager(RegistryProperties): """ log.debug('save_meta data {bible}, {version}, {copyright}, {perms}'.format(bible=bible, version=version, - cr=copyright, + copyright=copyright, perms=permissions)) self.db_cache[bible].save_meta('name', version) self.db_cache[bible].save_meta('copyright', copyright) From c2d884df485fb7ccf0dbc784b11b3d3738a487d5 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Thu, 23 Jun 2016 21:28:23 -0700 Subject: [PATCH 45/66] Missing format key --- openlp/core/ui/exceptionform.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 849ec291c..962ebcd93 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -135,6 +135,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): system += 'Desktop: Xfce\n' # NOTE: This needs to return a string that format() will use. See __init__.self.report_text for names. return ("version='{version}', " + "system='{system}', " "description='{description}', " "traceback='{traceback}', " "libs='{libs}'").format(version=openlp_version, From d878d8b8cb7efd64f6e38f95089ad78fe3fe893d Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Thu, 23 Jun 2016 21:38:18 -0700 Subject: [PATCH 46/66] Missed closing paren --- openlp/core/ui/exceptionform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 962ebcd93..6f9f441e5 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -142,7 +142,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): description=description, traceback=traceback, system=system, - libs=libraries) + libs=libraries)) def on_save_report_button_clicked(self): """ From de754e2cb1b3d2b3935965c16d2b388a23990556 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Fri, 24 Jun 2016 05:39:47 -0700 Subject: [PATCH 47/66] Convert exceptionform._create_report to return dict --- openlp/core/ui/exceptionform.py | 31 ++-- .../openlp_core_ui/test_exceptionform.py | 133 ++++++++++++++++++ 2 files changed, 146 insertions(+), 18 deletions(-) create mode 100644 tests/functional/openlp_core_ui/test_exceptionform.py diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 6f9f441e5..279230911 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -91,7 +91,6 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): super(ExceptionForm, self).__init__(None, QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint) self.setupUi(self) self.settings_section = 'crashreport' - # TODO: Should work - need to test self.report_text = '**OpenLP Bug Report**\n' \ 'Version: {version}\n\n' \ '--- Details of the Exception. ---\n\n{description}\n\n ' \ @@ -133,16 +132,9 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): system += 'Desktop: GNOME\n' elif os.environ.get('DESKTOP_SESSION') == 'xfce': system += 'Desktop: Xfce\n' - # NOTE: This needs to return a string that format() will use. See __init__.self.report_text for names. - return ("version='{version}', " - "system='{system}', " - "description='{description}', " - "traceback='{traceback}', " - "libs='{libs}'").format(version=openlp_version, - description=description, - traceback=traceback, - system=system, - libs=libraries)) + # NOTE: Keys match the expected input for self.report_text.format() + return {'version': openlp_version, 'description': description, 'traceback': traceback, + 'system': system, 'libs': libraries} def on_save_report_button_clicked(self): """ @@ -156,8 +148,9 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): if filename: filename = str(filename).replace('/', os.path.sep) Settings().setValue(self.settings_section + '/last directory', os.path.dirname(filename)) - # NOTE: self._create_report() should return a string with the key names for format() - report_text = self.report_text.format(self._create_report()) + opts = self._create_report() + report_text = self.report_text.format(version=opts['version'], description=opts['description'], + traceback=opts['traceback'], libs=ops['libs']) try: report_file = open(filename, 'w') try: @@ -177,11 +170,10 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): """ Opening systems default email client and inserting exception log and system information. """ - # NOTE: self._create_report() should return a string with keys for format() content = self._create_report() source = '' exception = '' - for line in content[2].split('\n'): + for line in content['traceback'].split('\n'): if re.search(r'[/\\]openlp[/\\]', line): source = re.sub(r'.*[/\\]openlp[/\\](.*)".*', r'\1', line) if ':' in line: @@ -189,8 +181,11 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): subject = 'Bug report: {error} in {source}'.format(error=exception, source=source) mail_urlquery = QtCore.QUrlQuery() mail_urlquery.addQueryItem('subject', subject) - # TODO: Should be good - need to test - mail_urlquery.addQueryItem('body', self.report_text.format(content)) + mail_urlquery.addQueryItem('body', self.report_text.format(version=content['version'], + description=content['description'], + traceback=content['traceback'], + system=content['system'], + libs=content['libs'])) if self.file_attachment: mail_urlquery.addQueryItem('attach', self.file_attachment) mail_to_url = QtCore.QUrl('mailto:bugs@openlp.org') @@ -220,7 +215,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): Settings().value(self.settings_section + '/last directory'), '{text} (*)'.format(text=UiStrings().AllFiles)) - log.info('New files(s) %s', str(files)) + log.info('New files(s) {files}'.format(str(files))) if files: self.file_attachment = str(files) diff --git a/tests/functional/openlp_core_ui/test_exceptionform.py b/tests/functional/openlp_core_ui/test_exceptionform.py new file mode 100644 index 000000000..85ad4c975 --- /dev/null +++ b/tests/functional/openlp_core_ui/test_exceptionform.py @@ -0,0 +1,133 @@ +# -*- coding: utf-8 -*- +# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 + +############################################################################### +# OpenLP - Open Source Lyrics Projection # +# --------------------------------------------------------------------------- # +# Copyright (c) 2008-2016 OpenLP Developers # +# --------------------------------------------------------------------------- # +# This program is free software; you can redistribute it and/or modify it # +# under the terms of the GNU General Public License as published by the Free # +# Software Foundation; version 2 of the License. # +# # +# This program is distributed in the hope that it will be useful, but WITHOUT # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # +# more details. # +# # +# You should have received a copy of the GNU General Public License along # +# with this program; if not, write to the Free Software Foundation, Inc., 59 # +# Temple Place, Suite 330, Boston, MA 02111-1307 USA # +############################################################################### +""" +Package to test the openlp.core.ui.exeptionform package. +""" + +import os +import socket +import tempfile +import urllib +from unittest import TestCase +from unittest.mock import mock_open + +from PyQt5.QtCore import QUrlQuery + +from openlp.core.common import Registry +from openlp.core.ui.firsttimeform import FirstTimeForm + +from tests.functional import MagicMock, patch +from tests.helpers.testmixin import TestMixin + +from openlp.core.ui import exceptionform + +exceptionform.WEBKIT_VERSION = 'Webkit Test' +exceptionform.MIGRATE_VERSION = 'Migrate Test' +exceptionform.CHARDET_VERSION = 'CHARDET Test' +exceptionform.ENCHANT_VERSION = 'Enchant Test' +exceptionform.MAKO_VERSION = 'Mako Test' +exceptionform.ICU_VERSION = 'ICU Test' +exceptionform.VLC_VERSION = 'VLC Test' + +MAIL_ITEM_TEXT = ('**OpenLP Bug Report**\nVersion: Trunk Test\n\n--- Details of the Exception. ---\n\n' + 'Description Test\n\n --- Exception Traceback ---\nopenlp: Traceback Test\n' + '--- System information ---\nPlatform: Nose Test\n\n--- Library Versions ---\n' + 'Python: Python Test\nQt5: Qt5 test\nPyQt5: PyQT5 Test\nQtWebkit: Webkit Test\n' + 'SQLAlchemy: SqlAlchemy Test\nSQLAlchemy Migrate: Migrate Test\nBeautifulSoup: BeautifulSoup Test\n' + 'lxml: ETree Test\nChardet: CHARDET Test\nPyEnchant: Enchant Test\nMako: Mako Test\n' + 'pyICU: ICU Test\npyUNO bridge: UNO Bridge Test\nVLC: VLC Test\n\n') + + +class TestExceptionForm(TestMixin, TestCase): + """ + Test functionality of exception form functions + """ + def setUp(self): + self.setup_application() + self.app.setApplicationVersion('0.0') + # Set up a fake "set_normal_cursor" method since we're not dealing with an actual OpenLP application object + self.app.set_normal_cursor = lambda: None + self.app.process_events = lambda: None + Registry.create() + Registry().register('application', self.app) + self.tempfile = os.path.join(tempfile.gettempdir(), 'testfile') + + def tearDown(self): + if os.path.isfile(self.tempfile): + os.remove(self.tempfile) + + @patch("openlp.core.ui.exceptionform.get_application_version") + @patch("openlp.core.ui.exceptionform.Ui_ExceptionDialog") + @patch("openlp.core.ui.exceptionform.QtWidgets.QFileDialog") + @patch("openlp.core.ui.exceptionform.QtCore.QUrl") + @patch("openlp.core.ui.exceptionform.QtCore.QUrlQuery.addQueryItem") + @patch("openlp.core.ui.exceptionform.QtGui.QDesktopServices.openUrl") + @patch("openlp.core.ui.exceptionform.is_linux") + @patch("openlp.core.ui.exceptionform.platform.python_version") + @patch("openlp.core.ui.exceptionform.platform.platform") + @patch("openlp.core.ui.exceptionform.Qt.qVersion") + @patch("openlp.core.ui.exceptionform.Qt") + @patch("openlp.core.ui.exceptionform.sqlalchemy") + @patch("openlp.core.ui.exceptionform.bs4") + @patch("openlp.core.ui.exceptionform.etree") + def test_on_send_report_button_clicked(self, + mocked_etree, + mocked_bs4, + mocked_sqlalchemy, + mocked_pyqt, + mocked_qversion, + mocked_platform, + mocked_python_version, + mocked_is_linux, + mocked_openlurl, + mocked_qurlquery, + mocked_qurl, + mocked_file_dialog, + mocked_ui_exception_dialog, + mocked_application_version): + """ + Test on_send_report_button_clicked creates the proper system information text + """ + # GIVEN: Test environment + mocked_etree.__version__ = 'ETree Test' + mocked_bs4.__version__ = 'BeautifulSoup Test' + mocked_sqlalchemy.__version__ = 'SqlAlchemy Test' + mocked_pyqt.PYQT_VERSION_STR = 'PyQT5 Test' + mocked_python_version.return_value = 'Python Test' + mocked_platform.return_value = 'Nose Test' + mocked_qversion.return_value = 'Qt5 test' + mocked_is_linux.return_value = False + mocked_application_version.return_value = 'Trunk Test' + test_form = exceptionform.ExceptionForm() + test_form.file_attachment = None + with patch.object(test_form, '_pyuno_import') as mock_pyuno: + with patch.object(test_form.exception_text_edit, 'toPlainText') as mock_traceback: + with patch.object(test_form.description_text_edit, 'toPlainText') as mock_description: + mock_pyuno.return_value = 'UNO Bridge Test' + mock_traceback.return_value = 'openlp: Traceback Test' + mock_description.return_value = 'Description Test' + + # WHEN: on_save_report_button_clicked called + test_form.on_send_report_button_clicked() + + # THEN: Verify strings were fomratted properly + mocked_qurlquery.assert_called_with('body', MAIL_ITEM_TEXT) From d3a2dd399afce71446217f2c4b020aa62ec1625f Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Sat, 25 Jun 2016 04:39:57 -0700 Subject: [PATCH 48/66] Fix missing format key, updated test --- .coveragerc | 5 - openlp/core/ui/exceptionform.py | 2 +- .../openlp_core_ui/test_exceptionform.py | 129 ++++++++++++++---- 3 files changed, 105 insertions(+), 31 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index f8f529f44..000000000 --- a/.coveragerc +++ /dev/null @@ -1,5 +0,0 @@ -[run] -source = openlp - -[html] -directory = coverage diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 279230911..432a4ee38 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -150,7 +150,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): Settings().setValue(self.settings_section + '/last directory', os.path.dirname(filename)) opts = self._create_report() report_text = self.report_text.format(version=opts['version'], description=opts['description'], - traceback=opts['traceback'], libs=ops['libs']) + traceback=opts['traceback'], libs=opts['libs'], system=opts['system']) try: report_file = open(filename, 'w') try: diff --git a/tests/functional/openlp_core_ui/test_exceptionform.py b/tests/functional/openlp_core_ui/test_exceptionform.py index 85ad4c975..00b3374c0 100644 --- a/tests/functional/openlp_core_ui/test_exceptionform.py +++ b/tests/functional/openlp_core_ui/test_exceptionform.py @@ -51,16 +51,49 @@ exceptionform.VLC_VERSION = 'VLC Test' MAIL_ITEM_TEXT = ('**OpenLP Bug Report**\nVersion: Trunk Test\n\n--- Details of the Exception. ---\n\n' 'Description Test\n\n --- Exception Traceback ---\nopenlp: Traceback Test\n' '--- System information ---\nPlatform: Nose Test\n\n--- Library Versions ---\n' - 'Python: Python Test\nQt5: Qt5 test\nPyQt5: PyQT5 Test\nQtWebkit: Webkit Test\n' + 'Python: Python Test\nQt5: Qt5 test\nPyQt5: PyQt5 Test\nQtWebkit: Webkit Test\n' 'SQLAlchemy: SqlAlchemy Test\nSQLAlchemy Migrate: Migrate Test\nBeautifulSoup: BeautifulSoup Test\n' 'lxml: ETree Test\nChardet: CHARDET Test\nPyEnchant: Enchant Test\nMako: Mako Test\n' 'pyICU: ICU Test\npyUNO bridge: UNO Bridge Test\nVLC: VLC Test\n\n') +@patch("openlp.core.ui.exceptionform.Qt.qVersion") +@patch("openlp.core.ui.exceptionform.QtGui.QDesktopServices.openUrl") +@patch("openlp.core.ui.exceptionform.get_application_version") +@patch("openlp.core.ui.exceptionform.sqlalchemy") +@patch("openlp.core.ui.exceptionform.bs4") +@patch("openlp.core.ui.exceptionform.etree") +@patch("openlp.core.ui.exceptionform.is_linux") +@patch("openlp.core.ui.exceptionform.platform.platform") +@patch("openlp.core.ui.exceptionform.platform.python_version") class TestExceptionForm(TestMixin, TestCase): """ Test functionality of exception form functions """ + def __method_template_for_class_patches(self, + __PLACEHOLDER_FOR_LOCAL_METHOD_PATCH_DECORATORS_GO_HERE__, + mocked_python_version, + mocked_platform, + mocked_is_linux, + mocked_etree, + mocked_bs4, + mocked_sqlalchemy, + mocked_application_version, + mocked_openlurl, + mocked_qversion, + ): + """ + Template so you don't have to remember the layout of class mock options for methods + """ + mocked_etree.__version__ = 'ETree Test' + mocked_bs4.__version__ = 'BeautifulSoup Test' + mocked_sqlalchemy.__version__ = 'SqlAlchemy Test' + mocked_python_version.return_value = 'Python Test' + mocked_platform.return_value = 'Nose Test' + mocked_qversion.return_value = 'Qt5 test' + mocked_is_linux.return_value = False + mocked_application_version.return_value = 'Trunk Test' + def setUp(self): self.setup_application() self.app.setApplicationVersion('0.0') @@ -75,50 +108,46 @@ class TestExceptionForm(TestMixin, TestCase): if os.path.isfile(self.tempfile): os.remove(self.tempfile) - @patch("openlp.core.ui.exceptionform.get_application_version") @patch("openlp.core.ui.exceptionform.Ui_ExceptionDialog") @patch("openlp.core.ui.exceptionform.QtWidgets.QFileDialog") @patch("openlp.core.ui.exceptionform.QtCore.QUrl") @patch("openlp.core.ui.exceptionform.QtCore.QUrlQuery.addQueryItem") - @patch("openlp.core.ui.exceptionform.QtGui.QDesktopServices.openUrl") - @patch("openlp.core.ui.exceptionform.is_linux") - @patch("openlp.core.ui.exceptionform.platform.python_version") - @patch("openlp.core.ui.exceptionform.platform.platform") - @patch("openlp.core.ui.exceptionform.Qt.qVersion") @patch("openlp.core.ui.exceptionform.Qt") - @patch("openlp.core.ui.exceptionform.sqlalchemy") - @patch("openlp.core.ui.exceptionform.bs4") - @patch("openlp.core.ui.exceptionform.etree") def test_on_send_report_button_clicked(self, - mocked_etree, - mocked_bs4, - mocked_sqlalchemy, - mocked_pyqt, - mocked_qversion, - mocked_platform, - mocked_python_version, - mocked_is_linux, - mocked_openlurl, - mocked_qurlquery, + mocked_qt, + mocked_add_query_item, mocked_qurl, mocked_file_dialog, mocked_ui_exception_dialog, - mocked_application_version): + mocked_python_version, + mocked_platform, + mocked_is_linux, + mocked_etree, + mocked_bs4, + mocked_sqlalchemy, + mocked_application_version, + mocked_openlurl, + mocked_qversion, + ): """ - Test on_send_report_button_clicked creates the proper system information text + Test send report creates the proper system information text """ # GIVEN: Test environment mocked_etree.__version__ = 'ETree Test' mocked_bs4.__version__ = 'BeautifulSoup Test' mocked_sqlalchemy.__version__ = 'SqlAlchemy Test' - mocked_pyqt.PYQT_VERSION_STR = 'PyQT5 Test' mocked_python_version.return_value = 'Python Test' mocked_platform.return_value = 'Nose Test' mocked_qversion.return_value = 'Qt5 test' mocked_is_linux.return_value = False mocked_application_version.return_value = 'Trunk Test' + mocked_qt.PYQT_VERSION_STR = 'PyQt5 Test' + mocked_is_linux.return_value = False + mocked_application_version.return_value = 'Trunk Test' + test_form = exceptionform.ExceptionForm() test_form.file_attachment = None + with patch.object(test_form, '_pyuno_import') as mock_pyuno: with patch.object(test_form.exception_text_edit, 'toPlainText') as mock_traceback: with patch.object(test_form.description_text_edit, 'toPlainText') as mock_description: @@ -129,5 +158,55 @@ class TestExceptionForm(TestMixin, TestCase): # WHEN: on_save_report_button_clicked called test_form.on_send_report_button_clicked() - # THEN: Verify strings were fomratted properly - mocked_qurlquery.assert_called_with('body', MAIL_ITEM_TEXT) + # THEN: Verify strings were formatted properly + mocked_add_query_item.assert_called_with('body', MAIL_ITEM_TEXT) + + @patch("openlp.core.ui.exceptionform.QtWidgets.QFileDialog.getSaveFileName") + @patch("openlp.core.ui.exceptionform.Qt") + def test_on_save_report_button_clicked(self, + mocked_qt, + mocked_save_filename, + mocked_python_version, + mocked_platform, + mocked_is_linux, + mocked_etree, + mocked_bs4, + mocked_sqlalchemy, + mocked_application_version, + mocked_openlurl, + mocked_qversion, + ): + """ + Test save report saves the correct information to a file + """ + mocked_etree.__version__ = 'ETree Test' + mocked_bs4.__version__ = 'BeautifulSoup Test' + mocked_sqlalchemy.__version__ = 'SqlAlchemy Test' + mocked_python_version.return_value = 'Python Test' + mocked_platform.return_value = 'Nose Test' + mocked_qversion.return_value = 'Qt5 test' + mocked_qt.PYQT_VERSION_STR = 'PyQt5 Test' + mocked_is_linux.return_value = False + mocked_application_version.return_value = 'Trunk Test' + mocked_save_filename.return_value = ['testfile.txt',] + + test_form = exceptionform.ExceptionForm() + test_form.file_attachment = None + + with patch.object(test_form, '_pyuno_import') as mock_pyuno: + with patch.object(test_form.exception_text_edit, 'toPlainText') as mock_traceback: + with patch.object(test_form.description_text_edit, 'toPlainText') as mock_description: + with patch("openlp.core.ui.exceptionform.open", mock_open(), create=True) as mocked_open: + mock_pyuno.return_value = 'UNO Bridge Test' + mock_traceback.return_value = 'openlp: Traceback Test' + mock_description.return_value = 'Description Test' + + # WHEN: on_save_report_button_clicked called + test_form.on_save_report_button_clicked() + + # THEN: Verify proper calls to save file + # self.maxDiff = None + check_text = "call().write({text})".format(text=MAIL_ITEM_TEXT.__repr__()) + write_text = "{text}".format(text=mocked_open.mock_calls[1]) + mocked_open.assert_called_with('testfile.txt', 'w') + self.assertEquals(check_text, write_text, "Saved information should match test text") From f7532b7896c859fb777fbb43a625b5c3989142bb Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Sat, 25 Jun 2016 07:41:06 -0700 Subject: [PATCH 49/66] pep8 --- tests/functional/openlp_core_ui/test_exceptionform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/openlp_core_ui/test_exceptionform.py b/tests/functional/openlp_core_ui/test_exceptionform.py index 00b3374c0..452a8dee9 100644 --- a/tests/functional/openlp_core_ui/test_exceptionform.py +++ b/tests/functional/openlp_core_ui/test_exceptionform.py @@ -188,7 +188,7 @@ class TestExceptionForm(TestMixin, TestCase): mocked_qt.PYQT_VERSION_STR = 'PyQt5 Test' mocked_is_linux.return_value = False mocked_application_version.return_value = 'Trunk Test' - mocked_save_filename.return_value = ['testfile.txt',] + mocked_save_filename.return_value = ['testfile.txt', ] test_form = exceptionform.ExceptionForm() test_form.file_attachment = None From 68b4d625022928c0efb710e0fb5c59b2eb3c77ea Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Mon, 27 Jun 2016 02:14:24 +0300 Subject: [PATCH 50/66] - Turned the two new hidden settings into registry flags --- openlp/core/common/settings.py | 2 -- openlp/core/lib/mediamanageritem.py | 5 ++--- openlp/core/ui/maindisplay.py | 2 +- openlp/core/ui/mainwindow.py | 1 - openlp/core/ui/slidecontroller.py | 25 ++++++++++++++----------- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/openlp/core/common/settings.py b/openlp/core/common/settings.py index de3511e72..00be5647b 100644 --- a/openlp/core/common/settings.py +++ b/openlp/core/common/settings.py @@ -164,8 +164,6 @@ class Settings(QtCore.QSettings): 'core/display on monitor': True, 'core/override position': False, 'core/application version': '0.0', - 'core/is live item edited and replaced': False, - 'core/has doubleclicking preview added item to service': False, 'images/background color': '#000000', 'media/players': 'system,webkit', 'media/override player': QtCore.Qt.Unchecked, diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index ad505f890..9845c81c5 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -488,9 +488,8 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): 'You must select one or more items to preview.')) else: log.debug('%s Preview requested' % self.plugin.name) - # If ('advanced/double click live') is not enabled, double clicking preview adds the item to Service. - # This setting prevents it from being sent to Service multiple times, in here it is reset to False. - Settings().setValue('core/has doubleclicking preview added item to service', False) + # Reset the flag for: "has doubleclick added item to service" to False. + Registry().set_flag('has doubleclick added item to service', False) service_item = self.build_service_item() if service_item: service_item.from_plugin = True diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index ea8b0f6be..00f4be7ca 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -475,7 +475,7 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties): self.footer(service_item.foot_text) # if was hidden keep it hidden if self.hide_mode and self.is_live and not service_item.is_media(): - if Settings().value('core/auto unblank') and not Settings().value('core/is live item edited and replaced'): + if Settings().value('core/auto unblank'): Registry().execute('slidecontroller_live_unblank') else: self.hide_display(self.hide_mode) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 0c6520fdb..4729edf79 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -658,7 +658,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): """ # This setting is set to false, in case def replace_service_manager_item in slidecontroller would crash the # program and make blank to modes unavailable. - Settings().setValue('core/is live item edited and replaced', False) self.application.process_events() for plugin in self.plugin_manager.plugins: if plugin.is_active(): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 907c86b4d..e740502a1 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -139,6 +139,7 @@ class SlideController(DisplayController, RegistryProperties): Set up the Slide Controller. """ super(SlideController, self).__init__(parent) + Registry().set_flag('replace service manager item', False) def post_set_up(self): """ @@ -797,18 +798,18 @@ class SlideController(DisplayController, RegistryProperties): def replace_service_manager_item(self, item): """ - Replacement item following a remote edit + Replacement item following a remote edit. This action also takes place when a song that is sent to live from Service Manager is edited. If display is blanked, it will get unblanked if automatic unblanking is enabled. We prevent this from happening - by setting a hidden setting to "True" and then to "False" after the processing is done. - The setting is also set to "False" on every start up, should the program ever crash during this process. + by setting a flag to "True" and then to "False" after the processing is done. + The flag is also set to "False" on startup so display may be unblanked properly. :param item: The current service item """ if item == self.service_item: - Settings().setValue('core/is live item edited and replaced', True) + Registry().set_flag('replace service manager item', True) self._process_item(item, self.preview_widget.current_slide_number()) - Settings().setValue('core/is live item edited and replaced', False) + Registry().set_flag('replace service manager item', False) def add_service_manager_item(self, item, slide_no): """ @@ -977,9 +978,12 @@ class SlideController(DisplayController, RegistryProperties): def on_slide_unblank(self): """ - Handle the slidecontroller unblank event + Handle the slidecontroller unblank event. + If we are re-processing service item, don't unblank the display + (Found in def replace_service_manager_item) """ - self.on_blank_display(False) + if not Registry().get_flag('replace service manager item') == True: + self.on_blank_display(False) def on_blank_display(self, checked=None): """ @@ -1111,13 +1115,12 @@ class SlideController(DisplayController, RegistryProperties): % timeout) return # If "click live slide to unblank" is enabled, unblank the display. And start = Item is sent to Live. - # 'core/is live item edited and replaced' is only True when replacing Live item with the same item from Service. # Note: If this if statement is placed at the bottom of this function instead of top slide transitions are lost. if self.is_live and Settings().value('core/click live slide to unblank'): # With this display stays blanked when "auto unblank" setting is not enabled and new item is sent to Live. if not Settings().value('core/auto unblank') and start: () - if not start and not Settings().value('core/is live item edited and replaced'): + if not start: Registry().execute('slidecontroller_live_unblank') row = self.preview_widget.current_slide_number() old_selected_row = self.selected_row @@ -1395,9 +1398,9 @@ class SlideController(DisplayController, RegistryProperties): # Prevent same item in preview from being sent to Service multiple times. Changing preview slide resets # this setting. Sending to preview from Service does not reset this setting, this is a design choise. # Do note that this still allows to add item to Service multiple times if icon is clicked. - elif not Settings().value('core/has doubleclicking preview added item to service'): + elif not Registry().get_flag('has doubleclick added item to service') == True: self.on_preview_add_to_service() - Settings().setValue('core/has doubleclicking preview added item to service', True) + Registry().set_flag('has doubleclick added item to service', True) def on_go_live(self, field=None): """ From 6078e2817107b6cf47417e421cf8249b3cbf4bd0 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Mon, 27 Jun 2016 02:20:57 +0300 Subject: [PATCH 51/66] Comment cleanup / Improvements --- openlp/core/ui/mainwindow.py | 2 -- openlp/core/ui/slidecontroller.py | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 4729edf79..ccd12727c 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -656,8 +656,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): """ Give all the plugins a chance to perform some tasks at startup """ - # This setting is set to false, in case def replace_service_manager_item in slidecontroller would crash the - # program and make blank to modes unavailable. self.application.process_events() for plugin in self.plugin_manager.plugins: if plugin.is_active(): diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index e740502a1..b29543319 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1395,8 +1395,8 @@ class SlideController(DisplayController, RegistryProperties): self.on_media_close() self.on_go_live() # If ('advanced/double click live') is not enabled, double clicking preview adds the item to Service. - # Prevent same item in preview from being sent to Service multiple times. Changing preview slide resets - # this setting. Sending to preview from Service does not reset this setting, this is a design choise. + # Prevent same item in preview from being sent to Service multiple times. + # Changing the preview slide resets this flag to False. # Do note that this still allows to add item to Service multiple times if icon is clicked. elif not Registry().get_flag('has doubleclick added item to service') == True: self.on_preview_add_to_service() From 7b643b06acc894b7e52ef30e489d9c2d18551b1b Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Thu, 14 Jul 2016 21:02:23 +0300 Subject: [PATCH 52/66] - Tried to make the new text work with the registry changes but failed. > Test is broken, do not merge! --- openlp/core/ui/mainwindow.py | 1 + tests/functional/openlp_core_ui/test_slidecontroller.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ccd12727c..d4bc6b741 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -662,6 +662,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): plugin.app_startup() self.application.process_events() + def first_time(self): """ Import themes if first time diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index bbaa4b5d3..53869a365 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -718,7 +718,7 @@ class TestSlideController(TestCase): # GIVEN: A slide controller, actions needed, settins set to True. slide_controller = SlideController(None) mocked_settings = MagicMock() - mocked_settings.value.return_value = True + mocked_settings.return_value = True MockedSettings.return_value = mocked_settings slide_controller.service_item = MagicMock() slide_controller.service_item.is_media = MagicMock() @@ -727,6 +727,11 @@ class TestSlideController(TestCase): slide_controller.on_preview_add_to_service = MagicMock() slide_controller.media_reset = MagicMock() + Registry.create() + reg_value = True + Registry().set_flag('has doubleclick added item to service', reg_value) + temp = Registry().get_flag('has doubleclick added item to service') + # WHEN: on_preview_double_click is called slide_controller.on_preview_double_click() From 02b4d27b96f27b1fd24e41ad2dba6449a3b0e076 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Thu, 14 Jul 2016 21:13:58 +0300 Subject: [PATCH 53/66] pep8 fixes, test still broken. --- openlp/core/ui/mainwindow.py | 1 - openlp/core/ui/slidecontroller.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index d4bc6b741..ccd12727c 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -662,7 +662,6 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): plugin.app_startup() self.application.process_events() - def first_time(self): """ Import themes if first time diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index b29543319..851bf01fc 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -982,7 +982,7 @@ class SlideController(DisplayController, RegistryProperties): If we are re-processing service item, don't unblank the display (Found in def replace_service_manager_item) """ - if not Registry().get_flag('replace service manager item') == True: + if not Registry().get_flag('replace service manager item') is True: self.on_blank_display(False) def on_blank_display(self, checked=None): @@ -1398,7 +1398,7 @@ class SlideController(DisplayController, RegistryProperties): # Prevent same item in preview from being sent to Service multiple times. # Changing the preview slide resets this flag to False. # Do note that this still allows to add item to Service multiple times if icon is clicked. - elif not Registry().get_flag('has doubleclick added item to service') == True: + elif not Registry().get_flag('has doubleclick added item to service') is True: self.on_preview_add_to_service() Registry().set_flag('has doubleclick added item to service', True) From 39cbafd453cb8578a1d864546da3c0e21d65fe3e Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sat, 16 Jul 2016 18:41:39 +0300 Subject: [PATCH 54/66] Fixed the tests. --- tests/functional/openlp_core_ui/test_slidecontroller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 53869a365..927434c2a 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -726,11 +726,9 @@ class TestSlideController(TestCase): slide_controller.on_go_live = MagicMock() slide_controller.on_preview_add_to_service = MagicMock() slide_controller.media_reset = MagicMock() - Registry.create() reg_value = True Registry().set_flag('has doubleclick added item to service', reg_value) - temp = Registry().get_flag('has doubleclick added item to service') # WHEN: on_preview_double_click is called slide_controller.on_preview_double_click() @@ -752,6 +750,9 @@ class TestSlideController(TestCase): slide_controller.on_go_live = MagicMock() slide_controller.on_preview_add_to_service = MagicMock() slide_controller.media_reset = MagicMock() + Registry.create() + reg_value = False + Registry().set_flag('has doubleclick added item to service', reg_value) # WHEN: on_preview_double_click is called slide_controller.on_preview_double_click() From 4874f6a218d961d2b4b65c11d7d40a63dc7529aa Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sat, 16 Jul 2016 19:51:08 +0300 Subject: [PATCH 55/66] - Reduced comments - Removed unrequired reg_value from test. --- openlp/core/lib/mediamanageritem.py | 1 - openlp/core/ui/slidecontroller.py | 5 ----- tests/functional/openlp_core_ui/test_slidecontroller.py | 6 ++---- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index 9845c81c5..6a83f955d 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -488,7 +488,6 @@ class MediaManagerItem(QtWidgets.QWidget, RegistryProperties): 'You must select one or more items to preview.')) else: log.debug('%s Preview requested' % self.plugin.name) - # Reset the flag for: "has doubleclick added item to service" to False. Registry().set_flag('has doubleclick added item to service', False) service_item = self.build_service_item() if service_item: diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 851bf01fc..6fa9f4db0 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -800,9 +800,6 @@ class SlideController(DisplayController, RegistryProperties): """ Replacement item following a remote edit. This action also takes place when a song that is sent to live from Service Manager is edited. - If display is blanked, it will get unblanked if automatic unblanking is enabled. We prevent this from happening - by setting a flag to "True" and then to "False" after the processing is done. - The flag is also set to "False" on startup so display may be unblanked properly. :param item: The current service item """ @@ -979,8 +976,6 @@ class SlideController(DisplayController, RegistryProperties): def on_slide_unblank(self): """ Handle the slidecontroller unblank event. - If we are re-processing service item, don't unblank the display - (Found in def replace_service_manager_item) """ if not Registry().get_flag('replace service manager item') is True: self.on_blank_display(False) diff --git a/tests/functional/openlp_core_ui/test_slidecontroller.py b/tests/functional/openlp_core_ui/test_slidecontroller.py index 927434c2a..01f895daa 100644 --- a/tests/functional/openlp_core_ui/test_slidecontroller.py +++ b/tests/functional/openlp_core_ui/test_slidecontroller.py @@ -727,8 +727,7 @@ class TestSlideController(TestCase): slide_controller.on_preview_add_to_service = MagicMock() slide_controller.media_reset = MagicMock() Registry.create() - reg_value = True - Registry().set_flag('has doubleclick added item to service', reg_value) + Registry().set_flag('has doubleclick added item to service', True) # WHEN: on_preview_double_click is called slide_controller.on_preview_double_click() @@ -751,8 +750,7 @@ class TestSlideController(TestCase): slide_controller.on_preview_add_to_service = MagicMock() slide_controller.media_reset = MagicMock() Registry.create() - reg_value = False - Registry().set_flag('has doubleclick added item to service', reg_value) + Registry().set_flag('has doubleclick added item to service', False) # WHEN: on_preview_double_click is called slide_controller.on_preview_double_click() From 496c57cdfceb9751e6eb688aeb814e0df3d2926f Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Jul 2016 18:41:55 +0300 Subject: [PATCH 56/66] - Fixed the issue where items sent to Preview from Service may cause tracebacks. --- openlp/core/ui/slidecontroller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 6fa9f4db0..818831e61 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1509,6 +1509,7 @@ class PreviewController(RegistryMixin, OpenLPMixin, SlideController): self.split = 0 self.type_prefix = 'preview' self.category = 'Preview Toolbar' + Registry().set_flag('has doubleclick added item to service', True) def bootstrap_post_set_up(self): """ From 437039efed4f356a6ddc988c41a8f7e381a5e4e7 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Jul 2016 18:49:15 +0300 Subject: [PATCH 57/66] - Moved the 2nd new registry flag from one init to an another init which also has the 1st --- openlp/core/ui/slidecontroller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 818831e61..c2d594843 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -139,7 +139,6 @@ class SlideController(DisplayController, RegistryProperties): Set up the Slide Controller. """ super(SlideController, self).__init__(parent) - Registry().set_flag('replace service manager item', False) def post_set_up(self): """ @@ -1510,6 +1509,7 @@ class PreviewController(RegistryMixin, OpenLPMixin, SlideController): self.type_prefix = 'preview' self.category = 'Preview Toolbar' Registry().set_flag('has doubleclick added item to service', True) + Registry().set_flag('replace service manager item', False) def bootstrap_post_set_up(self): """ From 08bcb2c5d4faa6f73de1315032c9b34f656b3aac Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Jul 2016 18:53:27 +0300 Subject: [PATCH 58/66] - Moved them to another init since something broke --- openlp/core/ui/slidecontroller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index c2d594843..cd6a37342 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -88,6 +88,8 @@ class DisplayController(QtWidgets.QWidget): self.is_live = False self.display = None self.controller_type = None + Registry().set_flag('has doubleclick added item to service', True) + Registry().set_flag('replace service manager item', False) def send_to_plugins(self, *args): """ @@ -1508,8 +1510,6 @@ class PreviewController(RegistryMixin, OpenLPMixin, SlideController): self.split = 0 self.type_prefix = 'preview' self.category = 'Preview Toolbar' - Registry().set_flag('has doubleclick added item to service', True) - Registry().set_flag('replace service manager item', False) def bootstrap_post_set_up(self): """ From f5bc8056f78db0639818e6330be320c24bd54890 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 17 Jul 2016 19:11:51 +0300 Subject: [PATCH 59/66] - removed one unrequired if statement. --- openlp/core/ui/slidecontroller.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index cd6a37342..8e5334006 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -1113,9 +1113,6 @@ class SlideController(DisplayController, RegistryProperties): # If "click live slide to unblank" is enabled, unblank the display. And start = Item is sent to Live. # Note: If this if statement is placed at the bottom of this function instead of top slide transitions are lost. if self.is_live and Settings().value('core/click live slide to unblank'): - # With this display stays blanked when "auto unblank" setting is not enabled and new item is sent to Live. - if not Settings().value('core/auto unblank') and start: - () if not start: Registry().execute('slidecontroller_live_unblank') row = self.preview_widget.current_slide_number() From 0c8503a26609cbc668a20714d6948ca499054804 Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 24 Jul 2016 22:58:34 +0300 Subject: [PATCH 60/66] - Changed stuff based on comments by TRB143. --- openlp/core/ui/advancedtab.py | 2 +- openlp/core/ui/exceptionform.py | 2 +- openlp/core/ui/generaltab.py | 3 ++- openlp/plugins/media/lib/mediatab.py | 2 +- openlp/plugins/presentations/lib/presentationtab.py | 4 ++-- openlp/plugins/songs/lib/songstab.py | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index b12b60d4f..6201067fb 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -252,7 +252,7 @@ class AdvancedTab(SettingsTab): self.tab_title_visible = UiStrings().Advanced self.ui_group_box.setTitle(translate('OpenLP.AdvancedTab', 'UI Settings')) self.data_directory_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Data Location')) - self.recent_label.setText(translate('OpenLP.AdvancedTab', 'Number of recent Service files to display:')) + self.recent_label.setText(translate('OpenLP.AdvancedTab', 'Number of recent service files to display:')) self.media_plugin_check_box.setText(translate('OpenLP.AdvancedTab', 'Open the last used Library category on startup')) self.double_click_live_check_box.setText(translate('OpenLP.AdvancedTab', diff --git a/openlp/core/ui/exceptionform.py b/openlp/core/ui/exceptionform.py index 9213cf072..c88cf9ef8 100644 --- a/openlp/core/ui/exceptionform.py +++ b/openlp/core/ui/exceptionform.py @@ -199,7 +199,7 @@ class ExceptionForm(QtWidgets.QDialog, Ui_ExceptionDialog, RegistryProperties): else: self.__button_state(False) self.description_word_count.setText( - translate('OpenLP.ExceptionDialog', '{count} characters from the minimum description remaining.' + translate('OpenLP.ExceptionDialog', '{count} characters remaining from the minimum description.' ).format(count=count)) def on_attach_file_button_clicked(self): diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index 5173f315b..08592b49a 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -258,7 +258,8 @@ class GeneralTab(SettingsTab): 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')) - self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when adding new Live item')) + self.auto_unblank_check_box.setText(translate('OpenLP.GeneralTab', 'Unblank display when sending ' + 'items to Live')) self.auto_preview_check_box.setText(translate('OpenLP.GeneralTab', 'Automatically preview the next item in service')) self.timeout_label.setText(translate('OpenLP.GeneralTab', 'Timed slide interval:')) diff --git a/openlp/plugins/media/lib/mediatab.py b/openlp/plugins/media/lib/mediatab.py index 5944d39cf..0e00ec82b 100644 --- a/openlp/plugins/media/lib/mediatab.py +++ b/openlp/plugins/media/lib/mediatab.py @@ -54,7 +54,7 @@ class MediaTab(SettingsTab): def retranslateUi(self): self.advanced_group_box.setTitle(UiStrings().Advanced) self.override_player_check_box.setText(translate('MediaPlugin.MediaTab', 'Allow media player to be overridden')) - self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start videos Live items automatically')) + self.auto_start_check_box.setText(translate('MediaPlugin.MediaTab', 'Start new Live media automatically')) def load(self): self.override_player_check_box.setChecked(Settings().value(self.settings_section + '/override player')) diff --git a/openlp/plugins/presentations/lib/presentationtab.py b/openlp/plugins/presentations/lib/presentationtab.py index b7001c18e..efdcb0eb1 100644 --- a/openlp/plugins/presentations/lib/presentationtab.py +++ b/openlp/plugins/presentations/lib/presentationtab.py @@ -125,11 +125,11 @@ class PresentationTab(SettingsTab): translate('PresentationPlugin.PresentationTab', 'Allow presentation application to be overridden')) self.ppt_slide_click_check_box.setText( translate('PresentationPlugin.PresentationTab', - 'Clicking on current slide in Live advances to the next effect')) + 'Clicking on current slide advances to the next effect')) self.ppt_window_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Let PowerPoint control the size and monitor of the presentations\n' - '(This may fixes PowerPoint scaling issues in Windows)')) + '(This may fixes PowerPoint scaling issues in Windows 8 and 10)')) self.pdf_program_check_box.setText( translate('PresentationPlugin.PresentationTab', 'Use given full path for mudraw or ghostscript binary:')) diff --git a/openlp/plugins/songs/lib/songstab.py b/openlp/plugins/songs/lib/songstab.py index ef2ce0605..711e096a5 100644 --- a/openlp/plugins/songs/lib/songstab.py +++ b/openlp/plugins/songs/lib/songstab.py @@ -69,7 +69,7 @@ class SongsTab(SettingsTab): self.mode_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Songs Mode')) self.tool_bar_active_check_box.setText(translate('SongsPlugin.SongsTab', 'Enable "Go to verse" button in Live panel')) - self.update_on_edit_check_box.setText(translate('SongsPlugin.SongsTab', 'Update Service from song edit')) + self.update_on_edit_check_box.setText(translate('SongsPlugin.SongsTab', 'Update service from song edit')) self.add_from_service_check_box.setText(translate('SongsPlugin.SongsTab', 'Import missing songs from Service files')) self.display_songbook_check_box.setText(translate('SongsPlugin.SongsTab', 'Display songbook in footer')) From e9d53fd3d9acf92f0c9da1115b234560f95e840d Mon Sep 17 00:00:00 2001 From: suutari-olli Date: Sun, 24 Jul 2016 23:25:23 +0300 Subject: [PATCH 61/66] - Changed Remote web page titles from OpenLP | x to x | OpenLP --- openlp/plugins/remotes/lib/httprouter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openlp/plugins/remotes/lib/httprouter.py b/openlp/plugins/remotes/lib/httprouter.py index 5791146e6..38f9d9c35 100644 --- a/openlp/plugins/remotes/lib/httprouter.py +++ b/openlp/plugins/remotes/lib/httprouter.py @@ -319,9 +319,9 @@ class HttpRouter(RegistryProperties): remote = translate('RemotePlugin.Mobile', 'Remote') stage = translate('RemotePlugin.Mobile', 'Stage') self.template_vars = { - 'app_title': "OpenLP | {remote}".format(remote=remote), - 'stage_title': "OpenLP | {stage}".format(stage=stage), - 'live_title': "OpenLP | {live}".format(live=UiStrings().Live), + 'app_title': "{remote} | OpenLP".format(remote=remote), + 'stage_title': "{stage} | OpenLP".format(stage=stage), + 'live_title': "{live} | OpenLP".format(live=UiStrings().Live), 'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'), 'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'), 'alerts': translate('RemotePlugin.Mobile', 'Alerts'), From b41b4a591802928caab1183215f67f842ecfff3a Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Fri, 5 Aug 2016 12:18:47 -0700 Subject: [PATCH 62/66] Fix some todo notes --- openlp/core/common/uistrings.py | 1 - openlp/core/lib/filedialog.py | 1 - openlp/core/lib/renderer.py | 1 - openlp/core/lib/theme.py | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/openlp/core/common/uistrings.py b/openlp/core/common/uistrings.py index 91d947ade..ff7536f22 100644 --- a/openlp/core/common/uistrings.py +++ b/openlp/core/common/uistrings.py @@ -80,7 +80,6 @@ class UiStrings(object): self.Export = translate('OpenLP.Ui', 'Export') self.File = translate('OpenLP.Ui', 'File') self.FileNotFound = translate('OpenLP.Ui', 'File Not Found') - # TODO: Passed nose - verify in real life example self.FileNotFoundMessage = translate('OpenLP.Ui', 'File {name} not found.\nPlease try selecting it individually.') self.FontSizePtUnit = translate('OpenLP.Ui', 'pt', 'Abbreviated font pointsize unit') diff --git a/openlp/core/lib/filedialog.py b/openlp/core/lib/filedialog.py index e976f9c15..457bd663c 100644 --- a/openlp/core/lib/filedialog.py +++ b/openlp/core/lib/filedialog.py @@ -51,7 +51,6 @@ class FileDialog(QtWidgets.QFileDialog): file = parse.unquote(file) if not os.path.exists(file): log.error('File {text} not found.'.format(text=file)) - # TODO: Should work - need to verify QtWidgets.QMessageBox.information(parent, UiStrings().FileNotFound, UiStrings().FileNotFoundMessage.format(name=file)) continue diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 2646a7f40..40d974e53 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -371,7 +371,6 @@ class Renderer(OpenLPMixin, RegistryMixin, RegistryProperties): self.web.resize(self.page_width, self.page_height) self.web_frame = self.web.page().mainFrame() # Adjust width and height to account for shadow. outline done in css. - # TODO: Tested at home html = Template("""