From c46cd951ef083696ea502bb7f5db9a254441e924 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Thu, 16 Nov 2017 15:53:53 -0800 Subject: [PATCH] Projector imports to fully-qualified, renamed projector dock --- openlp/core/projectors/__init__.py | 16 +++------------- openlp/core/ui/__init__.py | 6 +++--- openlp/core/ui/firsttimewizard.py | 4 ++-- openlp/core/ui/mainwindow.py | 6 +++--- openlp/core/ui/settingsform.py | 2 +- .../projectors/test_projector_pjlink_base.py | 3 ++- .../test_projector_pjlink_cmd_routing.py | 3 ++- .../projectors/test_projector_pjlink_commands.py | 3 ++- .../openlp_core/ui/test_projectoreditform.py | 4 +++- .../openlp_core/ui/test_projectormanager.py | 4 +++- 10 files changed, 24 insertions(+), 27 deletions(-) diff --git a/openlp/core/projectors/__init__.py b/openlp/core/projectors/__init__.py index a3f052d9b..396422902 100644 --- a/openlp/core/projectors/__init__.py +++ b/openlp/core/projectors/__init__.py @@ -20,27 +20,17 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ - :mod:`openlp.core.ui.projector` + :mod:`openlp.core.projectors` - Initialization for the openlp.core.ui.projector modules. + Initialization for the openlp.core.projectors modules. """ -__all__ = ['PJLINK_PORT', 'ERROR_MSG', 'ERROR_STRING', 'DialogSourceStyle', 'PJLink', 'Projector', - 'ProjectorDB', 'ProjectorEditForm', 'ProjectorManager', 'ProjectorTab'] +from openlp.core.projectors.constants import PJLINK_PORT, ERROR_MSG, ERROR_STRING -# Due to circular dependencies, put the imports after defines class DialogSourceStyle(object): """ An enumeration for projector dialog box type. """ Tabbed = 0 Single = 1 - - -from .constants import PJLINK_PORT, ERROR_MSG, ERROR_STRING -from .db import Projector, ProjectorDB -from .editform import ProjectorEditForm -from .manager import ProjectorManager -from .pjlink import PJLink -from .tab import ProjectorTab diff --git a/openlp/core/ui/__init__.py b/openlp/core/ui/__init__.py index 2bf3e4e47..5c2463e5d 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -116,9 +116,9 @@ from .shortcutlistform import ShortcutListForm from .servicemanager import ServiceManager from .thememanager import ThemeManager -from openlp.core.projectors import ProjectorManager -from openlp.core.projectors import ProjectorTab -from openlp.core.projectors import ProjectorEditForm +from openlp.core.projectors.editform import ProjectorEditForm +from openlp.core.projectors.manager import ProjectorManager +from openlp.core.projectors.tab import ProjectorTab __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm', 'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'Display', 'AudioPlayer', diff --git a/openlp/core/ui/firsttimewizard.py b/openlp/core/ui/firsttimewizard.py index be893cd5e..5212479ef 100644 --- a/openlp/core/ui/firsttimewizard.py +++ b/openlp/core/ui/firsttimewizard.py @@ -261,8 +261,8 @@ class UiFirstTimeWizard(object): self.alert_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Alerts – Display informative messages while showing other slides')) self.projectors_check_box.setText(translate('OpenLP.FirstTimeWizard', - 'Projectors – Control PJLink compatible projects on your network' - ' from OpenLP')) + 'Projector Controller – Control PJLink compatible projects on your' + ' network from OpenLP')) self.no_internet_page.setTitle(translate('OpenLP.FirstTimeWizard', 'No Internet Connection')) self.no_internet_page.setSubTitle( translate('OpenLP.FirstTimeWizard', 'Unable to detect an Internet connection.')) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 1e1a56daa..c1d452193 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -48,6 +48,7 @@ from openlp.core.display.screens import ScreenList from openlp.core.display.renderer import Renderer from openlp.core.lib import PluginManager, ImageManager, PluginStatus, build_icon from openlp.core.lib.ui import create_action +from openlp.core.projectors.manager import ProjectorManager from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, LiveController, PluginForm, \ ShortcutListForm, FormattingTagForm, PreviewController from openlp.core.ui.firsttimeform import FirstTimeForm @@ -55,7 +56,6 @@ from openlp.core.widgets.dialogs import FileDialog from openlp.core.widgets.docks import OpenLPDockWidget, MediaDockManager from openlp.core.ui.media import MediaController from openlp.core.ui.printserviceform import PrintServiceForm -from openlp.core.projectors import ProjectorManager from openlp.core.ui.style import PROGRESSBAR_STYLE, get_library_stylesheet from openlp.core.version import get_version @@ -375,7 +375,7 @@ class Ui_MainWindow(object): self.media_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Library')) 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.projector_manager_dock.setWindowTitle(translate('OpenLP.MainWindow', 'Projector Controller')) self.file_new_item.setText(translate('OpenLP.MainWindow', '&New Service')) self.file_new_item.setToolTip(UiStrings().NewService) self.file_new_item.setStatusTip(UiStrings().CreateService) @@ -407,7 +407,7 @@ class Ui_MainWindow(object): translate('OpenLP.MainWindow', 'Import settings from a *.config file previously exported from ' 'this or another machine.')) self.settings_import_item.setText(translate('OpenLP.MainWindow', 'Settings')) - self.view_projector_manager_item.setText(translate('OpenLP.MainWindow', '&Projectors')) + self.view_projector_manager_item.setText(translate('OpenLP.MainWindow', '&Projector Controller')) self.view_projector_manager_item.setToolTip(translate('OpenLP.MainWindow', 'Hide or show Projectors.')) self.view_projector_manager_item.setStatusTip(translate('OpenLP.MainWindow', 'Toggle visibility of the Projectors.')) diff --git a/openlp/core/ui/settingsform.py b/openlp/core/ui/settingsform.py index 54bd01935..4d7c4ff6c 100644 --- a/openlp/core/ui/settingsform.py +++ b/openlp/core/ui/settingsform.py @@ -30,9 +30,9 @@ from openlp.core.api import ApiTab 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.media import PlayerTab -from openlp.core.projectors import ProjectorTab from openlp.core.ui.settingsdialog import Ui_SettingsDialog log = logging.getLogger(__name__) diff --git a/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py b/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py index 8c0c17955..75b32d8c1 100644 --- a/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py +++ b/tests/functional/openlp_core/projectors/test_projector_pjlink_base.py @@ -25,8 +25,9 @@ Package to test the openlp.core.projectors.pjlink base package. from unittest import TestCase from unittest.mock import call, patch, MagicMock -from openlp.core.projectors import PJLink, Projector from openlp.core.projectors.constants import E_PARAMETER, ERROR_STRING, S_ON, S_CONNECTED +from openlp.core.projectors.db import Projector +from openlp.core.projectors.pjlink import PJLink from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_CONNECT_AUTHENTICATE, TEST_HASH, TEST1_DATA diff --git a/tests/functional/openlp_core/projectors/test_projector_pjlink_cmd_routing.py b/tests/functional/openlp_core/projectors/test_projector_pjlink_cmd_routing.py index 92dd24f82..431da0606 100644 --- a/tests/functional/openlp_core/projectors/test_projector_pjlink_cmd_routing.py +++ b/tests/functional/openlp_core/projectors/test_projector_pjlink_cmd_routing.py @@ -27,9 +27,10 @@ from unittest import TestCase from unittest.mock import patch, MagicMock import openlp.core.projectors.pjlink -from openlp.core.projectors import PJLink, Projector from openlp.core.projectors.constants import PJLINK_ERRORS, \ E_AUTHENTICATION, E_PARAMETER, E_PROJECTOR, E_UNAVAILABLE, E_UNDEFINED +from openlp.core.projectors.db import Projector +from openlp.core.projectors.pjlink import PJLink ''' from openlp.core.projectors.constants import ERROR_STRING, PJLINK_ERST_DATA, PJLINK_ERST_STATUS, \ diff --git a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands.py b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands.py index 4907005ee..584b63cf9 100644 --- a/tests/functional/openlp_core/projectors/test_projector_pjlink_commands.py +++ b/tests/functional/openlp_core/projectors/test_projector_pjlink_commands.py @@ -26,11 +26,12 @@ from unittest import TestCase from unittest.mock import patch import openlp.core.projectors.pjlink -from openlp.core.projectors import PJLink, Projector from openlp.core.projectors.constants import ERROR_STRING, PJLINK_ERST_DATA, PJLINK_ERST_STATUS, \ PJLINK_POWR_STATUS, \ E_ERROR, E_NOT_CONNECTED, E_SOCKET_ADDRESS_NOT_AVAILABLE, E_UNKNOWN_SOCKET_ERROR, E_WARN, \ S_CONNECTED, S_OFF, S_ON, S_NOT_CONNECTED, S_CONNECTING, S_STANDBY +from openlp.core.projectors.db import Projector +from openlp.core.projectors.pjlink import PJLink from tests.resources.projector.data import TEST_PIN, TEST1_DATA diff --git a/tests/interfaces/openlp_core/ui/test_projectoreditform.py b/tests/interfaces/openlp_core/ui/test_projectoreditform.py index 3f328cb04..ec2539a29 100644 --- a/tests/interfaces/openlp_core/ui/test_projectoreditform.py +++ b/tests/interfaces/openlp_core/ui/test_projectoreditform.py @@ -28,7 +28,9 @@ from unittest import TestCase from unittest.mock import patch from openlp.core.common.registry import Registry -from openlp.core.projectors import Projector, ProjectorDB, ProjectorEditForm, ProjectorManager +from openlp.core.projectors.db import Projector, ProjectorDB +from openlp.core.projectors.editform import ProjectorEditForm +from openlp.core.projectors.manager import ProjectorManager from tests.helpers.testmixin import TestMixin from tests.resources.projector.data import TEST_DB, TEST1_DATA, TEST2_DATA diff --git a/tests/interfaces/openlp_core/ui/test_projectormanager.py b/tests/interfaces/openlp_core/ui/test_projectormanager.py index e26a5cfe2..484d4d68a 100644 --- a/tests/interfaces/openlp_core/ui/test_projectormanager.py +++ b/tests/interfaces/openlp_core/ui/test_projectormanager.py @@ -27,7 +27,9 @@ from unittest import TestCase from unittest.mock import patch, MagicMock from openlp.core.common.registry import Registry -from openlp.core.projectors import ProjectorDB, ProjectorEditForm, ProjectorManager +from openlp.core.projectors.db import ProjectorDB +from openlp.core.projectors.editform import ProjectorEditForm +from openlp.core.projectors.manager import ProjectorManager from tests.helpers.testmixin import TestMixin from tests.resources.projector.data import TEST_DB