diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 5b503d50f..d85f71512 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -264,7 +264,7 @@ class PresentationMediaItem(MediaManagerItem): if not self.display_type_combo_box.currentText(): return False service_item.add_capability(ItemCapabilities.CanEditTitle) - if (file_type == 'pdf' or file_type == 'xps') and context != ServiceItemContext.Service: + if (file_type == 'pdf' or file_type == 'xps' or filetype == 'oxps') and context != ServiceItemContext.Service: service_item.add_capability(ItemCapabilities.CanMaintain) service_item.add_capability(ItemCapabilities.CanPreview) service_item.add_capability(ItemCapabilities.CanLoop) diff --git a/openlp/plugins/presentations/lib/messagelistener.py b/openlp/plugins/presentations/lib/messagelistener.py index ac115228a..d4275a189 100644 --- a/openlp/plugins/presentations/lib/messagelistener.py +++ b/openlp/plugins/presentations/lib/messagelistener.py @@ -320,10 +320,10 @@ class MessageListener(object): file = item.get_frame_path() self.handler = item.processor # When starting presentation from the servicemanager we convert - # PDF/XPS-serviceitems into image-serviceitems. When started from the mediamanager + # PDF/XPS/OXPS-serviceitems into image-serviceitems. When started from the mediamanager # the conversion has already been done at this point. - if file.endswith('.pdf') or file.endswith('.xps'): - log.debug('Converting from pdf/xps to images for serviceitem with file %s', file) + if file.endswith('.pdf') or file.endswith('xps'): + log.debug('Converting from pdf/xps/oxps to images for serviceitem with file %s', file) # Create a copy of the original item, and then clear the original item so it can be filled with images item_cpy = copy.copy(item) item.__init__(None) diff --git a/openlp/plugins/presentations/lib/pdfcontroller.py b/openlp/plugins/presentations/lib/pdfcontroller.py index 0283fefd4..7545aac1f 100644 --- a/openlp/plugins/presentations/lib/pdfcontroller.py +++ b/openlp/plugins/presentations/lib/pdfcontroller.py @@ -148,7 +148,7 @@ class PdfController(PresentationController): if os.path.isfile(os.path.join(application_path, 'mudraw')): self.mudrawbin = os.path.join(application_path, 'mudraw') if self.mudrawbin: - self.also_supports = ['xps'] + self.also_supports = ['xps', 'oxps'] return True elif self.gsbin: return True diff --git a/tests/functional/openlp_plugins/presentations/test_mediaitem.py b/tests/functional/openlp_plugins/presentations/test_mediaitem.py index 2210c7d1f..b826a4cae 100644 --- a/tests/functional/openlp_plugins/presentations/test_mediaitem.py +++ b/tests/functional/openlp_plugins/presentations/test_mediaitem.py @@ -71,7 +71,7 @@ class TestMediaItem(TestCase, TestMixin): pdf_controller = MagicMock() pdf_controller.enabled.return_value = True pdf_controller.supports = ['pdf'] - pdf_controller.also_supports = ['xps'] + pdf_controller.also_supports = ['xps', 'oxps'] # Mock the controllers. self.media_item.controllers = { 'Impress': impress_controller, @@ -90,3 +90,4 @@ class TestMediaItem(TestCase, TestMixin): self.assertIn('*.ppt', self.media_item.on_new_file_masks, 'The file mask should contain the ppt extension') self.assertIn('*.pdf', self.media_item.on_new_file_masks, 'The file mask should contain the pdf extension') self.assertIn('*.xps', self.media_item.on_new_file_masks, 'The file mask should contain the xps extension') + self.assertIn('*.oxps', self.media_item.on_new_file_masks, 'The file mask should contain the oxps extension') diff --git a/tests/interfaces/openlp_core_ui/test_slidecontroller.py b/tests/interfaces/openlp_core_ui/test_slidecontroller.py index efbc9368b..b797548a5 100644 --- a/tests/interfaces/openlp_core_ui/test_slidecontroller.py +++ b/tests/interfaces/openlp_core_ui/test_slidecontroller.py @@ -32,12 +32,10 @@ Package to test the openlp.core.ui.slidecontroller package. from PyQt4 import QtCore, QtTest from unittest import TestCase -from openlp.core import Registry -from openlp.core.lib import ServiceItemAction +from openlp.core.common import Registry from openlp.core.lib import ScreenList from openlp.core.ui import SlideController -from openlp.core.ui.slidecontroller import WIDE_MENU, NON_TEXT_MENU from tests.interfaces import MagicMock, patch from tests.helpers.testmixin import TestMixin