forked from openlp/openlp
Added Pyro4 to appveyor to make the latest tests run. Fixed test on windows by mocking out render. Missed a rename of _write_theme to save_theme. Loading VLC module can also result in an OSError. Set the default value of core/display_on_monitor to False to avoid blocking the screen with the display window on first start. Set song import/export default directory to None. Add a webengine view for previewing themes. Made VLC loading more robust. A few minor fixes.
bzr-revno: 2879
This commit is contained in:
commit
0653f2d64f
@ -130,9 +130,6 @@ class Settings(QtCore.QSettings):
|
||||
``advanced/slide limits`` to ``SlideLimits.Wrap``. **NOTE**, this means that the rules have to cover all cases!
|
||||
So, if the type of the old value is bool, then there must be two rules.
|
||||
"""
|
||||
on_monitor_default = True
|
||||
if log.isEnabledFor(logging.DEBUG):
|
||||
on_monitor_default = False
|
||||
__default_settings__ = {
|
||||
'settings/version': 0,
|
||||
'advanced/add page break': False,
|
||||
@ -205,7 +202,7 @@ class Settings(QtCore.QSettings):
|
||||
'core/view mode': 'default',
|
||||
# The other display settings (display position and dimensions) are defined in the ScreenList class due to a
|
||||
# circular dependency.
|
||||
'core/display on monitor': on_monitor_default,
|
||||
'core/display on monitor': False,
|
||||
'core/override position': False,
|
||||
'core/monitor': {},
|
||||
'core/application version': '0.0',
|
||||
|
@ -65,7 +65,7 @@ def get_vlc():
|
||||
if 'vlc' not in sys.modules:
|
||||
try:
|
||||
import vlc # noqa module is not used directly, but is used via sys.modules['vlc']
|
||||
except ImportError:
|
||||
except (ImportError, OSError):
|
||||
return None
|
||||
# Verify that VLC is also loadable
|
||||
is_vlc_available = False
|
||||
|
@ -173,7 +173,7 @@ class ThemeManager(QtWidgets.QWidget, RegistryBase, Ui_ThemeManager, LogMixin, R
|
||||
for xml_file_path in xml_file_paths:
|
||||
theme_data = get_text_file_string(xml_file_path)
|
||||
theme = self._create_theme_from_xml(theme_data, self.theme_path)
|
||||
self._write_theme(theme)
|
||||
self.save_theme(theme)
|
||||
xml_file_path.unlink()
|
||||
|
||||
def build_theme_path(self):
|
||||
|
@ -66,8 +66,8 @@ __default_settings__ = {
|
||||
'songs/add song from service': True,
|
||||
'songs/add songbook slide': False,
|
||||
'songs/display songbar': True,
|
||||
'songs/last directory import': '',
|
||||
'songs/last directory export': '',
|
||||
'songs/last directory import': None,
|
||||
'songs/last directory export': None,
|
||||
'songs/songselect username': '',
|
||||
'songs/songselect password': '',
|
||||
'songs/songselect searches': '',
|
||||
|
@ -18,7 +18,7 @@ environment:
|
||||
|
||||
install:
|
||||
# Install dependencies from pypi
|
||||
- "%PYTHON%\\python.exe -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc"
|
||||
- "%PYTHON%\\python.exe -m pip install sqlalchemy alembic appdirs chardet beautifulsoup4 lxml Mako mysql-connector-python pytest mock pyodbc psycopg2 pypiwin32 websockets asyncio waitress six webob requests QtAwesome PyQt5 PyQtWebEngine pymediainfo PyMuPDF QDarkStyle python-vlc Pyro4"
|
||||
|
||||
build: off
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
Interface tests to test the ThemeWizard class and related methods.
|
||||
"""
|
||||
from unittest import TestCase
|
||||
from unittest.mock import patch
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
from openlp.core.common.registry import Registry
|
||||
from openlp.core.ui.themeform import ThemeForm
|
||||
@ -39,6 +39,8 @@ class TestThemeManager(TestCase, TestMixin):
|
||||
Create the UI
|
||||
"""
|
||||
Registry.create()
|
||||
mocked_renderer = MagicMock()
|
||||
Registry().register('renderer', mocked_renderer)
|
||||
|
||||
@patch('openlp.core.display.window.QtWidgets.QVBoxLayout')
|
||||
def test_create_theme_wizard(self, mocked_qvboxlayout):
|
||||
|
Loading…
Reference in New Issue
Block a user