Commit 47f29a67 authored by Ronald Oussoren's avatar Ronald Oussoren

Patch 1693258: Fix for duplicate "preferences" menu-OS X

Backport of 56204.
parent 43f1f68b
...@@ -80,15 +80,27 @@ def overrideRootMenu(root, flist): ...@@ -80,15 +80,27 @@ def overrideRootMenu(root, flist):
import configDialog import configDialog
configDialog.ConfigDialog(root, 'Settings') configDialog.ConfigDialog(root, 'Settings')
root.bind('<<about-idle>>', about_dialog) root.bind('<<about-idle>>', about_dialog)
root.bind('<<open-config-dialog>>', config_dialog) root.bind('<<open-config-dialog>>', config_dialog)
if flist: if flist:
root.bind('<<close-all-windows>>', flist.close_all_callback) root.bind('<<close-all-windows>>', flist.close_all_callback)
###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding
tkversion = root.tk.eval('info patchlevel')
if tkversion >= '8.4.14':
Bindings.menudefs[0] = ('application', [
('About IDLE', '<<about-idle>>'),
None,
])
root.createcommand('::tk::mac::ShowPreferences', config_dialog)
else:
for mname, entrylist in Bindings.menudefs: for mname, entrylist in Bindings.menudefs:
menu = menudict.get(mname) menu = menudict.get(mname)
if not menu: if not menu:
continue continue
else:
for entry in entrylist: for entry in entrylist:
if not entry: if not entry:
menu.add_separator() menu.add_separator()
...@@ -102,10 +114,6 @@ def overrideRootMenu(root, flist): ...@@ -102,10 +114,6 @@ def overrideRootMenu(root, flist):
menu.add_command(label=label, underline=underline, menu.add_command(label=label, underline=underline,
command=command, accelerator=accelerator) command=command, accelerator=accelerator)
def setupApp(root, flist): def setupApp(root, flist):
""" """
Perform setup for the OSX application bundle. Perform setup for the OSX application bundle.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment