forked from openlp/openlp
Get slide previews in impress working
This commit is contained in:
parent
bb619ce325
commit
3b10559af5
@ -129,6 +129,7 @@ class ImpressController(PresentationController):
|
|||||||
0, properties)
|
0, properties)
|
||||||
self.presentation = self.document.getPresentation()
|
self.presentation = self.document.getPresentation()
|
||||||
self.presentation.Display = self.plugin.render_manager.current_display + 1
|
self.presentation.Display = self.plugin.render_manager.current_display + 1
|
||||||
|
self.controller = None
|
||||||
except:
|
except:
|
||||||
log.exception(u'Failed to load presentation')
|
log.exception(u'Failed to load presentation')
|
||||||
return
|
return
|
||||||
@ -216,8 +217,7 @@ class ImpressController(PresentationController):
|
|||||||
self.document = None
|
self.document = None
|
||||||
|
|
||||||
def is_loaded(self):
|
def is_loaded(self):
|
||||||
if self.presentation is None or self.document is None \
|
if self.presentation is None or self.document is None:
|
||||||
or self.controller is None:
|
|
||||||
return False
|
return False
|
||||||
try:
|
try:
|
||||||
if self.document.getPresentation() is None:
|
if self.document.getPresentation() is None:
|
||||||
@ -229,6 +229,8 @@ class ImpressController(PresentationController):
|
|||||||
def is_active(self):
|
def is_active(self):
|
||||||
if not self.is_loaded():
|
if not self.is_loaded():
|
||||||
return False
|
return False
|
||||||
|
if self.controller is None:
|
||||||
|
return False
|
||||||
return self.controller.isRunning() and self.controller.isActive()
|
return self.controller.isRunning() and self.controller.isActive()
|
||||||
|
|
||||||
def unblank_screen(self):
|
def unblank_screen(self):
|
||||||
@ -241,7 +243,7 @@ class ImpressController(PresentationController):
|
|||||||
self.controller.deactivate()
|
self.controller.deactivate()
|
||||||
|
|
||||||
def start_presentation(self):
|
def start_presentation(self):
|
||||||
if not self.controller.isRunning():
|
if self.controller is None or not self.controller.isRunning():
|
||||||
self.presentation.start()
|
self.presentation.start()
|
||||||
self.controller = self.desktop.getCurrentComponent().Presentation.getController()
|
self.controller = self.desktop.getCurrentComponent().Presentation.getController()
|
||||||
else:
|
else:
|
||||||
@ -252,7 +254,7 @@ class ImpressController(PresentationController):
|
|||||||
return self.controller.getCurrentSlideIndex()
|
return self.controller.getCurrentSlideIndex()
|
||||||
|
|
||||||
def get_slide_count(self):
|
def get_slide_count(self):
|
||||||
return self.controller.getSlideCount()
|
return self.document.getDrawPages().getCount()
|
||||||
|
|
||||||
def goto_slide(self, slideno):
|
def goto_slide(self, slideno):
|
||||||
self.controller.gotoSlideIndex(slideno-1)
|
self.controller.gotoSlideIndex(slideno-1)
|
||||||
|
@ -82,7 +82,7 @@ class MessageListener(object):
|
|||||||
def slide(self, message):
|
def slide(self, message):
|
||||||
self.activate()
|
self.activate()
|
||||||
if message is not None:
|
if message is not None:
|
||||||
self.controller.goto_slide(message[0])
|
self.controller.goto_slide(message[0]+1)
|
||||||
self.controller.slidenumber = self.controller.get_slide_number()
|
self.controller.slidenumber = self.controller.get_slide_number()
|
||||||
|
|
||||||
def first(self, message):
|
def first(self, message):
|
||||||
|
Loading…
Reference in New Issue
Block a user