diff --git a/openlp/core/lib/__init__.py b/openlp/core/lib/__init__.py index 6e62bbf9c..e56cb0d61 100644 --- a/openlp/core/lib/__init__.py +++ b/openlp/core/lib/__init__.py @@ -312,12 +312,9 @@ def create_separated_list(string_list): return translate('OpenLP.core.lib', '%s, %s', 'Locale list separator: start') % (string_list[0], merged) -from .colorbutton import ColorButton from .exceptions import ValidationError from .filedialog import FileDialog from .screen import ScreenList -from .listwidgetwithdnd import ListWidgetWithDnD -from .treewidgetwithdnd import TreeWidgetWithDnD from .formattingtags import FormattingTags from .spelltextedit import SpellTextEdit from .plugin import PluginStatus, StringContent, Plugin @@ -325,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 .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 04df1d38a..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, ListWidgetWithDnD, \ - 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/__init__.py b/openlp/core/ui/__init__.py index c6777c756..599efd8e7 100644 --- a/openlp/core/ui/__init__.py +++ b/openlp/core/ui/__init__.py @@ -113,7 +113,6 @@ from .settingsform import SettingsForm from .formattingtagform import FormattingTagForm from .formattingtagcontroller import FormattingTagController from .shortcutlistform import ShortcutListForm -from .mediadockmanager import MediaDockManager from .servicemanager import ServiceManager from .thememanager import ThemeManager from .projector.manager import ProjectorManager @@ -121,7 +120,7 @@ from .projector.tab import ProjectorTab from .projector.editform import ProjectorEditForm __all__ = ['SplashScreen', 'AboutForm', 'SettingsForm', 'MainDisplay', 'SlideController', 'ServiceManager', 'ThemeForm', - 'ThemeManager', 'MediaDockManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', + 'ThemeManager', 'ServiceItemEditForm', 'FirstTimeForm', 'FirstTimeLanguageForm', 'Display', 'ServiceNoteForm', 'ThemeLayoutForm', 'FileRenameForm', 'StartTimeForm', 'MainDisplay', 'SlideController', 'DisplayController', 'GeneralTab', 'ThemesTab', 'AdvancedTab', 'PluginForm', 'FormattingTagForm', 'ShortcutListForm', 'FormattingTagController', 'SingleColumnTableWidget', diff --git a/openlp/core/ui/generaltab.py b/openlp/core/ui/generaltab.py index be2630b35..816e947ba 100644 --- a/openlp/core/ui/generaltab.py +++ b/openlp/core/ui/generaltab.py @@ -27,7 +27,8 @@ import logging from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import Registry, Settings, UiStrings, translate, get_images_filter -from openlp.core.lib import SettingsTab, ScreenList, ColorButton, build_icon +from openlp.core.lib import SettingsTab, ScreenList, build_icon +from openlp.core.ui.lib.colorbutton import ColorButton log = logging.getLogger(__name__) diff --git a/openlp/core/ui/lib/__init__.py b/openlp/core/ui/lib/__init__.py index 02bded5b0..6cdeac8a6 100644 --- a/openlp/core/ui/lib/__init__.py +++ b/openlp/core/ui/lib/__init__.py @@ -19,3 +19,15 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### + +from .colorbutton import ColorButton +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 + +__all__ = ['ColorButton', 'ListPreviewWidget', 'ListWidgetWithDnD', 'OpenLPToolbar', 'OpenLPDockWidget', + 'OpenLPWizard', 'WizardStrings', 'MediaDockManager', 'ListPreviewWidget'] diff --git a/openlp/core/lib/colorbutton.py b/openlp/core/ui/lib/colorbutton.py similarity index 100% rename from openlp/core/lib/colorbutton.py rename to openlp/core/ui/lib/colorbutton.py diff --git a/openlp/core/lib/dockwidget.py b/openlp/core/ui/lib/dockwidget.py similarity index 100% rename from openlp/core/lib/dockwidget.py rename to openlp/core/ui/lib/dockwidget.py diff --git a/openlp/core/ui/listpreviewwidget.py b/openlp/core/ui/lib/listpreviewwidget.py similarity index 100% rename from openlp/core/ui/listpreviewwidget.py rename to openlp/core/ui/lib/listpreviewwidget.py diff --git a/openlp/core/lib/listwidgetwithdnd.py b/openlp/core/ui/lib/listwidgetwithdnd.py similarity index 100% rename from openlp/core/lib/listwidgetwithdnd.py rename to openlp/core/ui/lib/listwidgetwithdnd.py diff --git a/openlp/core/ui/mediadockmanager.py b/openlp/core/ui/lib/mediadockmanager.py similarity index 100% rename from openlp/core/ui/mediadockmanager.py rename to openlp/core/ui/lib/mediadockmanager.py 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/wizard.py b/openlp/core/ui/lib/wizard.py similarity index 100% rename from openlp/core/ui/wizard.py rename to openlp/core/ui/lib/wizard.py diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ac3c19aa4..39e0ac518 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -38,15 +38,17 @@ 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 + ShortcutListForm, FormattingTagForm, PreviewController 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 +from openlp.core.ui.lib.mediadockmanager import MediaDockManager log = logging.getLogger(__name__) diff --git a/openlp/core/ui/media/mediacontroller.py b/openlp/core/ui/media/mediacontroller.py index 71e0f1903..021ea5281 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/media/playertab.py b/openlp/core/ui/media/playertab.py index ed34993ca..1fca21450 100644 --- a/openlp/core/ui/media/playertab.py +++ b/openlp/core/ui/media/playertab.py @@ -26,9 +26,10 @@ import platform from PyQt5 import QtCore, QtWidgets from openlp.core.common import Registry, Settings, UiStrings, translate -from openlp.core.lib import ColorButton, SettingsTab +from openlp.core.lib import SettingsTab from openlp.core.lib.ui import create_button from openlp.core.ui.media import get_media_players, set_media_players +from openlp.core.ui.lib.colorbutton import ColorButton class MediaQCheckBox(QtWidgets.QCheckBox): 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..ea2abe5fb 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -33,11 +33,14 @@ 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.lib.listpreviewwidget import ListPreviewWidget from openlp.core.ui import HideMode, MainDisplay, Display, DisplayControllerType -from openlp.core.ui.listpreviewwidget import ListPreviewWidget + # Threshold which has to be trespassed to toggle. HIDE_MENU_THRESHOLD = 27 diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 20143ddaa..fc231a859 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -31,6 +31,7 @@ from openlp.core.common import Registry, RegistryProperties, UiStrings, translat from openlp.core.lib.theme import BackgroundType, BackgroundGradientType from openlp.core.lib.ui import critical_error_message_box from openlp.core.ui import ThemeLayoutForm +from openlp.core.ui.lib.colorbutton import ColorButton from .themewizard import Ui_ThemeWizard log = logging.getLogger(__name__) 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/core/ui/themewizard.py b/openlp/core/ui/themewizard.py index b041a0905..ab8854ef2 100644 --- a/openlp/core/ui/themewizard.py +++ b/openlp/core/ui/themewizard.py @@ -25,9 +25,10 @@ The Create/Edit theme wizard from PyQt5 import QtCore, QtGui, QtWidgets from openlp.core.common import UiStrings, translate, is_macosx -from openlp.core.lib import build_icon, ColorButton +from openlp.core.lib import build_icon from openlp.core.lib.theme import HorizontalType, BackgroundType, BackgroundGradientType from openlp.core.lib.ui import add_welcome_page, create_valign_selection_widgets +from openlp.core.ui.lib.colorbutton import ColorButton class Ui_ThemeWizard(object): diff --git a/openlp/plugins/alerts/lib/alertstab.py b/openlp/plugins/alerts/lib/alertstab.py index 2875493b6..2859a71ce 100644 --- a/openlp/plugins/alerts/lib/alertstab.py +++ b/openlp/plugins/alerts/lib/alertstab.py @@ -23,8 +23,9 @@ from PyQt5 import QtGui, QtWidgets from openlp.core.common import Settings, UiStrings, translate -from openlp.core.lib import ColorButton, SettingsTab +from openlp.core.lib import SettingsTab from openlp.core.lib.ui import create_valign_selection_widgets +from openlp.core.ui.lib.colorbutton import ColorButton class AlertsTab(SettingsTab): diff --git a/openlp/plugins/bibles/forms/bibleimportform.py b/openlp/plugins/bibles/forms/bibleimportform.py index 27dbea963..45efe0e5f 100644 --- a/openlp/plugins/bibles/forms/bibleimportform.py +++ b/openlp/plugins/bibles/forms/bibleimportform.py @@ -31,7 +31,7 @@ from PyQt5 import QtWidgets from openlp.core.common import AppLocation, Settings, UiStrings, translate, clean_filename from openlp.core.lib.db import delete_database from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard, WizardStrings +from openlp.core.ui.lib.wizard import OpenLPWizard, WizardStrings from openlp.core.common.languagemanager import get_locale_key from openlp.plugins.bibles.lib.manager import BibleFormat from openlp.plugins.bibles.lib.db import BiblesResourcesDB, clean_filename diff --git a/openlp/plugins/bibles/forms/bibleupgradeform.py b/openlp/plugins/bibles/forms/bibleupgradeform.py index 611e6ead3..11771e9aa 100644 --- a/openlp/plugins/bibles/forms/bibleupgradeform.py +++ b/openlp/plugins/bibles/forms/bibleupgradeform.py @@ -32,7 +32,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import Registry, AppLocation, UiStrings, Settings, check_directory_exists, translate, \ delete_file from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard, WizardStrings +from openlp.core.ui.lib.wizard import OpenLPWizard, WizardStrings from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta, OldBibleDB, BiblesResourcesDB from openlp.plugins.bibles.lib.http import BSExtract, BGExtract, CWExtract diff --git a/openlp/plugins/images/lib/imagetab.py b/openlp/plugins/images/lib/imagetab.py index 80578dc56..2cc6776b1 100644 --- a/openlp/plugins/images/lib/imagetab.py +++ b/openlp/plugins/images/lib/imagetab.py @@ -23,7 +23,8 @@ from PyQt5 import QtWidgets from openlp.core.common import Settings, UiStrings, translate -from openlp.core.lib import ColorButton, SettingsTab +from openlp.core.lib import SettingsTab +from openlp.core.ui.lib.colorbutton import ColorButton class ImageTab(SettingsTab): 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/openlp/plugins/songs/forms/duplicatesongremovalform.py b/openlp/plugins/songs/forms/duplicatesongremovalform.py index 0fa4ee670..26de9507f 100644 --- a/openlp/plugins/songs/forms/duplicatesongremovalform.py +++ b/openlp/plugins/songs/forms/duplicatesongremovalform.py @@ -30,7 +30,7 @@ import os from PyQt5 import QtCore, QtWidgets from openlp.core.common import Registry, RegistryProperties, translate -from openlp.core.ui.wizard import OpenLPWizard, WizardStrings +from openlp.core.ui.lib.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib import delete_song from openlp.plugins.songs.lib.db import Song, MediaFile from openlp.plugins.songs.forms.songreviewwidget import SongReviewWidget diff --git a/openlp/plugins/songs/forms/songexportform.py b/openlp/plugins/songs/forms/songexportform.py index ee35ea7e5..ba8e2738a 100644 --- a/openlp/plugins/songs/forms/songexportform.py +++ b/openlp/plugins/songs/forms/songexportform.py @@ -30,7 +30,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import Registry, UiStrings, translate from openlp.core.lib import create_separated_list, build_icon from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard, WizardStrings +from openlp.core.ui.lib.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.db import Song from openlp.plugins.songs.lib.openlyricsexport import OpenLyricsExport diff --git a/openlp/plugins/songs/forms/songimportform.py b/openlp/plugins/songs/forms/songimportform.py index 9058324fc..7a6af3981 100644 --- a/openlp/plugins/songs/forms/songimportform.py +++ b/openlp/plugins/songs/forms/songimportform.py @@ -31,7 +31,7 @@ from PyQt5 import QtCore, QtWidgets from openlp.core.common import RegistryProperties, Settings, UiStrings, translate from openlp.core.lib import FileDialog from openlp.core.lib.ui import critical_error_message_box -from openlp.core.ui.wizard import OpenLPWizard, WizardStrings +from openlp.core.ui.lib.wizard import OpenLPWizard, WizardStrings from openlp.plugins.songs.lib.importer import SongFormat, SongFormatSelect log = logging.getLogger(__name__) diff --git a/openlp/plugins/songs/lib/importer.py b/openlp/plugins/songs/lib/importer.py index 47f6edb46..7b9101306 100644 --- a/openlp/plugins/songs/lib/importer.py +++ b/openlp/plugins/songs/lib/importer.py @@ -26,7 +26,7 @@ import os import logging from openlp.core.common import translate, UiStrings, is_win -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from .importers.opensong import OpenSongImport from .importers.easyslides import EasySlidesImport from .importers.openlp import OpenLPSongImport diff --git a/openlp/plugins/songs/lib/importers/foilpresenter.py b/openlp/plugins/songs/lib/importers/foilpresenter.py index b1b12960a..061f50a9f 100644 --- a/openlp/plugins/songs/lib/importers/foilpresenter.py +++ b/openlp/plugins/songs/lib/importers/foilpresenter.py @@ -90,7 +90,7 @@ import os from lxml import etree, objectify from openlp.core.lib import translate -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from openlp.plugins.songs.lib import clean_song, VerseType from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.db import Author, Book, Song, Topic diff --git a/openlp/plugins/songs/lib/importers/openlp.py b/openlp/plugins/songs/lib/importers/openlp.py index b914ed1e1..e17fe138f 100644 --- a/openlp/plugins/songs/lib/importers/openlp.py +++ b/openlp/plugins/songs/lib/importers/openlp.py @@ -31,7 +31,7 @@ from sqlalchemy.orm.exc import UnmappedClassError from openlp.core.common import translate from openlp.core.lib.db import BaseModel -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from openlp.plugins.songs.lib import clean_song from openlp.plugins.songs.lib.db import Author, Book, Song, Topic, MediaFile from .songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/openlyrics.py b/openlp/plugins/songs/lib/importers/openlyrics.py index c7bde403a..f60023cdf 100644 --- a/openlp/plugins/songs/lib/importers/openlyrics.py +++ b/openlp/plugins/songs/lib/importers/openlyrics.py @@ -29,7 +29,7 @@ import os from lxml import etree -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from openlp.plugins.songs.lib.importers.songimport import SongImport from openlp.plugins.songs.lib.ui import SongStrings from openlp.plugins.songs.lib.openlyricsxml import OpenLyrics, OpenLyricsError diff --git a/openlp/plugins/songs/lib/importers/powerpraise.py b/openlp/plugins/songs/lib/importers/powerpraise.py index b93eed0fe..93a360542 100644 --- a/openlp/plugins/songs/lib/importers/powerpraise.py +++ b/openlp/plugins/songs/lib/importers/powerpraise.py @@ -27,7 +27,7 @@ Powerpraise song files into the current database. import os from lxml import objectify -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from .songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/presentationmanager.py b/openlp/plugins/songs/lib/importers/presentationmanager.py index da31ce953..c26f11312 100644 --- a/openlp/plugins/songs/lib/importers/presentationmanager.py +++ b/openlp/plugins/songs/lib/importers/presentationmanager.py @@ -26,10 +26,11 @@ Presentationmanager song files into the current database. import os import re + import chardet from lxml import objectify, etree -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from .songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/propresenter.py b/openlp/plugins/songs/lib/importers/propresenter.py index cddf0e52b..55e05a08f 100644 --- a/openlp/plugins/songs/lib/importers/propresenter.py +++ b/openlp/plugins/songs/lib/importers/propresenter.py @@ -29,7 +29,7 @@ import base64 import logging from lxml import objectify -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from openlp.plugins.songs.lib import strip_rtf from .songimport import SongImport diff --git a/openlp/plugins/songs/lib/importers/songimport.py b/openlp/plugins/songs/lib/importers/songimport.py index 54c82da29..835386b26 100644 --- a/openlp/plugins/songs/lib/importers/songimport.py +++ b/openlp/plugins/songs/lib/importers/songimport.py @@ -28,7 +28,7 @@ import os from PyQt5 import QtCore from openlp.core.common import Registry, AppLocation, check_directory_exists, translate -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from openlp.plugins.songs.lib import clean_song, VerseType from openlp.plugins.songs.lib.db import Song, Author, Topic, Book, MediaFile from openlp.plugins.songs.lib.ui import SongStrings diff --git a/openlp/plugins/songs/lib/importers/songshowplus.py b/openlp/plugins/songs/lib/importers/songshowplus.py index 4851894ab..d9a205e22 100644 --- a/openlp/plugins/songs/lib/importers/songshowplus.py +++ b/openlp/plugins/songs/lib/importers/songshowplus.py @@ -29,7 +29,7 @@ import logging import re import struct -from openlp.core.ui.wizard import WizardStrings +from openlp.core.ui.lib.wizard import WizardStrings from openlp.plugins.songs.lib import VerseType, retrieve_windows_encoding from openlp.plugins.songs.lib.importers.songimport import SongImport diff --git a/tests/functional/openlp_core_common/test_projector_utilities.py b/tests/functional/openlp_core_common/test_projector_utilities.py index d29267de0..aebdd7509 100644 --- a/tests/functional/openlp_core_common/test_projector_utilities.py +++ b/tests/functional/openlp_core_common/test_projector_utilities.py @@ -23,13 +23,12 @@ Package to test the openlp.core.ui.projector.networkutils package. """ -import os - from unittest import TestCase from openlp.core.common import verify_ip_address, md5_hash, qmd5_hash from tests.resources.projector.data import TEST_PIN, TEST_SALT, TEST_HASH + salt = TEST_SALT pin = TEST_PIN test_hash = TEST_HASH diff --git a/tests/functional/openlp_core_ui_lib/__init__.py b/tests/functional/openlp_core_ui_lib/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/functional/openlp_core_lib/test_color_button.py b/tests/functional/openlp_core_ui_lib/test_color_button.py similarity index 90% rename from tests/functional/openlp_core_lib/test_color_button.py rename to tests/functional/openlp_core_ui_lib/test_color_button.py index ea71b3bf9..b65b81448 100644 --- a/tests/functional/openlp_core_lib/test_color_button.py +++ b/tests/functional/openlp_core_ui_lib/test_color_button.py @@ -24,7 +24,7 @@ This module contains tests for the openlp.core.lib.filedialog module """ from unittest import TestCase -from openlp.core.lib.colorbutton import ColorButton +from openlp.core.ui.lib.colorbutton import ColorButton from tests.functional import MagicMock, call, patch @@ -33,11 +33,11 @@ class TestColorDialog(TestCase): Test the :class:`~openlp.core.lib.colorbutton.ColorButton` class """ def setUp(self): - self.change_color_patcher = patch('openlp.core.lib.colorbutton.ColorButton.change_color') - self.clicked_patcher = patch('openlp.core.lib.colorbutton.ColorButton.clicked') - self.color_changed_patcher = patch('openlp.core.lib.colorbutton.ColorButton.colorChanged') - self.qt_gui_patcher = patch('openlp.core.lib.colorbutton.QtWidgets') - self.translate_patcher = patch('openlp.core.lib.colorbutton.translate', **{'return_value': 'Tool Tip Text'}) + self.change_color_patcher = patch('openlp.core.ui.lib.colorbutton.ColorButton.change_color') + self.clicked_patcher = patch('openlp.core.ui.lib.colorbutton.ColorButton.clicked') + self.color_changed_patcher = patch('openlp.core.ui.lib.colorbutton.ColorButton.colorChanged') + self.qt_gui_patcher = patch('openlp.core.ui.lib.colorbutton.QtWidgets') + self.translate_patcher = patch('openlp.core.ui.lib.colorbutton.translate', **{'return_value': 'Tool Tip Text'}) self.addCleanup(self.change_color_patcher.stop) self.addCleanup(self.clicked_patcher.stop) self.addCleanup(self.color_changed_patcher.stop) @@ -55,7 +55,7 @@ class TestColorDialog(TestCase): """ # GIVEN: The ColorButton class, a mocked change_color, setToolTip methods and clicked signal - with patch('openlp.core.lib.colorbutton.ColorButton.setToolTip') as mocked_set_tool_tip: + with patch('openlp.core.ui.lib.colorbutton.ColorButton.setToolTip') as mocked_set_tool_tip: # WHEN: The ColorButton object is instantiated widget = ColorButton() @@ -74,7 +74,7 @@ class TestColorDialog(TestCase): self.change_color_patcher.stop() # GIVEN: An instance of the ColorButton object, and a mocked out setStyleSheet - with patch('openlp.core.lib.colorbutton.ColorButton.setStyleSheet') as mocked_set_style_sheet: + with patch('openlp.core.ui.lib.colorbutton.ColorButton.setStyleSheet') as mocked_set_style_sheet: widget = ColorButton() # WHEN: Changing the color @@ -123,7 +123,7 @@ class TestColorDialog(TestCase): """ # GIVEN: An instance of ColorButton, with a mocked __init__ - with patch('openlp.core.lib.colorbutton.ColorButton.__init__', **{'return_value': None}): + with patch('openlp.core.ui.lib.colorbutton.ColorButton.__init__', **{'return_value': None}): widget = ColorButton() # WHEN: Setting the color property diff --git a/tests/functional/openlp_core_ui/test_listpreviewwidget.py b/tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py similarity index 87% rename from tests/functional/openlp_core_ui/test_listpreviewwidget.py rename to tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py index e9f99a8eb..0ed88cc88 100644 --- a/tests/functional/openlp_core_ui/test_listpreviewwidget.py +++ b/tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py @@ -20,12 +20,12 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ -Package to test the openlp.core.ui.listpreviewwidget package. +Package to test the openlp.core.ui.lib.listpreviewwidget package. """ from unittest import TestCase from openlp.core.common import Settings -from openlp.core.ui.listpreviewwidget import ListPreviewWidget +from openlp.core.ui.lib.listpreviewwidget import ListPreviewWidget from openlp.core.lib import ServiceItem from tests.functional import MagicMock, patch, call @@ -38,13 +38,13 @@ class TestListPreviewWidget(TestCase): Mock out stuff for all the tests """ # Mock self.parent().width() - self.parent_patcher = patch('openlp.core.ui.listpreviewwidget.ListPreviewWidget.parent') + self.parent_patcher = patch('openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.parent') self.mocked_parent = self.parent_patcher.start() self.mocked_parent.width.return_value = 100 self.addCleanup(self.parent_patcher.stop) # Mock Settings().value() - self.Settings_patcher = patch('openlp.core.ui.listpreviewwidget.Settings') + self.Settings_patcher = patch('openlp.core.ui.lib.listpreviewwidget.Settings') self.mocked_Settings = self.Settings_patcher.start() self.mocked_Settings_obj = MagicMock() self.mocked_Settings_obj.value.return_value = None @@ -52,7 +52,7 @@ class TestListPreviewWidget(TestCase): self.addCleanup(self.Settings_patcher.stop) # Mock self.viewport().width() - self.viewport_patcher = patch('openlp.core.ui.listpreviewwidget.ListPreviewWidget.viewport') + self.viewport_patcher = patch('openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.viewport') self.mocked_viewport = self.viewport_patcher.start() self.mocked_viewport_obj = MagicMock() self.mocked_viewport_obj.width.return_value = 200 @@ -72,8 +72,8 @@ class TestListPreviewWidget(TestCase): self.assertIsNotNone(list_preview_widget, 'The ListPreviewWidget object should not be None') self.assertEquals(list_preview_widget.screen_ratio, 1, 'Should not be called') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.setRowHeight') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') def replace_recalculate_layout_test_text(self, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, txt slides unchanged in replace_service_item & __recalc... @@ -104,8 +104,8 @@ class TestListPreviewWidget(TestCase): self.assertEquals(mocked_resizeRowsToContents.call_count, 2, 'Should be called') self.assertEquals(mocked_setRowHeight.call_count, 0, 'Should not be called') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.setRowHeight') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') def replace_recalculate_layout_test_img(self, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." disabled, img slides unchanged in replace_service_item & __recalc... @@ -140,8 +140,8 @@ class TestListPreviewWidget(TestCase): calls = [call(0, 200), call(1, 200), call(0, 400), call(1, 400), call(0, 400), call(1, 400)] mocked_setRowHeight.assert_has_calls(calls) - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.setRowHeight') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') def replace_recalculate_layout_test_img_max(self, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, img slides resized in replace_service_item & __recalc... @@ -174,9 +174,9 @@ class TestListPreviewWidget(TestCase): calls = [call(0, 100), call(1, 100), call(0, 100), call(1, 100)] mocked_setRowHeight.assert_has_calls(calls) - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.setRowHeight') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.cellWidget') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') def row_resized_test_text(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, text-based slides not affected in row_resized. @@ -208,9 +208,9 @@ class TestListPreviewWidget(TestCase): # THEN: self.cellWidget(row, 0).children()[1].setMaximumWidth() should not be called self.assertEquals(mocked_cellWidget_child.setMaximumWidth.call_count, 0, 'Should not be called') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.setRowHeight') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.cellWidget') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') def row_resized_test_img(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." disabled, image-based slides not affected in row_resized. @@ -244,9 +244,9 @@ class TestListPreviewWidget(TestCase): # THEN: self.cellWidget(row, 0).children()[1].setMaximumWidth() should not be called self.assertEquals(mocked_cellWidget_child.setMaximumWidth.call_count, 0, 'Should not be called') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.setRowHeight') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.cellWidget') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') def row_resized_test_img_max(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): """ Test if "Max height for non-text slides..." enabled, image-based slides are scaled in row_resized. @@ -278,10 +278,10 @@ class TestListPreviewWidget(TestCase): # THEN: self.cellWidget(row, 0).children()[1].setMaximumWidth() should be called mocked_cellWidget_child.setMaximumWidth.assert_called_once_with(150) - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.selectRow') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.scrollToItem') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.item') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.slide_count') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.selectRow') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') def autoscroll_test_setting_invalid(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): """ Test if 'advanced/autoscrolling' setting None or invalid, that no autoscrolling occurs on change_slide(). @@ -314,10 +314,10 @@ class TestListPreviewWidget(TestCase): self.assertEquals(mocked_selectRow.call_count, 0, 'Should not be called') self.assertEquals(mocked_item.call_count, 0, 'Should not be called') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.selectRow') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.scrollToItem') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.item') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.slide_count') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.selectRow') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') def autoscroll_test_dist_bounds(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): """ Test if 'advanced/autoscrolling' setting asks to scroll beyond list bounds, that it does not beyond. @@ -344,10 +344,10 @@ class TestListPreviewWidget(TestCase): calls = [call(0, 0), call(0, 0)] mocked_item.assert_has_calls(calls) - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.selectRow') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.scrollToItem') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.item') - @patch(u'openlp.core.ui.listpreviewwidget.ListPreviewWidget.slide_count') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.selectRow') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') + @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.slide_count') def autoscroll_test_normal(self, mocked_slide_count, mocked_item, mocked_scrollToItem, mocked_selectRow): """ Test if 'advanced/autoscrolling' setting valid, autoscrolling called as expected. diff --git a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py b/tests/interfaces/openlp_core_ui_lib/test_listpreviewwidget.py similarity index 95% rename from tests/interfaces/openlp_core_ui/test_listpreviewwidget.py rename to tests/interfaces/openlp_core_ui_lib/test_listpreviewwidget.py index b4e5fdbf0..3e0e48e8b 100644 --- a/tests/interfaces/openlp_core_ui/test_listpreviewwidget.py +++ b/tests/interfaces/openlp_core_ui_lib/test_listpreviewwidget.py @@ -20,7 +20,7 @@ # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### """ - Package to test the openlp.core.ui.listpreviewwidget. + Package to test the openlp.core.ui.lib.listpreviewwidget. """ from unittest import TestCase @@ -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 import ListWidgetWithDnD, ListPreviewWidget from tests.interfaces import MagicMock, patch from tests.utils.osdinteraction import read_service_from_file from tests.helpers.testmixin import TestMixin @@ -48,7 +48,7 @@ class TestListPreviewWidget(TestCase, TestMixin): self.image_manager = MagicMock() self.image_manager.get_image.return_value = self.image Registry().register('image_manager', self.image_manager) - self.preview_widget = listpreviewwidget.ListPreviewWidget(self.main_window, 2) + self.preview_widget = ListPreviewWidget(self.main_window, 2) def tearDown(self): """