Prevent error if attempt to keep going off the end of a presentation.

Reduce memory usage by not resizing small thumbnails back up to full monitor size in the slidecontroller.

bzr-revno: 1643
This commit is contained in:
Jonathan Corwin 2011-06-18 09:56:14 +01:00
commit 38fb5e54fe
2 changed files with 8 additions and 3 deletions

View File

@ -625,9 +625,7 @@ class SlideController(QtGui.QWidget):
label.setMargin(4)
label.setScaledContents(True)
if self.serviceItem.is_command():
image = resize_image(frame[u'image'],
self.parent().renderer.width,
self.parent().renderer.height)
image = QtGui.QImage(frame[u'image'])
else:
# If current slide set background to image
if framenumber == slideno:

View File

@ -95,6 +95,8 @@ class Controller(object):
if self.is_live:
self.doc.start_presentation()
if self.doc.slidenumber > 1:
if self.doc.slidenumber > self.doc.get_slide_count():
self.doc.slidenumber = self.doc.get_slide_count()
self.doc.goto_slide(self.doc.slidenumber)
def slide(self, slide):
@ -150,6 +152,11 @@ class Controller(object):
if self.doc.slidenumber < self.doc.get_slide_count():
self.doc.slidenumber = self.doc.slidenumber + 1
return
# 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
self.activate()
self.doc.next_step()
self.doc.poll_slidenumber(self.is_live)