← 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)


Handle closure of Impress during mid-presentation
-- 
https://code.launchpad.net/~j-corwin/openlp/present/+merge/13444
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py	2009-10-11 21:31:27 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py	2009-10-15 22:00:27 +0000
@@ -122,6 +122,7 @@
         if desktop is None:
             return
         try:
+            self.desktop = desktop
             properties = []
             properties = tuple(properties)            
             self.document = desktop.loadComponentFromURL(url, u'_blank',
@@ -218,9 +219,15 @@
             self.document = None
 
     def is_loaded(self):
-        return self.presentation is not None \
-            and self.document is not None \
-            and self.controller is not None
+        if self.presentation is None or self.document is None \
+            or self.controller is None:
+            return False
+        try:
+            if self.document.getPresentation() is None:
+                return False
+        except:
+            return False
+        return True
 
     def is_active(self):
         if not self.is_loaded():
@@ -235,12 +242,14 @@
 
     def stop_presentation(self):
         self.controller.deactivate()
-        # self.presdoc.end()
 
     def start_presentation(self):
-        self.controller.activate()
-        self.goto_slide(1)
-        # self.presdoc.start()
+        if not self.controller.isRunning():
+            self.presentation.start()
+            self.controller = self.desktop.getCurrentComponent().Presentation.getController()
+        else:
+            self.controller.activate()
+            self.goto_slide(1)
 
     def get_slide_number(self):
         return self.controller.getCurrentSlideIndex()

=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
--- openlp/plugins/presentations/lib/powerpointcontroller.py	2009-10-11 21:31:27 +0000
+++ openlp/plugins/presentations/lib/powerpointcontroller.py	2009-10-15 22:00:27 +0000
@@ -252,4 +252,3 @@
             """
             return os.path.join(self.thumbnailpath,
                 self.thumbnailprefix + unicode(slide_no) + u'.png')
-\


Follow ups