This commit is contained in:
Tim Bentley 2009-10-16 17:13:45 +01:00
commit 78993adcf0
2 changed files with 16 additions and 8 deletions

View File

@ -122,6 +122,7 @@ class ImpressController(PresentationController):
if desktop is None:
return
try:
self.desktop = desktop
properties = []
properties = tuple(properties)
self.document = desktop.loadComponentFromURL(url, u'_blank',
@ -218,9 +219,15 @@ class ImpressController(PresentationController):
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 @@ class ImpressController(PresentationController):
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()

View File

@ -252,4 +252,3 @@ class PowerpointController(PresentationController):
"""
return os.path.join(self.thumbnailpath,
self.thumbnailprefix + unicode(slide_no) + u'.png')
\