Remove error trace if no impress

This commit is contained in:
Jonathan Corwin 2010-06-26 21:34:26 +01:00
parent 94f7190d50
commit 7cf31532b8
1 changed files with 12 additions and 7 deletions

View File

@ -42,8 +42,12 @@ from openlp.core.lib import resize_image
if os.name == u'nt': if os.name == u'nt':
from win32com.client import Dispatch from win32com.client import Dispatch
else: else:
try:
import uno import uno
from com.sun.star.beans import PropertyValue from com.sun.star.beans import PropertyValue
uno_available = True
except ImportError:
uno_available = False
from PyQt4 import QtCore from PyQt4 import QtCore
@ -78,9 +82,7 @@ class ImpressController(PresentationController):
if os.name == u'nt': if os.name == u'nt':
return self.get_com_servicemanager() is not None return self.get_com_servicemanager() is not None
else: else:
# If not windows, and we've got this far then probably return uno_available
# installed else the import uno would likely have failed
return True
def start_process(self): def start_process(self):
""" """
@ -322,7 +324,10 @@ class ImpressDocument(PresentationDocument):
Returns true if screen is blank Returns true if screen is blank
""" """
log.debug(u'is blank OpenOffice') log.debug(u'is blank OpenOffice')
if self.control:
return self.control.isPaused() return self.control.isPaused()
else:
return False
def stop_presentation(self): def stop_presentation(self):
log.debug(u'stop presentation OpenOffice') log.debug(u'stop presentation OpenOffice')