openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01269
[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)
Correctly close down presentation apps at end
--
https://code.launchpad.net/~j-corwin/openlp/present/+merge/21977
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/plugins/presentations/lib/impresscontroller.py'
--- openlp/plugins/presentations/lib/impresscontroller.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/presentations/lib/impresscontroller.py 2010-03-23 19:45:27 +0000
@@ -147,8 +147,9 @@
Called at system exit to clean up any running presentations
"""
log.debug(u'Kill OpenOffice')
- for doc in self.docs:
- doc.close_presentation()
+ for i in range(len(self.docs)):
+ self.docs[0].close_presentation() # Yes, always the zeroth one
+ # as close removes item from array
if os.name != u'nt':
desktop = self.get_uno_desktop()
else:
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2010-03-23 19:45:27 +0000
@@ -143,7 +143,7 @@
for cidx in self.controllers:
doc = self.controllers[cidx].add_doc(filepath)
doc.presentation_deleted()
- self.controllers[cidx].remove_doc(doc)
+ doc.close_presentation()
def generateSlideData(self, service_item):
items = self.ListView.selectedIndexes()
@@ -171,7 +171,7 @@
service_item.add_from_command(path, name, img)
i = i + 1
img = doc.get_slide_preview_file(i)
- controller.remove_doc(doc)
+ doc.close_presentation()
return True
def findControllerByType(self, filename):
=== modified file 'openlp/plugins/presentations/lib/powerpointcontroller.py'
--- openlp/plugins/presentations/lib/powerpointcontroller.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/presentations/lib/powerpointcontroller.py 2010-03-23 19:45:27 +0000
@@ -81,8 +81,10 @@
"""
Called at system exit to clean up any running presentations
"""
- for doc in self.docs:
- doc.close_presentation()
+ log.debug(u'Kill powerpoint')
+ for i in range(len(self.docs)):
+ self.docs[0].close_presentation() # Yes, always the zeroth one
+ # as close removes item from array
if self.process is None:
return
if self.process.Presentations.Count > 0:
@@ -149,12 +151,12 @@
Triggerent by new object being added to SlideController orOpenLP
being shut down
"""
- if self.presentation is None:
- return
- try:
- self.presentation.Close()
- except:
- pass
+ log.debug(u'ClosePresentation')
+ if self.presentation:
+ try:
+ self.presentation.Close()
+ except:
+ pass
self.presentation = None
self.controller.remove_doc(self)
=== modified file 'openlp/plugins/presentations/lib/pptviewcontroller.py'
--- openlp/plugins/presentations/lib/pptviewcontroller.py 2010-03-21 23:58:01 +0000
+++ openlp/plugins/presentations/lib/pptviewcontroller.py 2010-03-23 19:45:27 +0000
@@ -88,9 +88,10 @@
"""
Called at system exit to clean up any running presentations
"""
- log.debug(u'Kill')
- for doc in self.docs:
- doc.close_presentation()
+ log.debug(u'Kill pptviewer')
+ for i in range(len(self.docs)):
+ self.docs[0].close_presentation() # Yes, always the zeroth one
+ # as close removes item from array
def add_doc(self, name):
log.debug(u'Add Doc PPTView')
@@ -137,6 +138,7 @@
Triggerent by new object being added to SlideController orOpenLP
being shut down
"""
+ log.debug(u'ClosePresentation')
self.controller.process.ClosePPT(self.pptid)
self.pptid = -1
self.controller.remove_doc(self)
Follow ups