forked from openlp/openlp
trunk
This commit is contained in:
commit
782b3d3bcf
@ -126,10 +126,6 @@ class Registry(object):
|
||||
:param event: The function description..
|
||||
:param function: The function to be called when the event happens.
|
||||
"""
|
||||
if not self.running_under_test:
|
||||
trace_error_handler(log)
|
||||
log.error('Invalid Method call for key %s' % event)
|
||||
raise KeyError('Invalid Method call for key %s' % event)
|
||||
if event in self.functions_list:
|
||||
self.functions_list[event].remove(function)
|
||||
|
||||
|
@ -157,6 +157,16 @@ class MainDisplay(OpenLPMixin, Display, RegistryProperties):
|
||||
Registry().register_function('live_display_show', self.show_display)
|
||||
Registry().register_function('update_display_css', self.css_changed)
|
||||
|
||||
def close(self):
|
||||
"""
|
||||
Remove registered function on close.
|
||||
"""
|
||||
if self.is_live:
|
||||
Registry().remove_function('live_display_hide', self.hide_display)
|
||||
Registry().remove_function('live_display_show', self.show_display)
|
||||
Registry().remove_function('update_display_css', self.css_changed)
|
||||
super().close()
|
||||
|
||||
def set_transparency(self, enabled):
|
||||
"""
|
||||
Set the transparency of the window
|
||||
|
@ -77,6 +77,7 @@ VIDEO_EXT = [
|
||||
'*.asf', '*.wmv',
|
||||
'*.au',
|
||||
'*.avi',
|
||||
'*.divx',
|
||||
'*.flv',
|
||||
'*.mov',
|
||||
'*.mp4', '*.m4v',
|
||||
@ -95,7 +96,8 @@ VIDEO_EXT = [
|
||||
'*.xa',
|
||||
'*.iso',
|
||||
'*.vob',
|
||||
'*.webm'
|
||||
'*.webm',
|
||||
'*.xvid'
|
||||
]
|
||||
|
||||
|
||||
|
@ -85,7 +85,7 @@ class ImpressController(PresentationController):
|
||||
log.debug('Initialising')
|
||||
super(ImpressController, self).__init__(plugin, 'Impress', ImpressDocument)
|
||||
self.supports = ['odp']
|
||||
self.also_supports = ['ppt', 'pps', 'pptx', 'ppsx']
|
||||
self.also_supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm']
|
||||
self.process = None
|
||||
self.desktop = None
|
||||
self.manager = None
|
||||
|
@ -64,7 +64,7 @@ class PowerpointController(PresentationController):
|
||||
"""
|
||||
log.debug('Initialising')
|
||||
super(PowerpointController, self).__init__(plugin, 'Powerpoint', PowerpointDocument)
|
||||
self.supports = ['ppt', 'pps', 'pptx', 'ppsx']
|
||||
self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm']
|
||||
self.process = None
|
||||
|
||||
def check_available(self):
|
||||
|
@ -63,7 +63,7 @@ class PptviewController(PresentationController):
|
||||
log.debug('Initialising')
|
||||
self.process = None
|
||||
super(PptviewController, self).__init__(plugin, 'Powerpoint Viewer', PptviewDocument)
|
||||
self.supports = ['ppt', 'pps', 'pptx', 'ppsx']
|
||||
self.supports = ['ppt', 'pps', 'pptx', 'ppsx', 'pptm']
|
||||
|
||||
def check_available(self):
|
||||
"""
|
||||
|
@ -126,7 +126,7 @@ class OpenSongImport(SongImport):
|
||||
for filename in self.import_source:
|
||||
if self.stop_import_flag:
|
||||
return
|
||||
song_file = open(filename)
|
||||
song_file = open(filename, 'rb')
|
||||
self.do_import_file(song_file)
|
||||
song_file.close()
|
||||
|
||||
|
@ -49,7 +49,17 @@ class TestServiceManager(TestCase, TestMixin):
|
||||
self.setup_application()
|
||||
ScreenList.create(self.app.desktop())
|
||||
Registry().register('application', MagicMock())
|
||||
with patch('openlp.core.lib.PluginManager'):
|
||||
# Mock classes and methods used by mainwindow.
|
||||
with patch('openlp.core.ui.mainwindow.SettingsForm') as mocked_settings_form, \
|
||||
patch('openlp.core.ui.mainwindow.ImageManager') as mocked_image_manager, \
|
||||
patch('openlp.core.ui.mainwindow.LiveController') as mocked_live_controller, \
|
||||
patch('openlp.core.ui.mainwindow.PreviewController') as mocked_preview_controller, \
|
||||
patch('openlp.core.ui.mainwindow.OpenLPDockWidget') as mocked_dock_widget, \
|
||||
patch('openlp.core.ui.mainwindow.QtGui.QToolBox') as mocked_q_tool_box_class, \
|
||||
patch('openlp.core.ui.mainwindow.QtGui.QMainWindow.addDockWidget') as mocked_add_dock_method, \
|
||||
patch('openlp.core.ui.mainwindow.ThemeManager') as mocked_theme_manager, \
|
||||
patch('openlp.core.ui.mainwindow.ProjectorManager') as mocked_projector_manager, \
|
||||
patch('openlp.core.ui.mainwindow.Renderer') as mocked_renderer:
|
||||
self.main_window = MainWindow()
|
||||
self.service_manager = Registry().get('service_manager')
|
||||
|
||||
@ -57,6 +67,7 @@ class TestServiceManager(TestCase, TestMixin):
|
||||
"""
|
||||
Delete all the C++ objects at the end so that we don't have a segfault
|
||||
"""
|
||||
del self.main_window
|
||||
|
||||
def basic_service_manager_test(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user