mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix regression that caused calibre running in debug mode on OS X to not have a menubar or dock icon
This commit is contained in:
parent
eac34e2ba7
commit
f6e42f4cc1
@ -612,7 +612,7 @@ class Py2App(object):
|
|||||||
@flush
|
@flush
|
||||||
def create_gui_apps(self):
|
def create_gui_apps(self):
|
||||||
info('\nCreating launcher apps for viewer and editor')
|
info('\nCreating launcher apps for viewer and editor')
|
||||||
for launcher in ('ebook-viewer', 'ebook-edit'):
|
for launcher in ('ebook-viewer', 'ebook-edit', 'calibre-debug'):
|
||||||
cc_dir = os.path.join(self.contents_dir, launcher + '.app', 'Contents')
|
cc_dir = os.path.join(self.contents_dir, launcher + '.app', 'Contents')
|
||||||
os.makedirs(cc_dir)
|
os.makedirs(cc_dir)
|
||||||
for x in os.listdir(self.contents_dir):
|
for x in os.listdir(self.contents_dir):
|
||||||
@ -620,9 +620,12 @@ class Py2App(object):
|
|||||||
continue
|
continue
|
||||||
if x == 'Info.plist':
|
if x == 'Info.plist':
|
||||||
plist = plistlib.readPlist(join(self.contents_dir, x))
|
plist = plistlib.readPlist(join(self.contents_dir, x))
|
||||||
plist['CFBundleDisplayName'] = plist['CFBundleName'] = {'ebook-viewer':'E-book Viewer', 'ebook-edit':'Edit Book'}[launcher]
|
plist['CFBundleDisplayName'] = plist['CFBundleName'] = {
|
||||||
plist['CFBundleExecutable'] = launcher
|
'ebook-viewer':'E-book Viewer', 'ebook-edit':'Edit Book', 'calibre-debug': 'calibre (debug)',
|
||||||
plist['CFBundleIconFile'] = launcher + '.icns'
|
}[launcher]
|
||||||
|
if launcher != 'calibre-debug':
|
||||||
|
plist['CFBundleExecutable'] = launcher
|
||||||
|
plist['CFBundleIconFile'] = launcher + '.icns'
|
||||||
plist['CFBundleIdentifier'] = 'com.calibre-ebook.' + launcher
|
plist['CFBundleIdentifier'] = 'com.calibre-ebook.' + launcher
|
||||||
plist.pop('CFBundleDocumentTypes')
|
plist.pop('CFBundleDocumentTypes')
|
||||||
plistlib.writePlist(plist, join(cc_dir, x))
|
plistlib.writePlist(plist, join(cc_dir, x))
|
||||||
|
@ -294,8 +294,8 @@ def get_debug_executable():
|
|||||||
e = sys.executable if getattr(sys, 'frozen', False) else sys.argv[0]
|
e = sys.executable if getattr(sys, 'frozen', False) else sys.argv[0]
|
||||||
if hasattr(sys, 'frameworks_dir'):
|
if hasattr(sys, 'frameworks_dir'):
|
||||||
base = os.path.dirname(sys.frameworks_dir)
|
base = os.path.dirname(sys.frameworks_dir)
|
||||||
if 'console.app' not in base:
|
if 'calibre-debug.app' not in base:
|
||||||
base = os.path.join(base, 'console.app', 'Contents')
|
base = os.path.join(base, 'calibre-debug.app', 'Contents')
|
||||||
exe = os.path.basename(e)
|
exe = os.path.basename(e)
|
||||||
if '-debug' not in exe:
|
if '-debug' not in exe:
|
||||||
exe += '-debug'
|
exe += '-debug'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user