From db961c76dbbccff52815fba51f8a3c1ddeebb661 Mon Sep 17 00:00:00 2001 From: Jonathan Corwin Date: Fri, 2 Jul 2010 23:18:54 +0100 Subject: [PATCH] Clean up after TRB143's attempts to outclean Meths Fix pptview plugin when running as exe --- openlp/core/lib/plugin.py | 1 + openlp/core/ui/mainwindow.py | 1 + openlp/plugins/presentations/lib/mediaitem.py | 2 +- openlp/plugins/presentations/lib/pptviewcontroller.py | 7 ++++--- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp/core/lib/plugin.py b/openlp/core/lib/plugin.py index f1378f4f1..c8397f39a 100644 --- a/openlp/core/lib/plugin.py +++ b/openlp/core/lib/plugin.py @@ -131,6 +131,7 @@ class Plugin(QtCore.QObject): self.settingsForm = plugin_helpers[u'settings form'] self.mediadock = plugin_helpers[u'toolbox'] self.displayManager = plugin_helpers[u'displaymanager'] + self.pluginManager = plugin_helpers[u'pluginmanager'] QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'%s_add_service_item' % self.name), self.process_add_service_event) diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index c816d298d..3f392655d 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -581,6 +581,7 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow): self.plugin_helpers[u'settings form'] = self.settingsForm self.plugin_helpers[u'toolbox'] = self.mediaDockManager self.plugin_helpers[u'displaymanager'] = self.displayManager + self.plugin_helpers[u'pluginmanager'] = self.plugin_manager self.plugin_manager.find_plugins(pluginpath, self.plugin_helpers) # hook methods have to happen after find_plugins. Find plugins needs # the controllers hence the hooks have moved from setupUI() to here diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index ee50dd556..6f6d6fdb1 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -77,7 +77,7 @@ class PresentationMediaItem(MediaManagerItem): for type in types: if fileType.find(type) == -1: fileType += u'*%s ' % type - self.parent.service_manager.supportedSuffixes(type) + self.parent.serviceManager.supportedSuffixes(type) self.OnNewFileMasks = translate('PresentationPlugin.MediaItem', 'Presentations (%s)' % fileType) diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index e8f0d9390..2c108333c 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -79,8 +79,9 @@ class PptviewController(PresentationController): if self.process: return log.debug(u'start PPTView') - self.process = cdll.LoadLibrary( - r'openlp\plugins\presentations\lib\pptviewlib\pptviewlib.dll') + dllpath = os.path.join(self.plugin.pluginManager.basepath, + u'presentations', u'lib', u'pptviewlib', u'pptviewlib.dll') + self.process = cdll.LoadLibrary(dllpath) #self.process.SetDebug(1) def kill(self): @@ -118,7 +119,7 @@ class PptviewDocument(PresentationDocument): log.debug(u'LoadPresentation') #if self.pptid >= 0: # self.close_presentation() - rendermanager = self.controller.plugin.render_manager + rendermanager = self.controller.plugin.renderManager rect = rendermanager.screens.current[u'size'] rect = RECT(rect.x(), rect.y(), rect.right(), rect.bottom()) filepath = str(self.filepath.replace(u'/', u'\\'))