forked from openlp/openlp
Presentation plugin - still getting there
This commit is contained in:
parent
7e398174cf
commit
e613cdac81
@ -41,6 +41,8 @@ class ImpressController(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
log.debug(u'Initialising')
|
log.debug(u'Initialising')
|
||||||
self.process = None
|
self.process = None
|
||||||
|
self.document = None
|
||||||
|
self.presentation = None
|
||||||
self.startOpenoffice()
|
self.startOpenoffice()
|
||||||
|
|
||||||
def startOpenoffice(self):
|
def startOpenoffice(self):
|
||||||
@ -52,7 +54,7 @@ class ImpressController(object):
|
|||||||
|
|
||||||
def kill(self):
|
def kill(self):
|
||||||
log.debug(u'Kill')
|
log.debug(u'Kill')
|
||||||
self.process.terminate()
|
self.closePresentation()
|
||||||
|
|
||||||
def loadPresentation(self, presentation):
|
def loadPresentation(self, presentation):
|
||||||
log.debug(u'create Resolver')
|
log.debug(u'create Resolver')
|
||||||
@ -72,7 +74,17 @@ class ImpressController(object):
|
|||||||
log.error(u'Failed reason %s' % sys.exc_info())
|
log.error(u'Failed reason %s' % sys.exc_info())
|
||||||
|
|
||||||
def closePresentation(self):
|
def closePresentation(self):
|
||||||
self.document.dispose()
|
"""
|
||||||
|
Close presentation and clean up objects
|
||||||
|
Triggerent by new object being added to SlideController orOpenLP
|
||||||
|
being shut down
|
||||||
|
"""
|
||||||
|
if self.document is not None:
|
||||||
|
if self.presentation is not None:
|
||||||
|
self.presentation.end()
|
||||||
|
self.presentation = None
|
||||||
|
self.document.dispose()
|
||||||
|
self.document = None
|
||||||
|
|
||||||
def isActive(self):
|
def isActive(self):
|
||||||
return self.presentation.isRunning() and self.presentation.isActive()
|
return self.presentation.isRunning() and self.presentation.isActive()
|
||||||
|
@ -66,7 +66,7 @@ class PresentationPlugin(Plugin):
|
|||||||
If Not do not install the plugin.
|
If Not do not install the plugin.
|
||||||
"""
|
"""
|
||||||
log.debug('check_pre_conditions')
|
log.debug('check_pre_conditions')
|
||||||
|
#Lets see if Impress is required (Default is Not wanted)
|
||||||
if int(self.config.get_config(u'Impress', 0)) == 2:
|
if int(self.config.get_config(u'Impress', 0)) == 2:
|
||||||
try:
|
try:
|
||||||
#Check to see if we have uno installed
|
#Check to see if we have uno installed
|
||||||
@ -75,7 +75,7 @@ class PresentationPlugin(Plugin):
|
|||||||
self.registerControllers(u'Impress', openoffice)
|
self.registerControllers(u'Impress', openoffice)
|
||||||
except:
|
except:
|
||||||
log.error(u'Reason : %s', sys.exc_info())#[0])
|
log.error(u'Reason : %s', sys.exc_info())#[0])
|
||||||
#If we have no controllers disable plugin
|
#If we have no available controllers disable plugin
|
||||||
if len(self.controllers) > 0:
|
if len(self.controllers) > 0:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
@ -83,7 +83,7 @@ class PresentationPlugin(Plugin):
|
|||||||
|
|
||||||
def finalise(self):
|
def finalise(self):
|
||||||
log.debug(u'Finalise')
|
log.debug(u'Finalise')
|
||||||
print self.controllers
|
#Ask each controller to tidy up
|
||||||
for controller in self.controllers:
|
for controller in self.controllers:
|
||||||
print controller
|
print controller
|
||||||
self.controllers[controller].kill()
|
self.controllers[controller].kill()
|
||||||
|
Loading…
Reference in New Issue
Block a user