forked from openlp/openlp
- fixed view adjustments for os x 10.6 build scripts
- added compatibility with the file extension on os x #782581 - added "open with" file handling for os x #782581 bzr-revno: 1697 Fixes: https://launchpad.net/bugs/782581
This commit is contained in:
commit
b21724060f
|
@ -20,3 +20,4 @@ _eric4project
|
||||||
openlp/core/resources.py.old
|
openlp/core/resources.py.old
|
||||||
*.qm
|
*.qm
|
||||||
resources/windows/warnOpenLP.txt
|
resources/windows/warnOpenLP.txt
|
||||||
|
openlp.cfg
|
||||||
|
|
16
openlp.pyw
16
openlp.pyw
|
@ -79,6 +79,8 @@ class OpenLP(QtGui.QApplication):
|
||||||
class in order to provide the core of the application.
|
class in order to provide the core of the application.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
args = []
|
||||||
|
|
||||||
def exec_(self):
|
def exec_(self):
|
||||||
"""
|
"""
|
||||||
Override exec method to allow the shared memory to be released on exit
|
Override exec method to allow the shared memory to be released on exit
|
||||||
|
@ -92,7 +94,7 @@ class OpenLP(QtGui.QApplication):
|
||||||
"""
|
"""
|
||||||
# On Windows, the args passed into the constructor are
|
# On Windows, the args passed into the constructor are
|
||||||
# ignored. Not very handy, so set the ones we want to use.
|
# 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.
|
# provide a listener for widgets to reqest a screen update.
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
|
QtCore.SIGNAL(u'openlp_process_events'), self.processEvents)
|
||||||
|
@ -180,6 +182,18 @@ class OpenLP(QtGui.QApplication):
|
||||||
"""
|
"""
|
||||||
self.restoreOverrideCursor()
|
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():
|
def main():
|
||||||
"""
|
"""
|
||||||
The main function which parses command line options and then runs
|
The main function which parses command line options and then runs
|
||||||
|
|
|
@ -2,6 +2,99 @@
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<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>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>org.openlp</string>
|
<string>org.openlp</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
|
|
|
@ -48,7 +48,7 @@ on run
|
||||||
set theViewOptions to the icon view options of container window
|
set theViewOptions to the icon view options of container window
|
||||||
set arrangement of theViewOptions to not arranged
|
set arrangement of theViewOptions to not arranged
|
||||||
set icon size of theViewOptions to 128
|
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
|
if not exists file "Applications" then
|
||||||
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
|
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -49,15 +49,19 @@ on run
|
||||||
set theViewOptions to the icon view options of container window
|
set theViewOptions to the icon view options of container window
|
||||||
set arrangement of theViewOptions to not arranged
|
set arrangement of theViewOptions to not arranged
|
||||||
set icon size of theViewOptions to 128
|
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"}
|
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
|
||||||
delay 5
|
end if
|
||||||
|
delay 1
|
||||||
set position of item "%s" of container window to {160, 200}
|
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 ".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 ".DS_Store" of container window to {400, 500}
|
||||||
set position of item "Applications" of container window to {550, 200}
|
set position of item "Applications" of container window to {550, 200}
|
||||||
|
if exists file ".VolumeIcon.icns" then
|
||||||
set position of item ".VolumeIcon.icns" of container window to {500, 500}
|
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}
|
set position of item ".fseventsd" of container window to {300, 500}
|
||||||
if exists POSIX file ".SymAVx86QSFile" then
|
if exists POSIX file ".SymAVx86QSFile" then
|
||||||
set position of item ".SymAVx86QSFile" of container window to {600, 500}
|
set position of item ".SymAVx86QSFile" of container window to {600, 500}
|
||||||
|
|
|
@ -93,8 +93,12 @@ script_name = "build"
|
||||||
def build_application(settings, app_name_lower, app_dir):
|
def build_application(settings, app_name_lower, app_dir):
|
||||||
logging.info('[%s] now building the app with pyinstaller at "%s"...',
|
logging.info('[%s] now building the app with pyinstaller at "%s"...',
|
||||||
script_name, settings['pyinstaller_basedir'])
|
script_name, settings['pyinstaller_basedir'])
|
||||||
result = os.system('python %s/pyinstaller.py openlp.spec' \
|
full_python_dir = os.path.join('/opt/local/Library/Frameworks',
|
||||||
% settings['pyinstaller_basedir'])
|
'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):
|
if (result != 0):
|
||||||
logging.error('[%s] The pyinstaller build reported an error, cannot \
|
logging.error('[%s] The pyinstaller build reported an error, cannot \
|
||||||
continue!', script_name)
|
continue!', script_name)
|
||||||
|
@ -219,10 +223,10 @@ def create_dmg(settings):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
logging.info('[%s] copying the background image...', script_name)
|
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'
|
result = os.system('CpMac %s %s'
|
||||||
% (settings['installer_backgroundimage_file'],
|
% (settings['installer_backgroundimage_file'],
|
||||||
volume_basedir + '/.installer-background.png'))
|
volume_basedir + '/.background/installer-background.png'))
|
||||||
if (result != 0):
|
if (result != 0):
|
||||||
logging.error('[%s] could not copy the background image, dmg creation\
|
logging.error('[%s] could not copy the background image, dmg creation\
|
||||||
failed!', script_name)
|
failed!', script_name)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
[openlp]
|
[openlp]
|
||||||
openlp_appname = OpenLP
|
openlp_appname = OpenLP
|
||||||
openlp_dmgname = OpenLP-1.9.4-bzrXXXX
|
openlp_dmgname = OpenLP-1.9.6-bzrXXXX
|
||||||
openlp_version = XXXX
|
openlp_version = XXXX
|
||||||
openlp_basedir = /Users/openlp/trunk
|
openlp_basedir = /Users/openlp/repo/trunk
|
||||||
openlp_icon_file = openlp-logo-with-text.icns
|
openlp_icon_file = openlp-logo-with-text.icns
|
||||||
openlp_dmg_icon_file = openlp-logo-420x420.png
|
openlp_dmg_icon_file = openlp-logo-420x420.png
|
||||||
installer_backgroundimage_file = installation-background.png
|
installer_backgroundimage_file = installation-background.png
|
|
@ -1,5 +1,5 @@
|
||||||
# -*- mode: python -*-
|
# -*- 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'])
|
pathex=['%(pyinstaller_basedir)s'], hookspath=['%(openlp_basedir)s/resources/pyinstaller'])
|
||||||
pyz = PYZ(a.pure)
|
pyz = PYZ(a.pure)
|
||||||
exe = EXE(pyz,
|
exe = EXE(pyz,
|
||||||
|
|
Loading…
Reference in New Issue