Improving past-end.

This commit is contained in:
Tomas Groth 2017-10-10 22:12:56 +02:00
parent 4ab22f6d6e
commit 9cac014cef
3 changed files with 6 additions and 8 deletions

View File

@ -421,13 +421,11 @@ class ImpressDocument(PresentationDocument):
"""
# if we are at the presentations end don't go further, just return True
if self.slide_ended and self.get_slide_count() == self.get_slide_number():
print('detected presentation end!')
return True
self.slide_ended = False
self.slide_ended_reverse = False
past_end = False
is_paused = self.control.isPaused()
print('going to next effect')
self.control.gotoNextEffect()
time.sleep(0.1)
# If for some reason the presentation end was not detected above, this will catch it.
@ -552,7 +550,7 @@ class SlideShowListener(unohelper.Base, XSlideShowListener):
Notify that the current slide has ended, e.g. the user has clicked on the slide. Calling displaySlide()
twice will not issue this event.
"""
print('LibreOffice SlideShowListener event: slideEnded %d' % reverse)
log.debug('LibreOffice SlideShowListener event: slideEnded %d' % reverse)
if reverse:
self.document.slide_ended = False
self.document.slide_ended_reverse = True

View File

@ -180,10 +180,6 @@ class Controller(object):
return False
if not self.activate():
return False
# The "End of slideshow" screen is after the last slide. Note, we can't just stop on the last slide, since it
# may contain animations that need to be stepped through.
if self.doc.slidenumber > self.doc.get_slide_count():
return True
ret = self.doc.next_step()
self.poll()
return ret
@ -424,7 +420,6 @@ class MessageListener(object):
is_live = message[1]
if is_live:
ret = self.live_handler.next()
self.live_handler.next()
if Settings().value('core/click live slide to unblank'):
Registry().execute('slidecontroller_live_unblank')
return ret

View File

@ -427,6 +427,10 @@ class PowerpointDocument(PresentationDocument):
Triggers the next effect of slide on the running presentation.
"""
log.debug('next_step')
# if we are at the presentations end don't go further, just return True
if self.presentation.SlideShowWindow.View.GetClickCount() == self.presentation.SlideShowWindow.View.GetClickIndex()\
and self.get_slide_number() == self.get_slide_count():
return True
past_end = False
try:
self.presentation.SlideShowWindow.Activate()
@ -436,6 +440,7 @@ class PowerpointDocument(PresentationDocument):
trace_error_handler(log)
self.show_error_msg()
return past_end
# If for some reason the presentation end was not detected above, this will catch it.
if self.get_slide_number() > self.get_slide_count():
log.debug('past end, stepping back to previous')
self.previous_step()