Kaydet (Commit) a9421fb3 authored tarafından Terry Jan Reedy's avatar Terry Jan Reedy

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

Original patch by Tal Einat.
üst c803bd84
......@@ -77,7 +77,8 @@ menudefs = [
('!_Auto-open Stack Viewer', '<<toggle-jit-stack-viewer>>'),
]),
('options', [
('_Configure IDLE...', '<<open-config-dialog>>'),
('Configure _IDLE', '<<open-config-dialog>>'),
('Configure _Extensions', '<<open-config-extensions-dialog>>'),
None,
]),
('help', [
......
......@@ -189,6 +189,8 @@ class EditorWindow(object):
text.bind("<<python-docs>>", self.python_docs)
text.bind("<<about-idle>>", self.about_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("<<do-nothing>>", lambda event: "break")
text.bind("<<select-all>>", self.select_all)
......@@ -543,6 +545,8 @@ class EditorWindow(object):
def config_dialog(self, event=None):
configDialog.ConfigDialog(self.top,'Settings')
def config_extensions_dialog(self, event=None):
configDialog.ConfigExtensionsDialog(self.top)
def help_dialog(self, event=None):
if self.root:
......
This diff is collapsed.
......@@ -44,6 +44,9 @@ class IdleConfParser(ConfigParser):
Get an option value for given section/option or return default.
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):
return default
if type == 'bool':
......
......@@ -93,6 +93,15 @@ _class_browser_spec = {
"Double clicking on items prints a traceback for an exception "
"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 = {
'file': 'ColorDelegator',
......
......@@ -140,11 +140,9 @@ def overrideRootMenu(root, flist):
# Remove the 'About' entry from the help menu, it is in the application
# menu
del Bindings.menudefs[-1][1][0:2]
# Remove the 'Configure' entry from the options menu, it is in the
# Remove the 'Configure Idle' entry from the options menu, it is in the
# application menu as 'Preferences'
del Bindings.menudefs[-2][1][0:2]
del Bindings.menudefs[-2][1][0]
menubar = Menu(root)
root.configure(menu=menubar)
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