From 659e3719f0c375d621543fac0353e7c6d13fdc2d Mon Sep 17 00:00:00 2001 From: Matthias Hub Date: Thu, 10 Mar 2011 02:45:45 +0100 Subject: [PATCH 1/2] - disabled presentations plugin in the first time wizard when on OS X - converting and bundling translations during the build process - removing presentations plugin from the dmg file during the build process - fixed Info.plist spelling errors reported by typovar - fixed translation in the presentations mediaitem --- openlp/core/ui/firsttimewizard.py | 9 +++++++- openlp/plugins/presentations/lib/mediaitem.py | 2 +- resources/osx/Info.plist.master | 4 ++-- resources/osx/Makefile | 2 +- resources/osx/build.py | 23 +++++++++++++++++++ 5 files changed, 35 insertions(+), 5 deletions(-) diff --git a/openlp/core/ui/firsttimewizard.py b/openlp/core/ui/firsttimewizard.py index c6d36d741..4c7ae6880 100644 --- a/openlp/core/ui/firsttimewizard.py +++ b/openlp/core/ui/firsttimewizard.py @@ -26,6 +26,8 @@ from PyQt4 import QtCore, QtGui +import sys + from openlp.core.lib import translate from openlp.core.lib.ui import add_welcome_page @@ -77,7 +79,10 @@ class Ui_FirstTimeWizard(object): self.imageCheckBox.setObjectName(u'imageCheckBox') self.pluginLayout.addWidget(self.imageCheckBox) self.presentationCheckBox = QtGui.QCheckBox(self.pluginPage) - self.presentationCheckBox.setChecked(True) + if sys.platform == "darwin": + self.presentationCheckBox.setChecked(False) + else: + self.presentationCheckBox.setChecked(True) self.presentationCheckBox.setObjectName(u'presentationCheckBox') self.pluginLayout.addWidget(self.presentationCheckBox) self.mediaCheckBox = QtGui.QCheckBox(self.pluginPage) @@ -210,6 +215,8 @@ class Ui_FirstTimeWizard(object): 'Images')) self.presentationCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Presentations')) + if sys.platform == "darwin": + self.presentationCheckBox.setEnabled(False) self.mediaCheckBox.setText(translate('OpenLP.FirstTimeWizard', 'Media (Audio and Video)')) self.remoteCheckBox.setText(translate('OpenLP.FirstTimeWizard', diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 26229aed6..6009ff906 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -189,7 +189,7 @@ class PresentationMediaItem(MediaManagerItem): icon = build_icon(u':/general/general_delete.png') else: critical_error_message_box( - self, translate('PresentationPlugin.MediaItem', + translate('PresentationPlugin.MediaItem', 'Unsupported File'), translate('PresentationPlugin.MediaItem', 'This type of presentation is not supported.')) diff --git a/resources/osx/Info.plist.master b/resources/osx/Info.plist.master index e97e1faf5..45aab92a5 100755 --- a/resources/osx/Info.plist.master +++ b/resources/osx/Info.plist.master @@ -18,9 +18,9 @@ MacOS/openlp CFBundleName %(openlp_appname)s -CFBundleGetInfoString +CFBundleGetInfoString %(openlp_appname)s %(openlp_version)s -LSHasLocalizedDisplayName +LSHasLocalizedDisplayName NSAppleScriptEnabled diff --git a/resources/osx/Makefile b/resources/osx/Makefile index 422749da5..738a27aaa 100644 --- a/resources/osx/Makefile +++ b/resources/osx/Makefile @@ -25,4 +25,4 @@ clean: rm -rf OpenLP.app rm -f warnopenlp.txt rm -f *dmg - + diff --git a/resources/osx/build.py b/resources/osx/build.py index 4ffae789b..03f934dea 100644 --- a/resources/osx/build.py +++ b/resources/osx/build.py @@ -82,6 +82,7 @@ import ConfigParser import logging import optparse import sys +import glob import platform import re import subprocess as subp @@ -122,6 +123,15 @@ def build_application(settings, app_name_lower, app_dir): script_name) sys.exit(1) + logging.info('[%s] removing the presentations plugin...', script_name) + result = os.system('rm -rf \ + %(application_directory)s/Contents/MacOS/plugins/presentations' \ + % { 'application_directory' : app_dir }) + if (result != 0): + logging.error('[%s] could not remove presentations plugins, dmg creation failed!', + script_name) + sys.exit(1) + logging.info('[%s] copying the icons to the resource directory...', script_name) result = os.system('cp %(icon_file)s \ @@ -151,6 +161,19 @@ def build_application(settings, app_name_lower, app_dir): failed!', script_name) sys.exit(1) + logging.info('[%s] copying the translations...', script_name) + os.mkdir(app_dir + '/Contents/MacOS/i18n') + for ts_file in glob.glob(os.path.join(settings['openlp_basedir'] + + '/resources/i18n/', '*ts')): + result = os.system('lconvert -i %(ts_file)s \ + -o %(target_directory)s/Contents/MacOS/i18n/%(base)s.qm' \ + % { 'ts_file' : ts_file, 'target_directory' : app_dir, + 'base': os.path.splitext(os.path.basename(ts_file))[0] }) + if (result != 0): + logging.error('[%s] could not copy the translations, dmg creation \ + failed!', script_name) + sys.exit(1) + def deploy_qt(settings): logging.info('[%s] running mac deploy qt on %s.app...', script_name, settings['openlp_appname']); From 995b4274c5eca322dfa9b3441c3d439a8184e98f Mon Sep 17 00:00:00 2001 From: Matthias Hub Date: Thu, 10 Mar 2011 02:47:54 +0100 Subject: [PATCH 2/2] fixed line length --- resources/osx/build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/osx/build.py b/resources/osx/build.py index 03f934dea..93fe453ad 100644 --- a/resources/osx/build.py +++ b/resources/osx/build.py @@ -128,8 +128,8 @@ def build_application(settings, app_name_lower, app_dir): %(application_directory)s/Contents/MacOS/plugins/presentations' \ % { 'application_directory' : app_dir }) if (result != 0): - logging.error('[%s] could not remove presentations plugins, dmg creation failed!', - script_name) + logging.error('[%s] could not remove presentations plugins, dmg \ + creation failed!', script_name) sys.exit(1) logging.info('[%s] copying the icons to the resource directory...', @@ -170,8 +170,8 @@ def build_application(settings, app_name_lower, app_dir): % { 'ts_file' : ts_file, 'target_directory' : app_dir, 'base': os.path.splitext(os.path.basename(ts_file))[0] }) if (result != 0): - logging.error('[%s] could not copy the translations, dmg creation \ - failed!', script_name) + logging.error('[%s] could not copy the translations, dmg \ + creation failed!', script_name) sys.exit(1) def deploy_qt(settings):