← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~matthiashub/openlp/osx-fixes into lp:openlp

 

Matthias Hub has proposed merging lp:~matthiashub/openlp/osx-fixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~matthiashub/openlp/osx-fixes/+merge/68981

- fixed view adjustments for os x 10.6 build scripts
- added compatibility with the file extension on os x #782581
- added "open with" file event on os x #782581

Comments:
- please verify that the self.args way is okay with the overall idea of opening files
- I did not put any "if darwin" statements in there yet for the event handling, is there anything needed or will this also work on linux/windows?
-- 
https://code.launchpad.net/~matthiashub/openlp/osx-fixes/+merge/68981
Your team OpenLP Core is requested to review the proposed merge of lp:~matthiashub/openlp/osx-fixes into lp:openlp.
=== modified file '.bzrignore'
--- .bzrignore	2011-01-02 12:47:30 +0000
+++ .bzrignore	2011-07-23 23:16:01 +0000
@@ -20,3 +20,4 @@
 openlp/core/resources.py.old
 *.qm
 resources/windows/warnOpenLP.txt
+openlp.cfg

=== modified file 'openlp.pyw'
--- openlp.pyw	2011-06-12 16:02:52 +0000
+++ openlp.pyw	2011-07-23 23:16:01 +0000
@@ -79,6 +79,8 @@
     class in order to provide the core of the application.
     """
 
+    args = []
+
     def exec_(self):
         """
         Override exec method to allow the shared memory to be released on exit
@@ -92,7 +94,7 @@
         """
         # On Windows, the args passed into the constructor are
         # ignored. Not very handy, so set the ones we want to use.
-        self.args = args
+        self.args.extend(args)
         # provide a listener for widgets to reqest a screen update.
         QtCore.QObject.connect(Receiver.get_receiver(),
             QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
@@ -180,6 +182,18 @@
         """
         self.restoreOverrideCursor()
 
