Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE settings dialog shouldn't be modal #68948

Open
roseman mannequin opened this issue Jul 30, 2015 · 8 comments
Open

IDLE settings dialog shouldn't be modal #68948

roseman mannequin opened this issue Jul 30, 2015 · 8 comments
Assignees
Labels
3.10 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@roseman
Copy link
Mannequin

roseman mannequin commented Jul 30, 2015

BPO 24760
Nosy @terryjreedy, @roseman
Files
  • decouple_config.patch
  • demodalize.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = None
    created_at = <Date 2015-07-30.23:07:08.684>
    labels = ['expert-IDLE', 'type-feature', '3.10']
    title = "IDLE settings dialog shouldn't be modal"
    updated_at = <Date 2020-06-08.00:40:35.501>
    user = 'https://github.com/roseman'

    bugs.python.org fields:

    activity = <Date 2020-06-08.00:40:35.501>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2015-07-30.23:07:08.684>
    creator = 'markroseman'
    dependencies = []
    files = ['40159', '40163']
    hgrepos = []
    issue_num = 24760
    keywords = ['patch']
    message_count = 8.0
    messages = ['247707', '247711', '247715', '247899', '248375', '248414', '248795', '250255']
    nosy_count = 2.0
    nosy_names = ['terry.reedy', 'markroseman']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue24760'
    versions = ['Python 3.10']

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Jul 30, 2015

    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. :-)

    @roseman roseman mannequin added topic-IDLE type-feature A feature request or enhancement labels Jul 30, 2015
    @terryjreedy
    Copy link
    Member

    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 bpo-24039.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Jul 31, 2015

    Ok, I'll do some playing around with that one over the next few days, and see if anything comes up.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 2, 2015

    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!

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 10, 2015

    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.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 11, 2015

    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.

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Aug 18, 2015

    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.

    Thanks!

    @roseman
    Copy link
    Mannequin Author

    roseman mannequin commented Sep 8, 2015

    Note: about dialog part of the 'demodalize' patch split off and now in bpo-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 bpo-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.

    @terryjreedy terryjreedy added the 3.7 (EOL) end of life label Jun 30, 2017
    @terryjreedy terryjreedy self-assigned this Jun 30, 2017
    @terryjreedy terryjreedy added 3.10 only security fixes and removed 3.7 (EOL) end of life labels Jun 8, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    Status: In Progress
    Development

    No branches or pull requests

    1 participant