From aaef55106cd8db989254cc4c8b928fcc6aea1234 Mon Sep 17 00:00:00 2001 From: Simon Hanna Date: Sat, 25 Aug 2018 16:36:46 +0200 Subject: [PATCH] Remove imports from openlp/core/ui/__init__.py and update related files --- openlp/core/app.py | 2 +- openlp/core/ui/__init__.py | 28 +------------------ openlp/core/ui/mainwindow.py | 9 ++++-- openlp/core/ui/servicemanager.py | 4 ++- openlp/core/ui/settingsform.py | 4 ++- openlp/core/ui/slidecontroller.py | 5 ++-- .../ui/test_formattingtagscontroller.py | 2 +- .../openlp_core/ui/test_maindisplay.py | 2 +- .../openlp_core/ui/test_servicemanager.py | 2 +- .../openlp_core/ui/test_thememanager.py | 2 +- .../openlp_core/ui/test_thememanager.py | 2 +- 11 files changed, 23 insertions(+), 39 deletions(-) diff --git a/openlp/core/app.py b/openlp/core/app.py index 4e0d4842a..53e5c06d4 100644 --- a/openlp/core/app.py +++ b/openlp/core/app.py @@ -43,7 +43,7 @@ from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings from openlp.core.display.screens import ScreenList from openlp.core.resources import qInitResources -from openlp.core.ui import SplashScreen +from openlp.core.ui.splashscreen import SplashScreen from openlp.core.ui.exceptionform import ExceptionForm from openlp.core.ui.firsttimeform import FirstTimeForm from openlp.core.ui.firsttimelanguageform import FirstTimeLanguageForm diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 336d0e78c..1e82f14e5 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -93,30 +93,4 @@ class SingleColumnTableWidget(QtWidgets.QTableWidget): self.resizeRowsToContents() -from .starttimeform import StartTimeForm -from .maindisplay import MainDisplay, Display, AudioPlayer -from .servicenoteform import ServiceNoteForm -from .serviceitemeditform import ServiceItemEditForm -from .slidecontroller import SlideController, DisplayController, PreviewController, LiveController -from .splashscreen import SplashScreen -from .generaltab import GeneralTab -from .themestab import ThemesTab -from .advancedtab import AdvancedTab -from .aboutform import AboutForm -from .pluginform import PluginForm -from .formattingtagform import FormattingTagForm -from .formattingtagcontroller import FormattingTagController -from .shortcutlistform import ShortcutListForm -from .servicemanager import ServiceManager -from .thememanager import ThemeManager - -from openlp.core.projectors.editform import ProjectorEditForm -from openlp.core.projectors.manager import ProjectorManager -from openlp.core.projectors.tab import ProjectorTab - -__all__ = ['SplashScreen', 'AboutForm', 'MainDisplay', 'SlideController', 'ServiceManager', - 'ThemeManager', 'ServiceItemEditForm', 'Display', 'AudioPlayer', - 'ServiceNoteForm', 'StartTimeForm', 'MainDisplay', - 'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm', - 'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget', - 'ProjectorManager', 'ProjectorTab', 'ProjectorEditForm', 'LiveController', 'PreviewController'] +__all__ = ['SingleColumnTableWidget'] diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 47408847c..84b652824 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -48,8 +48,13 @@ from openlp.core.lib.plugin import PluginStatus from openlp.core.lib.pluginmanager import PluginManager from openlp.core.lib.ui import create_action from openlp.core.projectors.manager import ProjectorManager -from openlp.core.ui import AboutForm, ServiceManager, ThemeManager, LiveController, PluginForm, \ - ShortcutListForm, FormattingTagForm, PreviewController +from openlp.core.ui.shortcutlistform import ShortcutListForm +from openlp.core.ui.formattingtagform import FormattingTagForm +from openlp.core.ui.thememanager import ThemeManager +from openlp.core.ui.servicemanager import ServiceManager +from openlp.core.ui.aboutform import AboutForm +from openlp.core.ui.pluginform import PluginForm +from openlp.core.ui.slidecontroller import LiveController, PreviewController from openlp.core.ui.settingsform import SettingsForm from openlp.core.ui.firsttimeform import FirstTimeForm from openlp.core.ui.media import MediaController diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 39966c221..a1deab320 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -48,7 +48,9 @@ from openlp.core.lib.plugin import PluginStatus from openlp.core.lib.serviceitem import ServiceItem, ItemCapabilities from openlp.core.lib.exceptions import ValidationError from openlp.core.lib.ui import critical_error_message_box, create_widget_action, find_and_set_in_combo_box -from openlp.core.ui import ServiceNoteForm, ServiceItemEditForm, StartTimeForm +from openlp.core.ui.serviceitemeditform import ServiceItemEditForm +from openlp.core.ui.servicenoteform import ServiceNoteForm +from openlp.core.ui.starttimeform import StartTimeForm from openlp.core.widgets.dialogs import FileDialog from openlp.core.widgets.toolbar import OpenLPToolbar diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 24ade6420..fc8b4e74e 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -31,7 +31,9 @@ from openlp.core.common.mixins import RegistryProperties from openlp.core.common.registry import Registry from openlp.core.lib import build_icon from openlp.core.projectors.tab import ProjectorTab -from openlp.core.ui import AdvancedTab, GeneralTab, ThemesTab +from openlp.core.ui.advancedtab import AdvancedTab +from openlp.core.ui.generaltab import GeneralTab +from openlp.core.ui.themestab import ThemesTab from openlp.core.ui.media import PlayerTab from openlp.core.ui.settingsdialog import Ui_SettingsDialog diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index aad93979b..12c3abdab 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -40,7 +40,8 @@ from openlp.core.lib import ImageSource, ServiceItemAction, build_icon from openlp.core.lib.htmlbuilder import build_html from openlp.core.lib.serviceitem import ServiceItem, ItemCapabilities from openlp.core.lib.ui import create_action -from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType +from openlp.core.ui import HideMode, DisplayControllerType +from openlp.core.ui.maindisplay import MainDisplay, Display from openlp.core.ui.icons import UiIcons from openlp.core.widgets.toolbar import OpenLPToolbar from openlp.core.widgets.views import ListPreviewWidget @@ -820,7 +821,7 @@ class SlideController(DisplayController, LogMixin, RegistryProperties): def add_service_manager_item(self, item, slide_no): """ Method to install the service item into the controller and request the correct toolbar for the plugin. Called by - :class:`~openlp.core.ui.ServiceManager` + :class:`~openlp.core.ui.servicemanager.ServiceManager` :param item: The current service item :param slide_no: The slide number to select diff --git a/tests/functional/openlp_core/ui/test_formattingtagscontroller.py b/tests/functional/openlp_core/ui/test_formattingtagscontroller.py index f4fb9f571..48ebddbe6 100644 --- a/tests/functional/openlp_core/ui/test_formattingtagscontroller.py +++ b/tests/functional/openlp_core/ui/test_formattingtagscontroller.py @@ -24,7 +24,7 @@ Package to test the openlp.core.ui.formattingtagscontroller package. """ from unittest import TestCase -from openlp.core.ui import FormattingTagController +from openlp.core.ui.formattingtagcontroller import FormattingTagController class TestFormattingTagController(TestCase): diff --git a/tests/functional/openlp_core/ui/test_maindisplay.py b/tests/functional/openlp_core/ui/test_maindisplay.py index 6d24da381..b72a3cb3e 100644 --- a/tests/functional/openlp_core/ui/test_maindisplay.py +++ b/tests/functional/openlp_core/ui/test_maindisplay.py @@ -32,7 +32,7 @@ from openlp.core.common.path import Path from openlp.core.common.registry import Registry from openlp.core.display.screens import ScreenList from openlp.core.lib.pluginmanager import PluginManager -from openlp.core.ui import MainDisplay, AudioPlayer +from openlp.core.ui.maindisplay import MainDisplay, AudioPlayer from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET from tests.helpers.testmixin import TestMixin diff --git a/tests/functional/openlp_core/ui/test_servicemanager.py b/tests/functional/openlp_core/ui/test_servicemanager.py index 967043973..89080f835 100644 --- a/tests/functional/openlp_core/ui/test_servicemanager.py +++ b/tests/functional/openlp_core/ui/test_servicemanager.py @@ -31,7 +31,7 @@ import PyQt5 from openlp.core.common import ThemeLevel from openlp.core.common.registry import Registry from openlp.core.lib.serviceitem import ServiceItem, ServiceItemType, ItemCapabilities -from openlp.core.ui import ServiceManager +from openlp.core.ui.servicemanager import ServiceManager from openlp.core.widgets.toolbar import OpenLPToolbar diff --git a/tests/functional/openlp_core/ui/test_thememanager.py b/tests/functional/openlp_core/ui/test_thememanager.py index ba5f7fc05..54d2687e3 100644 --- a/tests/functional/openlp_core/ui/test_thememanager.py +++ b/tests/functional/openlp_core/ui/test_thememanager.py @@ -32,7 +32,7 @@ from PyQt5 import QtWidgets from openlp.core.common.path import Path from openlp.core.common.registry import Registry -from openlp.core.ui import ThemeManager +from openlp.core.ui.thememanager import ThemeManager from tests.utils.constants import RESOURCE_PATH diff --git a/tests/interfaces/openlp_core/ui/test_thememanager.py b/tests/interfaces/openlp_core/ui/test_thememanager.py index e308ae00e..ea4beef01 100644 --- a/tests/interfaces/openlp_core/ui/test_thememanager.py +++ b/tests/interfaces/openlp_core/ui/test_thememanager.py @@ -28,7 +28,7 @@ from unittest.mock import patch, MagicMock from openlp.core.common.path import Path from openlp.core.common.registry import Registry from openlp.core.common.settings import Settings -from openlp.core.ui import ThemeManager +from openlp.core.ui.thememanager import ThemeManager from tests.helpers.testmixin import TestMixin