forked from openlp/openlp
- fixed view adjustments for os x 10.6
- added compatibility with the file extension on os x - started to work on the "open with" file event on os x
This commit is contained in:
parent
cb60e6e9ef
commit
68c1c86ac5
23
openlp.pyw
23
openlp.pyw
@ -90,6 +90,7 @@ class OpenLP(QtGui.QApplication):
|
|||||||
"""
|
"""
|
||||||
Run the OpenLP application.
|
Run the OpenLP application.
|
||||||
"""
|
"""
|
||||||
|
self.eventQueue = []
|
||||||
# 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 = args
|
||||||
@ -135,6 +136,9 @@ class OpenLP(QtGui.QApplication):
|
|||||||
VersionThread(self.mainWindow).start()
|
VersionThread(self.mainWindow).start()
|
||||||
Receiver.send_message(u'maindisplay_blank_check')
|
Receiver.send_message(u'maindisplay_blank_check')
|
||||||
self.mainWindow.appStartup()
|
self.mainWindow.appStartup()
|
||||||
|
# do a check for queued events
|
||||||
|
for e in self.eventQueue:
|
||||||
|
self.event(e)
|
||||||
DelayStartThread(self.mainWindow).start()
|
DelayStartThread(self.mainWindow).start()
|
||||||
return self.exec_()
|
return self.exec_()
|
||||||
|
|
||||||
@ -180,6 +184,25 @@ 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)
|
||||||
|
log.error(file_name)
|
||||||
|
try:
|
||||||
|
self.mainWindow.serviceManagerContents.loadFile(file_name)
|
||||||
|
return True
|
||||||
|
except AttributeError, NameError:
|
||||||
|
log.debug(u'The main window is not initialized yet,\
|
||||||
|
will queue event!')
|
||||||
|
self.eventQueue.append(event)
|
||||||
|
return False
|
||||||
|
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"
|
||||||
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
|
if not exists file "Applications" then
|
||||||
delay 5
|
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 "%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}
|
||||||
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}
|
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)
|
||||||
|
0
resources/osx/openlp-logo-with-text.icns
Executable file → Normal file
0
resources/osx/openlp-logo-with-text.icns
Executable file → Normal file
@ -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
Block a user