← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~tomasgroth/openlp/bugfixes8 into lp:openlp

 

Tomas Groth has proposed merging lp:~tomasgroth/openlp/bugfixes8 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1088800 in OpenLP: "Macro enabled presentations are not shown in OpenLP"
  https://bugs.launchpad.net/openlp/+bug/1088800
  Bug #1215302 in OpenLP: "Add .divx to list of video extensions"
  https://bugs.launchpad.net/openlp/+bug/1215302
  Bug #1396958 in OpenLP: "Opensong import fails on windows"
  https://bugs.launchpad.net/openlp/+bug/1396958
  Bug #1397287 in OpenLP: "Crash when changing mediaplayer priority"
  https://bugs.launchpad.net/openlp/+bug/1397287

For more details, see:
https://code.launchpad.net/~tomasgroth/openlp/bugfixes8/+merge/243370

Allow removing functions in registry, and use it when registring MainDisplay. Fixes bug 1397287.
Added pptm as support file format for Powerpoint, Powerpoint Viewer and Libre/OpenOffice Impress. Fixes bug 1088800.
Added divx and xvid as supported files for VLC. Fixes bug 1215302.
Open opensong files in 'rb' mode. Fixes bug 1396958.
Fixed test_servicemanager crash on exit.
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~tomasgroth/openlp/bugfixes8 into lp:openlp.
=== modified file 'openlp/core/common/registry.py'
--- openlp/core/common/registry.py	2014-03-31 17:32:49 +0000
+++ openlp/core/common/registry.py	2014-12-02 10:05:48 +0000
@@ -126,10 +126,6 @@
         :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)
 

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2014-08-27 23:18:06 +0000
+++ openlp/core/ui/maindisplay.py	2014-12-02 10:05:48 +0000
@@ -157,6 +157,16 @@
             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

=== modified file 'openlp/core/ui/media/vlcplayer.py'
--- openlp/core/ui/media/vlcplayer.py	2014-11-01 11:09:10 +0000
+++ openlp/core/ui/media/vlcplayer.py	2014-12-02 10:05:48 +0000
@@ -77,6 +77,7 @@
     '*.asf', '*.wmv',
     '*.au',
     '*.avi',
+    '*.divx',
     '*.flv',
     '*.mov',
     '*.mp4', '*.m4v',
@@ -95,7 +96,8 @@
     '*.xa',
     '*.iso',
     '*.vob',
-    '*.webm'
+    '*.webm',
+    '*.xvid'
 ]
 
 

=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py	2014-09-22 21:19:02 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py	2014-12-02 10:05:48 +0000
@@ -85,7 +85,7 @@
         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

=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
--- openlp/plugins/presentations/lib/powerpointcontroller.py	2014-09-08 21:08:49 +0000
+++ openlp/plugins/presentations/lib/powerpointcontroller.py	2014-12-02 10:05:48 +0000
@@ -64,7 +64,7 @@
         """
         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):

=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py	2014-10-27 10:37:22 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py	2014-12-02 10:05:48 +0000
@@ -63,7 +63,7 @@
         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):
         """

=== modified file 'openlp/plugins/songs/lib/importers/opensong.py'
--- openlp/plugins/songs/lib/importers/opensong.py	2014-07-04 09:31:06 +0000
+++ openlp/plugins/songs/lib/importers/opensong.py	2014-12-02 10:05:48 +0000
@@ -126,7 +126,7 @@
         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()
 

=== modified file 'tests/interfaces/openlp_core_ui/test_servicemanager.py'
--- tests/interfaces/openlp_core_ui/test_servicemanager.py	2014-10-22 20:43:05 +0000
+++ tests/interfaces/openlp_core_ui/test_servicemanager.py	2014-12-02 10:05:48 +0000
@@ -49,7 +49,17 @@
         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 @@
         """
         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):
         """


Follow ups