diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index 52de42ca7..c4250f27a 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -41,10 +41,15 @@ from openlp.core.lib import resize_image if os.name == u'nt': from win32com.client import Dispatch + import pywintypes else: - import uno - from com.sun.star.beans import PropertyValue - + try: + import uno + from com.sun.star.beans import PropertyValue + uno_available = True + except ImportError: + uno_available = False + from PyQt4 import QtCore from presentationcontroller import PresentationController, PresentationDocument @@ -78,9 +83,7 @@ class ImpressController(PresentationController): if os.name == u'nt': return self.get_com_servicemanager() is not None else: - # If not windows, and we've got this far then probably - # installed else the import uno would likely have failed - return True + return uno_available def start_process(self): """ @@ -322,7 +325,10 @@ class ImpressDocument(PresentationDocument): Returns true if screen is blank """ log.debug(u'is blank OpenOffice') - return self.control.isPaused() + if self.control: + return self.control.isPaused() + else: + return False def stop_presentation(self): log.debug(u'stop presentation OpenOffice')