From 6421f1d49337801bbf3c44107dd52efedf4e3875 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Thu, 24 Sep 2009 08:35:30 +0100 Subject: [PATCH] Minor adjustments --- .../presentations/lib/pptviewcontroller.py | 10 ++-- .../presentations/presentationplugin.py | 48 ++++++++++--------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index d466e28f3..a772c62cd 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -23,14 +23,12 @@ ############################################################################### import logging -import os , subprocess +import os, subprocess import time import sys - -if os.name == u'nt': - import win32api - from ctypes import * - from ctypes.wintypes import RECT +import win32api +from ctypes import * +from ctypes.wintypes import RECT from PyQt4 import QtCore diff --git a/openlp/plugins/presentations/presentationplugin.py b/openlp/plugins/presentations/presentationplugin.py index 86aa87632..ec1578b82 100644 --- a/openlp/plugins/presentations/presentationplugin.py +++ b/openlp/plugins/presentations/presentationplugin.py @@ -31,11 +31,12 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import Plugin, MediaManagerItem from openlp.plugins.presentations.lib import PresentationMediaItem, \ PresentationTab, ImpressController -try: - from openlp.plugins.presentations.lib import PowerpointController -except: - pass -from openlp.plugins.presentations.lib import PptviewController +if os.name == u'nt': + try: + from openlp.plugins.presentations.lib import PowerpointController + except: + pass + from openlp.plugins.presentations.lib import PptviewController class PresentationPlugin(Plugin): @@ -92,24 +93,25 @@ class PresentationPlugin(Plugin): self.registerControllers(u'Impress', openoffice) except: log.exception(u'Failed to set up plugin for Impress') - #Lets see if Powerpoint is required (Default is Not wanted) - if int(self.config.get_config( - u'Powerpoint', QtCore.Qt.Unchecked)) == QtCore.Qt.Checked: - try: - #Check to see if we are Win32 - from win32com.client import Dispatch - powerpoint = PowerpointController() - self.registerControllers(u'Powerpoint', powerpoint) - except: - log.exception(u'Failed to set up plugin for Powerpoint') - #Lets see if Powerpoint Viewer is required (Default is Not wanted) - if int(self.config.get_config( - u'Powerpoint Viewer', QtCore.Qt.Unchecked)) == QtCore.Qt.Checked: - try: - pptview = PptviewController() - self.registerControllers(u'Powerpoint Viewer', pptview) - except: - log.exception(u'Failed to set up plugin for Powerpoint Viewer') + if os.name == u'nt': + #Lets see if Powerpoint is required (Default is Not wanted) + if int(self.config.get_config( + u'Powerpoint', QtCore.Qt.Unchecked)) == QtCore.Qt.Checked: + try: + #Check to see if we are Win32 + from win32com.client import Dispatch + powerpoint = PowerpointController() + self.registerControllers(u'Powerpoint', powerpoint) + except: + log.exception(u'Failed to set up plugin for Powerpoint') + #Lets see if Powerpoint Viewer is required (Default is Not wanted) + if int(self.config.get_config( + u'Powerpoint Viewer', QtCore.Qt.Unchecked)) == QtCore.Qt.Checked: + try: + pptview = PptviewController() + self.registerControllers(u'Powerpoint Viewer', pptview) + except: + log.exception(u'Failed to set up plugin for Powerpoint Viewer') #If we have no available controllers disable plugin if len(self.controllers) > 0: return True