forked from openlp/openlp
Finish moving things around
bzr-revno: 2649
This commit is contained in:
commit
071a4438e9
@ -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
|
||||
|
@ -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__)
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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__)
|
||||
|
||||
|
@ -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']
|
||||
|
@ -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__)
|
||||
|
||||
|
@ -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__)
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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 *
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -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__)
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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__)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
0
tests/functional/openlp_core_ui_lib/__init__.py
Normal file
0
tests/functional/openlp_core_ui_lib/__init__.py
Normal file
@ -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
|
@ -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.
|
@ -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):
|
||||
"""
|
Loading…
Reference in New Issue
Block a user