Commit 7a16207c authored by Terry Jan Reedy's avatar Terry Jan Reedy

Issue #3068: Add Idle extension configuration dialog to Options menu.

Original patch by Tal Einat.
parent ed91883b
...@@ -75,7 +75,8 @@ menudefs = [ ...@@ -75,7 +75,8 @@ menudefs = [
('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>'), ('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>'),
]), ]),
('options', [ ('options', [
('_Configure IDLE...', '<<open-config-dialog>>'), ('Configure _IDLE', '<<open-config-dialog>>'),
('Configure _Extensions', '<<open-config-extensions-dialog>>'),
None, None,
]), ]),
('help', [ ('help', [
......
...@@ -216,6 +216,8 @@ class EditorWindow(object): ...@@ -216,6 +216,8 @@ class EditorWindow(object):
text.bind("<<python-docs>>", self.python_docs) text.bind("<<python-docs>>", self.python_docs)
text.bind("<<about-idle>>", self.about_dialog) text.bind("<<about-idle>>", self.about_dialog)
text.bind("<<open-config-dialog>>", self.config_dialog) text.bind("<<open-config-dialog>>", self.config_dialog)
text.bind("<<open-config-extensions-dialog>>",
self.config_extensions_dialog)
text.bind("<<open-module>>", self.open_module) text.bind("<<open-module>>", self.open_module)
text.bind("<<do-nothing>>", lambda event: "break") text.bind("<<do-nothing>>", lambda event: "break")
text.bind("<<select-all>>", self.select_all) text.bind("<<select-all>>", self.select_all)
...@@ -570,6 +572,8 @@ class EditorWindow(object): ...@@ -570,6 +572,8 @@ class EditorWindow(object):
def config_dialog(self, event=None): def config_dialog(self, event=None):
configDialog.ConfigDialog(self.top,'Settings') configDialog.ConfigDialog(self.top,'Settings')
def config_extensions_dialog(self, event=None):
configDialog.ConfigExtensionsDialog(self.top)
def help_dialog(self, event=None): def help_dialog(self, event=None):
if self.root: if self.root:
......
This diff is collapsed.
...@@ -45,6 +45,9 @@ class IdleConfParser(ConfigParser): ...@@ -45,6 +45,9 @@ class IdleConfParser(ConfigParser):
Get an option value for given section/option or return default. Get an option value for given section/option or return default.
If type is specified, return as type. If type is specified, return as type.
""" """
# TODO Use default as fallback, at least if not None
# Should also print Warning(file, section, option).
# Currently may raise ValueError
if not self.has_option(section, option): if not self.has_option(section, option):
return default return default
if type == 'bool': if type == 'bool':
......
...@@ -93,6 +93,15 @@ _class_browser_spec = { ...@@ -93,6 +93,15 @@ _class_browser_spec = {
"Double clicking on items prints a traceback for an exception " "Double clicking on items prints a traceback for an exception "
"that is ignored." "that is ignored."
} }
ConfigExtensionsDialog_spec = {
'file': 'configDialog',
'kwds': {'title': 'Test Extension Configuration',
'_htest': True,},
'msg': "IDLE extensions dialog.\n"
"\n[Ok] to close the dialog.[Apply] to apply the settings and "
"and [Cancel] to revert all changes.\nRe-run the test to ensure "
"changes made have persisted."
}
_color_delegator_spec = { _color_delegator_spec = {
'file': 'ColorDelegator', 'file': 'ColorDelegator',
......
...@@ -142,11 +142,9 @@ def overrideRootMenu(root, flist): ...@@ -142,11 +142,9 @@ def overrideRootMenu(root, flist):
# Remove the 'About' entry from the help menu, it is in the application # Remove the 'About' entry from the help menu, it is in the application
# menu # menu
del Bindings.menudefs[-1][1][0:2] del Bindings.menudefs[-1][1][0:2]
# Remove the 'Configure Idle' entry from the options menu, it is in the
# Remove the 'Configure' entry from the options menu, it is in the
# application menu as 'Preferences' # application menu as 'Preferences'
del Bindings.menudefs[-2][1][0:2] del Bindings.menudefs[-2][1][0]
menubar = Menu(root) menubar = Menu(root)
root.configure(menu=menubar) root.configure(menu=menubar)
menudict = {} menudict = {}
......
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