From aa794ecf66d85ecb67ce1161b9e1af0e219765ac Mon Sep 17 00:00:00 2001 From: Philip Ridout Date: Sat, 13 May 2017 08:35:39 +0100 Subject: [PATCH] minor stylistic changes --- openlp/core/ui/advancedtab.py | 3 --- openlp/core/ui/lib/__init__.py | 20 +++++++++---------- openlp/core/ui/themeform.py | 7 ------- .../openlp_core_ui_lib/test_path_edit.py | 3 +-- 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 0ea86d6f3..8a449b37a 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -223,10 +223,7 @@ class AdvancedTab(SettingsTab): self.service_name_edit.textChanged.connect(self.update_service_name_example) self.service_name_revert_button.clicked.connect(self.on_service_name_revert_button_clicked) self.alternate_rows_check_box.toggled.connect(self.on_alternate_rows_check_box_toggled) - - self.data_directory_path_edit.pathChanged.connect(self.on_data_directory_path_edit_path_changed) - self.data_directory_cancel_button.clicked.connect(self.on_data_directory_cancel_button_clicked) self.data_directory_copy_check_box.toggled.connect(self.on_data_directory_copy_check_box_toggled) self.end_slide_radio_button.clicked.connect(self.on_end_slide_button_clicked) diff --git a/openlp/core/ui/lib/__init__.py b/openlp/core/ui/lib/__init__.py index 3a6eb3d7c..cf55b9d20 100644 --- a/openlp/core/ui/lib/__init__.py +++ b/openlp/core/ui/lib/__init__.py @@ -21,16 +21,16 @@ ############################################################################### from .colorbutton import ColorButton -from .pathedit import PathEdit, PathType -from .listwidgetwithdnd import ListWidgetWithDnD -from .treewidgetwithdnd import TreeWidgetWithDnD -from .toolbar import OpenLPToolbar -from .dockwidget import OpenLPDockWidget -from .wizard import OpenLPWizard, WizardStrings -from .mediadockmanager import MediaDockManager from .listpreviewwidget import ListPreviewWidget +from .listwidgetwithdnd import ListWidgetWithDnD +from .mediadockmanager import MediaDockManager +from .dockwidget import OpenLPDockWidget +from .toolbar import OpenLPToolbar +from .wizard import OpenLPWizard, WizardStrings +from .pathedit import PathEdit, PathType from .spelltextedit import SpellTextEdit +from .treewidgetwithdnd import TreeWidgetWithDnD -__all__ = ['ColorButton', 'PathEdit', 'PathType', 'ListPreviewWidget', 'ListWidgetWithDnD', 'OpenLPToolbar', - 'OpenLPDockWidget', 'OpenLPWizard', 'WizardStrings', 'MediaDockManager', 'ListPreviewWidget', - 'SpellTextEdit'] +__all__ = ['ColorButton', 'ListPreviewWidget', 'ListWidgetWithDnD', 'MediaDockManager', 'OpenLPDockWidget', + 'OpenLPToolbar', 'OpenLPWizard', 'PathEdit', 'PathType', 'SpellTextEdit', 'TreeWidgetWithDnD', + 'WizardStrings'] diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 6747bdf1c..a56148e7b 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -69,8 +69,6 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties): self.video_color_button.colorChanged.connect(self.on_video_color_changed) self.gradient_start_button.colorChanged.connect(self.on_gradient_start_color_changed) self.gradient_end_button.colorChanged.connect(self.on_gradient_end_color_changed) - - self.image_path_edit.filters = \ '{name};;{text} (*.*)'.format(name=get_images_filter(), text=UiStrings().AllFiles) self.image_path_edit.pathChanged.connect(self.on_image_path_edit_path_changed) @@ -80,12 +78,7 @@ class ThemeForm(QtWidgets.QWizard, Ui_ThemeWizard, RegistryProperties): video_filter = '{trans} {visible} {actual}'.format(trans=translate('OpenLP', 'Video Files'), visible=visible_formats, actual=actual_formats) self.video_path_edit.filters = '{video};;{ui} (*.*)'.format(video=video_filter, ui=UiStrings().AllFiles) - self.video_path_edit.pathChanged.connect(self.on_video_path_edit_path_changed) - - - - self.main_color_button.colorChanged.connect(self.on_main_color_changed) self.outline_color_button.colorChanged.connect(self.on_outline_color_changed) self.shadow_color_button.colorChanged.connect(self.on_shadow_color_changed) diff --git a/tests/functional/openlp_core_ui_lib/test_path_edit.py b/tests/functional/openlp_core_ui_lib/test_path_edit.py index 01ca55759..111951622 100755 --- a/tests/functional/openlp_core_ui_lib/test_path_edit.py +++ b/tests/functional/openlp_core_ui_lib/test_path_edit.py @@ -119,7 +119,6 @@ class TestPathEdit(TestCase): self.widget.browse_button.setToolTip.assert_called_once_with('Browse for file.') self.widget.revert_button.setToolTip.assert_called_once_with('Revert to default file.') - def test_on_browse_button_clicked_directory(self): """ Test the `browse_button` `clicked` handler on_browse_button_clicked when the `path_type` is set to Directories. @@ -273,7 +272,7 @@ class TestPathEdit(TestCase): """ # GIVEN: An instance of PathEdit with a mocked `line_edit` and `on_new_path`. with patch.object(self.widget, 'on_new_path') as mocked_on_new_path: - self.widget.line_edit = MagicMock(**{'text.return_value':'/test/pat.h'}) + self.widget.line_edit = MagicMock(**{'text.return_value': '/test/pat.h'}) # WHEN: Calling `on_line_edit_editing_finished` self.widget.on_line_edit_editing_finished()