From bdeff60a9747171ec2e1da37afbaadcf7b49d1ec Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 17 Apr 2016 20:32:15 +0100 Subject: [PATCH] updates --- openlp/core/lib/__init__.py | 3 --- openlp/core/lib/mediamanageritem.py | 3 ++- openlp/core/ui/lib/__init__.py | 3 +++ openlp/core/{ => ui}/lib/toolbar.py | 0 openlp/core/{ => ui}/lib/treewidgetwithdnd.py | 0 openlp/core/ui/mainwindow.py | 5 +++-- openlp/core/ui/media/mediacontroller.py | 12 +++++++----- openlp/core/ui/projector/manager.py | 2 +- openlp/core/ui/servicemanager.py | 3 ++- openlp/core/ui/slidecontroller.py | 6 ++++-- openlp/core/ui/thememanager.py | 3 ++- openlp/plugins/images/lib/mediaitem.py | 5 +++-- .../test_listpreviewwidget.py | 2 +- 13 files changed, 28 insertions(+), 19 deletions(-) rename openlp/core/{ => ui}/lib/toolbar.py (100%) rename openlp/core/{ => ui}/lib/treewidgetwithdnd.py (100%) rename tests/interfaces/{openlp_core_ui => openlp_core_ui_lib}/test_listpreviewwidget.py (98%) diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index dd19e1033..e56cb0d61 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -315,7 +315,6 @@ def create_separated_list(string_list): from .exceptions import ValidationError from .filedialog import FileDialog from .screen import ScreenList -from .treewidgetwithdnd import TreeWidgetWithDnD from .formattingtags import FormattingTags from .spelltextedit import SpellTextEdit from .plugin import PluginStatus, StringContent, Plugin @@ -323,8 +322,6 @@ from .pluginmanager import PluginManager from .settingstab import SettingsTab from .serviceitem import ServiceItem, ServiceItemType, ItemCapabilities from .htmlbuilder import build_html, build_lyrics_format_css, build_lyrics_outline_css -from .toolbar import OpenLPToolbar -from openlp.core.ui.lib.dockwidget import OpenLPDockWidget from .imagemanager import ImageManager from .renderer import Renderer from .mediamanageritem import MediaManagerItem diff --git a/openlp/core/lib/mediamanageritem.py b/openlp/core/lib/mediamanageritem.py index ac0edfdf4..5af90c1b7 100644 --- a/openlp/core/lib/mediamanageritem.py +++ b/openlp/core/lib/mediamanageritem.py @@ -29,10 +29,11 @@ import re from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, RegistryProperties, Settings, UiStrings, translate -from openlp.core.lib import FileDialog, OpenLPToolbar, ServiceItem, StringContent, ServiceItemContext +from openlp.core.lib import FileDialog, ServiceItem, StringContent, ServiceItemContext from openlp.core.lib.searchedit import SearchEdit from openlp.core.lib.ui import create_widget_action, critical_error_message_box from openlp.core.ui.lib.listwidgetwithdnd import ListWidgetWithDnD +from openlp.core.ui.lib.toolbar import OpenLPToolbar log = logging.getLogger(__name__) diff --git a/openlp/core/ui/lib/__init__.py b/openlp/core/ui/lib/__init__.py index d7c67697f..8b8bd991d 100644 --- a/openlp/core/ui/lib/__init__.py +++ b/openlp/core/ui/lib/__init__.py @@ -22,3 +22,6 @@ from openlp.core.ui.lib.colorbutton import ColorButton from openlp.core.ui.lib.listwidgetwithdnd import ListWidgetWithDnD +from openlp.core.ui.lib.treewidgetwithdnd import TreeWidgetWithDnD +from openlp.core.ui.lib.toolbar import OpenLPToolbar +from openlp.core.ui.lib.dockwidget import OpenLPDockWidget \ No newline at end of file diff --git a/openlp/core/lib/toolbar.py b/openlp/core/ui/lib/toolbar.py similarity index 100% rename from openlp/core/lib/toolbar.py rename to openlp/core/ui/lib/toolbar.py diff --git a/openlp/core/lib/treewidgetwithdnd.py b/openlp/core/ui/lib/treewidgetwithdnd.py similarity index 100% rename from openlp/core/lib/treewidgetwithdnd.py rename to openlp/core/ui/lib/treewidgetwithdnd.py diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index 228969ad1..e586e6928 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -38,8 +38,7 @@ from openlp.core.common import Registry, RegistryProperties, AppLocation, Langua check_directory_exists, translate, is_win, is_macosx, add_actions from openlp.core.common.actions import ActionList, CategoryOrder from openlp.core.common.versionchecker import get_application_version -from openlp.core.lib import Renderer, OpenLPDockWidget, PluginManager, ImageManager, PluginStatus, ScreenList, \ - build_icon +from openlp.core.lib import Renderer, PluginManager, ImageManager, PluginStatus, ScreenList, build_icon from openlp.core.lib.ui import UiStrings, create_action from openlp.core.ui import AboutForm, SettingsForm, ServiceManager, ThemeManager, LiveController, PluginForm, \ MediaDockManager, ShortcutListForm, FormattingTagForm, PreviewController @@ -47,6 +46,8 @@ from openlp.core.ui.firsttimeform import FirstTimeForm from openlp.core.ui.media import MediaController from openlp.core.ui.printserviceform import PrintServiceForm from openlp.core.ui.projector.manager import ProjectorManager +from openlp.core.ui.lib.toolbar import OpenLPToolbar +from openlp.core.ui.lib.dockwidget import OpenLPDockWidget log = logging.getLogger(__name__) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index cf116e861..d95c51531 100644 --- a/openlp/core/ui/media/mediacontroller.py +++ b/openlp/core/ui/media/mediacontroller.py @@ -29,14 +29,16 @@ import datetime from PyQt5 import QtCore, QtWidgets from openlp.core.common import OpenLPMixin, Registry, RegistryMixin, RegistryProperties, Settings, UiStrings, translate -from openlp.core.lib import OpenLPToolbar, ItemCapabilities +from openlp.core.lib import ItemCapabilities from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players,\ - parse_optical_path -from openlp.core.ui.media.vendor.mediainfoWrapper import MediaInfoWrapper -from openlp.core.ui.media.mediaplayer import MediaPlayer from openlp.core.common import AppLocation from openlp.core.ui import DisplayControllerType +from openlp.core.ui.media.vendor.mediainfoWrapper import MediaInfoWrapper +from openlp.core.ui.media.mediaplayer import MediaPlayer +from openlp.core.ui.media import MediaState, MediaInfo, MediaType, get_media_players, set_media_players,\ + parse_optical_path +from openlp.core.ui.lib.toolbar import OpenLPToolbar +from openlp.core.ui.lib.dockwidget import OpenLPDockWidget log = logging.getLogger(__name__) diff --git a/openlp/core/ui/projector/manager.py b/openlp/core/ui/projector/manager.py index fc40ee386..8efe34b10 100644 --- a/openlp/core/ui/projector/manager.py +++ b/openlp/core/ui/projector/manager.py @@ -35,7 +35,7 @@ from PyQt5.QtWidgets import QWidget from openlp.core.common import RegistryProperties, Settings, OpenLPMixin, \ RegistryMixin, translate -from openlp.core.lib import OpenLPToolbar +from openlp.core.ui.lib import OpenLPToolbar from openlp.core.lib.ui import create_widget_action from openlp.core.lib.projector import DialogSourceStyle from openlp.core.lib.projector.constants import * diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index 66cbdf1b7..82b489344 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -35,9 +35,10 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, ThemeLevel, OpenLPMixin, \ RegistryMixin, check_directory_exists, UiStrings, translate, split_filename, delete_file from openlp.core.common.actions import ActionList, CategoryOrder -from openlp.core.lib import OpenLPToolbar, ServiceItem, ItemCapabilities, PluginStatus, build_icon +from openlp.core.lib import ServiceItem, ItemCapabilities, PluginStatus, build_icon 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.lib import OpenLPToolbar from openlp.core.common.languagemanager import format_time diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 96ce82868..7ec4bfe29 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -33,9 +33,11 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, RegistryProperties, Settings, SlideLimits, UiStrings, translate, \ RegistryMixin, OpenLPMixin from openlp.core.common.actions import ActionList, CategoryOrder -from openlp.core.lib import OpenLPToolbar, ItemCapabilities, ServiceItem, ImageSource, ServiceItemAction, \ - ScreenList, build_icon, build_html +from openlp.core.lib import ItemCapabilities, ServiceItem, ImageSource, ServiceItemAction, ScreenList, build_icon, \ + build_html from openlp.core.lib.ui import create_action +from openlp.core.ui.lib.toolbar import OpenLPToolbar +from openlp.core.ui.lib.dockwidget import OpenLPDockWidget from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType from openlp.core.ui.listpreviewwidget import ListPreviewWidget diff --git a/openlp/core/ui/thememanager.py b/openlp/core/ui/thememanager.py index bb8a1a8a7..32975e9aa 100644 --- a/openlp/core/ui/thememanager.py +++ b/openlp/core/ui/thememanager.py @@ -31,11 +31,12 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, RegistryProperties, AppLocation, Settings, OpenLPMixin, RegistryMixin, \ check_directory_exists, UiStrings, translate, is_win, get_filesystem_encoding, delete_file -from openlp.core.lib import FileDialog, ImageSource, OpenLPToolbar, ValidationError, get_text_file_string, build_icon, \ +from openlp.core.lib import FileDialog, ImageSource, ValidationError, get_text_file_string, build_icon, \ check_item_selected, create_thumb, validate_thumb from openlp.core.lib.theme import ThemeXML, BackgroundType from openlp.core.lib.ui import critical_error_message_box, create_widget_action from openlp.core.ui import FileRenameForm, ThemeForm +from openlp.core.ui.lib import OpenLPToolbar from openlp.core.common.languagemanager import get_locale_key diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index 80a49f81c..d127fba4b 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -27,9 +27,10 @@ from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, AppLocation, Settings, UiStrings, check_directory_exists, translate, \ delete_file, get_images_filter -from openlp.core.lib import ItemCapabilities, MediaManagerItem, ServiceItemContext, StringContent, TreeWidgetWithDnD,\ - build_icon, check_item_selected, create_thumb, validate_thumb +from openlp.core.lib import ItemCapabilities, MediaManagerItem, ServiceItemContext, StringContent, build_icon, \ + check_item_selected, create_thumb, validate_thumb from openlp.core.lib.ui import create_widget_action, critical_error_message_box +from openlp.core.ui.lib.treewidgetwithdnd import TreeWidgetWithDnD from openlp.core.common.languagemanager import get_locale_key from openlp.plugins.images.forms import AddGroupForm, ChooseGroupForm from openlp.plugins.images.lib.db import ImageFilenames, ImageGroups diff --git a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py b/tests/interfaces/openlp_core_ui_lib/test_listpreviewwidget.py similarity index 98% rename from tests/interfaces/openlp_core_ui/test_listpreviewwidget.py rename to tests/interfaces/openlp_core_ui_lib/test_listpreviewwidget.py index b4e5fdbf0..7c2a7f999 100644 --- a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py +++ b/tests/interfaces/openlp_core_ui_lib/test_listpreviewwidget.py @@ -29,7 +29,7 @@ from PyQt5 import QtGui, QtWidgets from openlp.core.common import Registry from openlp.core.lib import ServiceItem -from openlp.core.ui import listpreviewwidget +from openlp.core.ui.lib.listwidgetwithdnd import ListWidgetWithDnD from tests.interfaces import MagicMock, patch from tests.utils.osdinteraction import read_service_from_file from tests.helpers.testmixin import TestMixin