forked from openlp/openlp
Added oxps as supported presentation filetype (by mudraw)
This commit is contained in:
parent
a8a7068de8
commit
2b9d36702b
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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')
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user