From 7321f5fb2d7cc1c061b3062a2962c9b00c0236ed Mon Sep 17 00:00:00 2001 From: Martin Zibricky Date: Sun, 14 Oct 2012 20:42:20 +0200 Subject: [PATCH] Bug #1002038: Disable and hide presentation plugin on osx. --- openlp/core/lib/pluginmanager.py | 8 ++++++++ openlp/core/ui/firsttimewizard.py | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 8899f5846..b90375506 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -85,6 +85,14 @@ class PluginManager(object): log.debug(u'finding plugins in %s at depth %d', unicode(plugin_dir), startdepth) for root, dirs, files in os.walk(plugin_dir): + # TODO Presentation plugin is not yet working on Mac OS X. + # For now just ignore it. The following code will hide it + # in settings dialog. + if sys.platform == 'darwin': + present_plugin_dir = os.path.join(plugin_dir, 'presentations') + # Ignore files from the presentation plugin directory. + if root.startswith(present_plugin_dir): + continue for name in files: if name.endswith(u'.py') and not name.startswith(u'__'): path = os.path.abspath(os.path.join(root, name)) diff --git a/openlp/core/ui/firsttimewizard.py b/openlp/core/ui/firsttimewizard.py index 1ce523cbc..92204a583 100644 --- a/openlp/core/ui/firsttimewizard.py +++ b/openlp/core/ui/firsttimewizard.py @@ -82,13 +82,13 @@ class Ui_FirstTimeWizard(object): self.imageCheckBox.setChecked(True) self.imageCheckBox.setObjectName(u'imageCheckBox') self.pluginLayout.addWidget(self.imageCheckBox) - self.presentationCheckBox = QtGui.QCheckBox(self.pluginPage) - if sys.platform == "darwin": - self.presentationCheckBox.setChecked(False) - else: + # TODO Presentation plugin is not yet working on Mac OS X. + # For now just ignore it. + if sys.platform != 'darwin': + self.presentationCheckBox = QtGui.QCheckBox(self.pluginPage) self.presentationCheckBox.setChecked(True) - self.presentationCheckBox.setObjectName(u'presentationCheckBox') - self.pluginLayout.addWidget(self.presentationCheckBox) + self.presentationCheckBox.setObjectName(u'presentationCheckBox') + self.pluginLayout.addWidget(self.presentationCheckBox) self.mediaCheckBox = QtGui.QCheckBox(self.pluginPage) self.mediaCheckBox.setChecked(True) self.mediaCheckBox.setObjectName(u'mediaCheckBox') @@ -214,9 +214,11 @@ class Ui_FirstTimeWizard(object): self.bibleCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Bible')) self.imageCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Images')) - self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard', - 'Presentations')) - if sys.platform == "darwin": + # TODO Presentation plugin is not yet working on Mac OS X. + # For now just ignore it. + if sys.platform != 'darwin': + self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard', + 'Presentations')) self.presentationCheckBox.setEnabled(False) self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Media (Audio and Video)'))