Register the calibre URL on macOS as well

This commit is contained in:
Kovid Goyal 2020-11-11 12:34:31 +05:30
parent 0191c621fb
commit 9dad654fc2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -403,11 +403,18 @@ class Freeze(object):
BOOK_EXTENSIONS = calibre_constants['book_extensions'] BOOK_EXTENSIONS = calibre_constants['book_extensions']
env = dict(**ENV) env = dict(**ENV)
env['CALIBRE_LAUNCHED_FROM_BUNDLE'] = '1' env['CALIBRE_LAUNCHED_FROM_BUNDLE'] = '1'
docs = [{'CFBundleTypeName': 'E-book', docs = [{
'CFBundleTypeExtensions': list(BOOK_EXTENSIONS), 'CFBundleTypeName': 'E-book',
'CFBundleTypeIconFile': 'book.icns', 'CFBundleTypeExtensions': list(BOOK_EXTENSIONS),
'CFBundleTypeRole': 'Viewer', 'CFBundleTypeIconFile': 'book.icns',
}] 'CFBundleTypeRole': 'Viewer',
}]
url_handlers = [dict(
CFBundleTypeRole='Viewer',
CFBundleURLIconFile='calibre',
CFBundleURLName='com.calibre-ebook.calibre-url',
CFBundleURLSchemes=['calibre']
)]
pl = dict( pl = dict(
CFBundleDevelopmentRegion='English', CFBundleDevelopmentRegion='English',
@ -420,6 +427,7 @@ class Freeze(object):
CFBundleSignature='????', CFBundleSignature='????',
CFBundleExecutable='calibre', CFBundleExecutable='calibre',
CFBundleDocumentTypes=docs, CFBundleDocumentTypes=docs,
CFBundleURLTypes=url_handlers,
LSMinimumSystemVersion='10.14.0', LSMinimumSystemVersion='10.14.0',
LSRequiresNativeExecution=True, LSRequiresNativeExecution=True,
NSAppleScriptEnabled=False, NSAppleScriptEnabled=False,