+    def event(self, event):
+        """
+        Enables direct file opening on OS X
+        """
+        if event.type() == QtCore.QEvent.FileOpen:
+            file_name = event.file()
+            log.debug(u'Got open file event for %s!', file_name)
+            self.args.insert(0, unicode(file_name))
+            return True
+        else:
+            return QtGui.QApplication.event(self, event)
+
 def main():
     """
     The main function which parses command line options and then runs

=== modified file 'resources/osx/Info.plist.master'
--- resources/osx/Info.plist.master	2011-03-10 01:45:45 +0000
+++ resources/osx/Info.plist.master	2011-07-23 23:16:01 +0000
@@ -2,6 +2,99 @@
 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
 <plist version="1.0">
 <dict>
+
+        <key>CFBundleDocumentTypes</key>
+        <array>
+                <dict>
+                        <key>CFBundleTypeExtension</key>
+                        <array>
+                                <string>osz</string>
+                        </array>
+                        <key>CFBundleTypeIconFiles</key>
+                        <array>
+                                <string>openlp-logo-with-text.icns</string>
+                        </array>
+                        <key>CFBundleTypeName</key>
+                        <string>OpenLP Service</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>LSHandlerRank</key>
+                        <string>Owner</string>
+                        <key>LSItemContentTypes</key>
+                        <array>
+                                <string>org.openlp.osz</string>
+                        </array>
+                </dict>
+                <dict>
+                        <key>CFBundleTypeExtension</key>
+                        <array>
+                                <string>otz</string>
+                        </array>
+                        <key>CFBundleTypeIconFiles</key>
+                        <array>
+                                <string>openlp-logo-with-text.icns</string>
+                        </array>
+                        <key>CFBundleTypeName</key>
+                        <string>OpenLP Theme</string>
+                        <key>CFBundleTypeRole</key>
+                        <string>Viewer</string>
+                        <key>LSHandlerRank</key>
+                        <string>Owner</string>
+                        <key>LSItemContentTypes</key>
+                        <array>
+                                <string>org.openlp.otz</string>
+                        </array>
+                </dict>
+        </array>
+
+        <key>UTExportedTypeDeclarations</key>
+        <array>
+                <dict>
+                        <key>UTTypeIdentifier</key>
+                        <string>org.openlp.osz</string>
+                        <key>UTTypeDescription</key>
+                        <string>OpenLP Service</string>
+                        <key>UTTypeConformsTo</key>
+                        <array>
+                                <string>public.data</string>
+                                <string>public.content</string>
+                        </array>
+                        <key>UTTypeTagSpecification</key>
+                        <dict>
+                                <key>public.filename-extension</key>
+                                <array>
+                                        <string>osz</string>
+                                </array>
+                                <key>public.mime-type</key>
+                                <array>
+                                        <string>application/x-openlp-service</string>
+                                </array>
+                        </dict>
+                </dict>
+                <dict>
+                        <key>UTTypeIdentifier</key>
+                        <string>org.openlp.otz</string>
+                        <key>UTTypeDescription</key>
+                        <string>OpenLP Theme</string>
+                        <key>UTTypeConformsTo</key>
+                        <array>
+                                <string>public.data</string>
+                                <string>public.content</string>
+                        </array>
+                        <key>UTTypeTagSpecification</key>
+                        <dict>
+                                <key>public.filename-extension</key>
+                                <array>
+                                        <string>otz</string>
+                                </array>
+                                <key>public.mime-type</key>
+                                <array>
+                                        <string>application/x-openlp-theme</string>
+                                </array>
+                        </dict>
+                </dict>
+        </array>
+
 <key>CFBundleIdentifier</key>
 <string>org.openlp</string>
 <key>CFBundleShortVersionString</key>

=== modified file 'resources/osx/applescript-adjustview-10-5.master'
--- resources/osx/applescript-adjustview-10-5.master	2011-02-14 18:18:51 +0000
+++ resources/osx/applescript-adjustview-10-5.master	2011-07-23 23:16:01 +0000
@@ -48,7 +48,7 @@
 			set theViewOptions to the icon view options of container window
 			set arrangement of theViewOptions to not arranged
 			set icon size of theViewOptions to 128
-			set background picture of theViewOptions to file ".installer-background.png"
+			set background picture of theViewOptions to file ".background:installer-background.png"
                         if not exists file "Applications" then
 			    make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
                         end if

=== modified file 'resources/osx/applescript-adjustview-10-6.master'
--- resources/osx/applescript-adjustview-10-6.master	2011-02-14 18:18:51 +0000
+++ resources/osx/applescript-adjustview-10-6.master	2011-07-23 23:16:01 +0000
@@ -49,15 +49,19 @@
 			set theViewOptions to the icon view options of container window
 			set arrangement of theViewOptions to not arranged
 			set icon size of theViewOptions to 128
-			set background picture of theViewOptions to file ".installer-background.png"
-			make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
-			delay 5
+			set background picture of theViewOptions to file ".background:installer-background.png"
+                        if not exists file "Applications" then
+			    make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
+                        end if
+			delay 1
 			set position of item "%s" of container window to {160, 200}
 			set position of item ".Trashes" of container window to {100, 500}
-			set position of item ".installer-background.png" of container window to {200, 500}
+			set position of item ".background" of container window to {200, 500}
 			set position of item ".DS_Store" of container window to {400, 500}
 			set position of item "Applications" of container window to {550, 200}
-			set position of item ".VolumeIcon.icns" of container window to {500, 500}
+                        if exists file ".VolumeIcon.icns" then
+			    set position of item ".VolumeIcon.icns" of container window to {500, 500}
+                        end if
 			set position of item ".fseventsd" of container window to {300, 500}
 			if exists POSIX file ".SymAVx86QSFile" then
 				set position of item ".SymAVx86QSFile" of container window to {600, 500}

=== modified file 'resources/osx/build.py'
--- resources/osx/build.py	2011-04-03 13:35:58 +0000
+++ resources/osx/build.py	2011-07-23 23:16:01 +0000
@@ -93,8 +93,12 @@
 def build_application(settings, app_name_lower, app_dir):
     logging.info('[%s] now building the app with pyinstaller at "%s"...',
         script_name, settings['pyinstaller_basedir'])
-    result = os.system('python %s/pyinstaller.py openlp.spec' \
-              % settings['pyinstaller_basedir'])
+    full_python_dir = os.path.join('/opt/local/Library/Frameworks',
+        'Python.framework/Versions/2.6/Resources/',
+        'Python.app/Contents/MacOS/Python')
+    result = os.system('arch -i386 %s %s/pyinstaller.py openlp.spec' \
+              % ( full_python_dir,
+                settings['pyinstaller_basedir']) )
     if (result != 0):
         logging.error('[%s] The pyinstaller build reported an error, cannot \
             continue!', script_name)
@@ -219,10 +223,10 @@
         sys.exit(1)
 
     logging.info('[%s] copying the background image...', script_name)
-    # os.mkdir(volume_basedir + '/.background')
+    os.mkdir(volume_basedir + '/.background')
     result = os.system('CpMac %s %s'
         % (settings['installer_backgroundimage_file'],
-           volume_basedir + '/.installer-background.png'))
+           volume_basedir + '/.background/installer-background.png'))
     if (result != 0):
         logging.error('[%s] could not copy the background image, dmg creation\
             failed!', script_name)

=== modified file 'resources/osx/openlp-logo-with-text.icns' (properties changed: +x to -x)
=== removed file 'resources/osx/openlp.cfg'
--- resources/osx/openlp.cfg	2011-04-03 13:35:58 +0000
+++ resources/osx/openlp.cfg	1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-[openlp]
-openlp_appname = OpenLP
-openlp_dmgname = OpenLP-1.9.4-bzrXXXX
-openlp_version = XXXX
-openlp_basedir = /Users/openlp/trunk
-openlp_icon_file = openlp-logo-with-text.icns
-openlp_dmg_icon_file = openlp-logo-420x420.png
-installer_backgroundimage_file = installation-background.png
-pyinstaller_basedir = /Users/openlp/pyinstaller/trunk
-qt_menu_basedir = /Library/Frameworks/QtGui.framework/Versions/4/Resources/qt_menu.nib

=== added file 'resources/osx/openlp.cfg.sample'
--- resources/osx/openlp.cfg.sample	1970-01-01 00:00:00 +0000
+++ resources/osx/openlp.cfg.sample	2011-07-23 23:16:01 +0000
@@ -0,0 +1,10 @@
+[openlp]
+openlp_appname = OpenLP
+openlp_dmgname = OpenLP-1.9.6-bzrXXXX
+openlp_version = XXXX
+openlp_basedir = /Users/openlp/repo/trunk
+openlp_icon_file = openlp-logo-with-text.icns
+openlp_dmg_icon_file = openlp-logo-420x420.png
+installer_backgroundimage_file = installation-background.png
+pyinstaller_basedir = /Users/openlp/pyinstaller/trunk
+qt_menu_basedir = /Library/Frameworks/QtGui.framework/Versions/4/Resources/qt_menu.nib

=== modified file 'resources/osx/openlp.spec.master'
--- resources/osx/openlp.spec.master	2011-02-14 18:18:51 +0000
+++ resources/osx/openlp.spec.master	2011-07-23 23:16:01 +0000
@@ -1,5 +1,5 @@
 # -*- mode: python -*-
-a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'), os.path.join(HOMEPATH,'support/useUnicode.py'), '%(openlp_basedir)s/openlp.pyw'],
+a = Analysis([os.path.join(HOMEPATH,'support/_mountzlib.py'), os.path.join(CONFIGDIR,'support/useUnicode.py'), '%(openlp_basedir)s/openlp.pyw'],
              pathex=['%(pyinstaller_basedir)s'], hookspath=['%(openlp_basedir)s/resources/pyinstaller'])
 pyz = PYZ(a.pure)
 exe = EXE(pyz,


Follow ups