From d424270b7fd56b1ad02b6126886276ff0c96a56b Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Fri, 30 May 2014 11:21:26 +0200 Subject: [PATCH] Fixed locating mudraw on windows and mac, and enabled presentationplugin on mac. --- openlp/core/lib/pluginmanager.py | 5 ----- openlp/core/ui/firsttimeform.py | 5 +---- openlp/core/ui/firsttimewizard.py | 16 +++++----------- .../plugins/presentations/lib/pdfcontroller.py | 8 ++++---- .../openlp_core_lib/test_pluginmanager.py | 2 +- 5 files changed, 11 insertions(+), 25 deletions(-) diff --git a/openlp/core/lib/pluginmanager.py b/openlp/core/lib/pluginmanager.py index 474113c98..822d510b2 100644 --- a/openlp/core/lib/pluginmanager.py +++ b/openlp/core/lib/pluginmanager.py @@ -82,11 +82,6 @@ class PluginManager(RegistryMixin, OpenLPMixin, RegistryProperties): present_plugin_dir = os.path.join(self.base_path, 'presentations') self.log_debug('finding plugins in %s at depth %d' % (self.base_path, start_depth)) for root, dirs, files in os.walk(self.base_path): - if sys.platform == 'darwin' and root.startswith(present_plugin_dir): - # TODO Presentation plugin is not yet working on Mac OS X. - # For now just ignore it. The following code will ignore files from the presentation plugin directory - # and thereby never import the plugin. - continue for name in files: if name.endswith('.py') and not name.startswith('__'): path = os.path.abspath(os.path.join(root, name)) diff --git a/openlp/core/ui/firsttimeform.py b/openlp/core/ui/firsttimeform.py index 531c4b49f..d7c16f0d3 100644 --- a/openlp/core/ui/firsttimeform.py +++ b/openlp/core/ui/firsttimeform.py @@ -412,10 +412,7 @@ class FirstTimeForm(QtGui.QWizard, Ui_FirstTimeWizard, RegistryProperties): self._increment_progress_bar(translate('OpenLP.FirstTimeWizard', 'Enabling selected plugins...')) self._set_plugin_status(self.songs_check_box, 'songs/status') self._set_plugin_status(self.bible_check_box, 'bibles/status') - # TODO Presentation plugin is not yet working on Mac OS X. - # For now just ignore it. - if sys.platform != 'darwin': - self._set_plugin_status(self.presentation_check_box, 'presentations/status') + self._set_plugin_status(self.presentation_check_box, 'presentations/status') self._set_plugin_status(self.image_check_box, 'images/status') self._set_plugin_status(self.media_check_box, 'media/status') self._set_plugin_status(self.remote_check_box, 'remotes/status') diff --git a/openlp/core/ui/firsttimewizard.py b/openlp/core/ui/firsttimewizard.py index 35623ded2..ff1675ff5 100644 --- a/openlp/core/ui/firsttimewizard.py +++ b/openlp/core/ui/firsttimewizard.py @@ -95,13 +95,10 @@ class Ui_FirstTimeWizard(object): self.image_check_box.setChecked(True) self.image_check_box.setObjectName('image_check_box') self.plugin_layout.addWidget(self.image_check_box) - # TODO Presentation plugin is not yet working on Mac OS X. - # For now just ignore it. - if sys.platform != 'darwin': - self.presentation_check_box = QtGui.QCheckBox(self.plugin_page) - self.presentation_check_box.setChecked(True) - self.presentation_check_box.setObjectName('presentation_check_box') - self.plugin_layout.addWidget(self.presentation_check_box) + self.presentation_check_box = QtGui.QCheckBox(self.plugin_page) + self.presentation_check_box.setChecked(True) + self.presentation_check_box.setObjectName('presentation_check_box') + self.plugin_layout.addWidget(self.presentation_check_box) self.media_check_box = QtGui.QCheckBox(self.plugin_page) self.media_check_box.setChecked(True) self.media_check_box.setObjectName('media_check_box') @@ -222,10 +219,7 @@ class Ui_FirstTimeWizard(object): self.custom_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Custom Slides')) self.bible_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Bible')) self.image_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Images')) - # TODO Presentation plugin is not yet working on Mac OS X. - # For now just ignore it. - if sys.platform != 'darwin': - self.presentation_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Presentations')) + self.presentation_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Presentations')) self.media_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Media (Audio and Video)')) self.remote_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Allow remote access')) self.song_usage_check_box.setText(translate('OpenLP.FirstTimeWizard', 'Monitor Song Usage')) diff --git a/openlp/plugins/presentations/lib/pdfcontroller.py b/openlp/plugins/presentations/lib/pdfcontroller.py index 5ed11d2ab..b98ae131a 100644 --- a/openlp/plugins/presentations/lib/pdfcontroller.py +++ b/openlp/plugins/presentations/lib/pdfcontroller.py @@ -126,8 +126,8 @@ class PdfController(PresentationController): if os.name == 'nt': # for windows we only accept mudraw.exe in the base folder application_path = AppLocation.get_directory(AppLocation.AppDir) - if os.path.isfile(application_path + '/../mudraw.exe'): - self.mudrawbin = application_path + '/../mudraw.exe' + if os.path.isfile(os.path.join(application_path, 'mudraw.exe')): + self.mudrawbin = os.path.join(application_path, 'mudraw.exe') else: DEVNULL = open(os.devnull, 'wb') # First try to find mupdf @@ -145,8 +145,8 @@ class PdfController(PresentationController): # Last option: check if mudraw is placed in OpenLP base folder if not self.mudrawbin and not self.gsbin: application_path = AppLocation.get_directory(AppLocation.AppDir) - if os.path.isfile(application_path + '/../mudraw'): - self.mudrawbin = application_path + '/../mudraw' + if os.path.isfile(os.path.join(application_path, 'mudraw')): + self.mudrawbin = os.path.join(application_path, 'mudraw') if self.mudrawbin: self.also_supports = ['xps'] return True diff --git a/tests/interfaces/openlp_core_lib/test_pluginmanager.py b/tests/interfaces/openlp_core_lib/test_pluginmanager.py index 262f9f2f3..ba81d708f 100644 --- a/tests/interfaces/openlp_core_lib/test_pluginmanager.py +++ b/tests/interfaces/openlp_core_lib/test_pluginmanager.py @@ -88,7 +88,7 @@ class TestPluginManager(TestCase, TestMixin): plugin_names = [plugin.name for plugin in plugin_manager.plugins] assert 'songs' in plugin_names, 'There should be a "songs" plugin.' assert 'bibles' in plugin_names, 'There should be a "bibles" plugin.' - assert 'presentations' not in plugin_names, 'There should NOT be a "presentations" plugin.' + assert 'presentations' in plugin_names, 'There should be a "presentations" plugin.' assert 'images' in plugin_names, 'There should be a "images" plugin.' assert 'media' in plugin_names, 'There should be a "media" plugin.' assert 'custom' in plugin_names, 'There should be a "custom" plugin.'