Head r761

This commit is contained in:
Jon Tibble 2010-03-23 20:33:17 +00:00
commit fd3b17f6fa
4 changed files with 20 additions and 15 deletions

View File

@ -147,8 +147,9 @@ class ImpressController(PresentationController):
Called at system exit to clean up any running presentations Called at system exit to clean up any running presentations
""" """
log.debug(u'Kill OpenOffice') log.debug(u'Kill OpenOffice')
for doc in self.docs: for i in range(len(self.docs)):
doc.close_presentation() self.docs[0].close_presentation() # Yes, always the zeroth one
# as close removes item from array
if os.name != u'nt': if os.name != u'nt':
desktop = self.get_uno_desktop() desktop = self.get_uno_desktop()
else: else:

View File

@ -143,7 +143,7 @@ class PresentationMediaItem(MediaManagerItem):
for cidx in self.controllers: for cidx in self.controllers:
doc = self.controllers[cidx].add_doc(filepath) doc = self.controllers[cidx].add_doc(filepath)
doc.presentation_deleted() doc.presentation_deleted()
self.controllers[cidx].remove_doc(doc) doc.close_presentation()
def generateSlideData(self, service_item): def generateSlideData(self, service_item):
items = self.ListView.selectedIndexes() items = self.ListView.selectedIndexes()
@ -171,7 +171,7 @@ class PresentationMediaItem(MediaManagerItem):
service_item.add_from_command(path, name, img) service_item.add_from_command(path, name, img)
i = i + 1 i = i + 1
img = doc.get_slide_preview_file(i) img = doc.get_slide_preview_file(i)
controller.remove_doc(doc) doc.close_presentation()
return True return True
def findControllerByType(self, filename): def findControllerByType(self, filename):

View File

@ -81,8 +81,10 @@ class PowerpointController(PresentationController):
""" """
Called at system exit to clean up any running presentations Called at system exit to clean up any running presentations
""" """
for doc in self.docs: log.debug(u'Kill powerpoint')
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 self.process is None: if self.process is None:
return return
if self.process.Presentations.Count > 0: if self.process.Presentations.Count > 0:
@ -149,12 +151,12 @@ class PowerpointDocument(PresentationDocument):
Triggerent by new object being added to SlideController orOpenLP Triggerent by new object being added to SlideController orOpenLP
being shut down being shut down
""" """
if self.presentation is None: log.debug(u'ClosePresentation')
return if self.presentation:
try: try:
self.presentation.Close() self.presentation.Close()
except: except:
pass pass
self.presentation = None self.presentation = None
self.controller.remove_doc(self) self.controller.remove_doc(self)

View File

@ -88,9 +88,10 @@ class PptviewController(PresentationController):
""" """
Called at system exit to clean up any running presentations Called at system exit to clean up any running presentations
""" """
log.debug(u'Kill') log.debug(u'Kill pptviewer')
for doc in self.docs: for i in range(len(self.docs)):
doc.close_presentation() self.docs[0].close_presentation() # Yes, always the zeroth one
# as close removes item from array
def add_doc(self, name): def add_doc(self, name):
log.debug(u'Add Doc PPTView') log.debug(u'Add Doc PPTView')
@ -137,6 +138,7 @@ class PptviewDocument(PresentationDocument):
Triggerent by new object being added to SlideController orOpenLP Triggerent by new object being added to SlideController orOpenLP
being shut down being shut down
""" """
log.debug(u'ClosePresentation')
self.controller.process.ClosePPT(self.pptid) self.controller.process.ClosePPT(self.pptid)
self.pptid = -1 self.pptid = -1
self.controller.remove_doc(self) self.controller.remove_doc(self)