This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: IDLE settings dialog shouldn't be modal
Type: enhancement Stage: needs patch
Components: IDLE Versions: Python 3.10
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: markroseman, terry.reedy
Priority: normal Keywords: patch

Created on 2015-07-30 23:07 by markroseman, last changed 2022-04-11 14:58 by admin.

File name Uploaded Description Edit
decouple_config.patch markroseman, 2015-08-10 21:47 review
demodalize.patch markroseman, 2015-08-11 17:03 review
Messages (8)
msg247707 - (view) Author: Mark Roseman (markroseman) * Date: 2015-07-30 23:07
Is there any reason the IDLE settings dialog is modal?

(Actually while it is modal on Windows and Linux, on OS X you can actually switch back to the main window while the settings dialog is up, but you can't actually type etc. into it!)

While I could probably ask the same question about all the other modal dialogs, let's start here. :-)
msg247711 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-07-30 23:43
I don't know. I do not thing that any option settings affect the dialog box itself, Someone could switch modal off and experiment.  It would certainly make it easier to change something, Apply, and then try it out.  The is one place I would not feel obligated to follow modal-happy Microsoft.  (Too small, cramped dialog boxes designed for 400x600 screen is another.)

I have asked the same on at least one of the search dialog issues.  The search dialog for Notepad++ is not modal and works fine.

Also see #24039.
msg247715 - (view) Author: Mark Roseman (markroseman) * Date: 2015-07-31 00:27
Ok, I'll do some playing around with that one over the next few days, and see if anything comes up.
msg247899 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-02 21:17
Incidentally (and this I would say is a definite bug) because the modal doesn't fully work on the Mac, you can actually create multiple copies of the config dialog!
msg248375 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-10 21:47
I've attached decouple_config.patch, which removes some internal knowledge about EditorWindow from configDialog. This is a step towards making the preferences dialog non-modal (and also to launching either the current dialog, or a new ttk-dependent one).

The thing that could currently break things if we switched to non-modal is that when configuration changes, we directly examine "parent.instance_dict". Unfortunately, it's possible that parent will have been destroyed before this happens.

Instead of holding onto parent, the patch holds onto the FileList object, which should persist. It also takes the opportunity to delegate the specifics of what should happen to active editor windows on config changes (previously in configDialog) to FileList, which in turn delegates the specifics back to each EditorWindow instance.

A separate patch, depending on this refactoring, will then change the dialog so that it can be launched non-modally, and make sure only a single instance is present.
msg248414 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-11 17:03
The attached demodalize.patch (which includes the changes from the previously posted decouple_config.patch) changes both the settings dialog and the about dialog to be non-modal.

There's a new class UIFactory which is responsible for launching these kinds of windows, keeping track of them, and making sure there's only one of each kind at a time. This is also where the logic for choosing ttk vs. non-ttk components will go.

As a (questionable) bonus, the about dialog, which now incorporates the README's etc directly into the window rather than launching further modal dialogs, also has some other minor cosmetic changes.
msg248795 - (view) Author: Mark Roseman (markroseman) * Date: 2015-08-18 21:01
Terry, when you get a chance, it would be great if you could have a look at demodalize.patch (or if you can suggest someone else who would be good to take a peek at it).

This is sort of the baseline for the uifactory, and touches a lot of things in small ways to decouple some of the inter-module dependencies. 

Other things (the new query dialogs, ttk versions of configuration and search dialogs, etc.) depend on this patch to wire the uifactory into the infrastructure.

msg250255 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-08 19:57
Note: about dialog part of the 'demodalize' patch split off and now in #24813; the bulk of the rest of it, which is really providing a cleaner FileList API rather than direct access to internals from EditorWindow, is in #25031.

After the latter patch is accepted, I'll put up a new patch here that is just the changes to make settings modeless... will be just a dozen lines of code or so.
Date User Action Args
2022-04-11 14:58:19adminsetgithub: 68948
2020-06-08 00:40:35terry.reedysetversions: + Python 3.10, - Python 3.6, Python 3.7
2017-06-30 00:26:23terry.reedysetassignee: terry.reedy
versions: + Python 3.7, - Python 2.7, Python 3.5
2015-09-08 19:57:22markrosemansetmessages: + msg250255
2015-08-18 21:01:05markrosemansetmessages: + msg248795
2015-08-12 17:49:15terry.reedylinkissue24826 dependencies
2015-08-11 17:03:58markrosemansetfiles: + demodalize.patch

messages: + msg248414
versions: - Python 3.4
2015-08-10 21:47:31markrosemansetfiles: + decouple_config.patch
keywords: + patch
messages: + msg248375
2015-08-02 21:17:09markrosemansetmessages: + msg247899
2015-07-31 00:27:10markrosemansetmessages: + msg247715
2015-07-30 23:43:10terry.reedysetmessages: + msg247711
stage: needs patch
2015-07-30 23:07:08markrosemancreate