← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~j-corwin/openlp/present into lp:openlp

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/present into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #598361 in OpenLP: "AttributeError: 'NoneType' object has no attribute 'isPaused'"
  https://bugs.launchpad.net/openlp/+bug/598361
  Bug #608149 in OpenLP: "Presentations are not intuitive"
  https://bugs.launchpad.net/openlp/+bug/608149
  Bug #769513 in OpenLP: "traceback when going live with impress presentation"
  https://bugs.launchpad.net/openlp/+bug/769513
  Bug #773036 in OpenLP: "Invalid type when opening a powerpoint presentation"
  https://bugs.launchpad.net/openlp/+bug/773036

For more details, see:
https://code.launchpad.net/~j-corwin/openlp/present/+merge/59580

Fix bug 773036 - Presentation file extension when > 1 "."
Fix bug 769513 - Impress 3.3 on Windows fails to start 
-- 
https://code.launchpad.net/~j-corwin/openlp/present/+merge/59580
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/present into lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py	2011-03-28 18:56:39 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py	2011-04-30 07:47:29 +0000
@@ -219,7 +219,6 @@
         The file name of the presentatios to the run.
         """
         log.debug(u'Load Presentation OpenOffice')
-        #print "s.dsk1 ", self.desktop
         if os.name == u'nt':
             desktop = self.controller.get_com_desktop()
             if desktop is None:
@@ -234,7 +233,10 @@
             return False
         self.desktop = desktop
         properties = []
-        properties.append(self.create_property(u'Minimized', True))
+        if os.name != u'nt':
+            # Recent versions of Impress on Windows won't start the presentation
+            # if it starts as minimized. It seems OK on Linux though.
+            properties.append(self.create_property(u'Minimized', True))
         properties = tuple(properties)
         try:
             self.document = desktop.loadComponentFromURL(url, u'_blank',
@@ -242,6 +244,12 @@
         except:
             log.exception(u'Failed to load presentation %s' % url)
             return False
+        if os.name == u'nt':
+            # As we can't start minimized the Impress window gets in the way.
+            # Either window.setPosSize(0, 0, 200, 400, 12) or .setVisible(False)
+            window = self.document.getCurrentController().getFrame() \
+                .getContainerWindow()
+            window.setVisible(False)
         self.presentation = self.document.getPresentation()
         self.presentation.Display = \
             self.controller.plugin.renderer.screens.current_display + 1
@@ -387,14 +395,14 @@
         log.debug(u'start presentation OpenOffice')
         if self.control is None or not self.control.isRunning():
             self.presentation.start()
-            # start() returns before the getCurrentComponent is ready.
-            # Try for 5 seconds
+            self.control = self.presentation.getController()
+            # start() returns before the Component is ready.
+            # Try for 15 seconds
             i = 1
-            while self.desktop.getCurrentComponent() is None and i < 50:
+            while not self.control and i < 150:
                 time.sleep(0.1)
                 i = i + 1
-            self.control = \
-                self.desktop.getCurrentComponent().Presentation.getController()
+                self.control = self.presentation.getController()
         else:
             self.control.activate()
             self.goto_slide(1)
@@ -463,4 +471,4 @@
             shape = page.getByIndex(idx)
             if shape.supportsService("com.sun.star.drawing.Text"):
                 text += shape.getString() + '\n'
-        return text
\ No newline at end of file
+        return text

=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py	2011-04-29 08:45:36 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py	2011-04-30 07:47:29 +0000
@@ -293,7 +293,7 @@
         "supports" the extension. If none found, then look for a controller
         which "also supports" it instead.
         """
-        filetype = filename.split(u'.')[1]
+        filetype = os.path.splitext(filename)[1]
         if not filetype:
             return None
         for controller in self.controllers:


Follow ups