[#889] Port FixProfileAssociationsDialog to Qt - #895
Merged
Conversation
…0.dev55 Adds `FixProfileAssociationsDialog` in `DisplayCAL/ui/tools/fix_profile_associations.py`, porting the wx dialog shown before enabling "Automatically fix profile associations": a table of display -> profile associations that `ProfileLoader` would take over (a workaround for a Windows `GetICMProfile` bug that always returns the first child device's profile regardless of which one is active), refreshed off a 1s `QTimer` the same way the sibling `ProfileAssociationsDialog` does. Adds `QtProfileLoader._toggle_fix_profile_associations()`, overriding the wx version to show the new Qt dialog instead of constructing a wx one from the Qt process; the confirm/apply logic (setcfg, `_set_display_profiles()`/ `_reset_display_profile_associations()`, `writecfg()`) is otherwise identical to the inherited wx behavior. Wires this up to both the apply-profiles tray's "Fix profile associations" menu item and the matching checkbox in `ProfileAssociationsDialog`, both Windows-only (gated on `ProfileLoader._can_fix_profile_associations()`, itself only ever true when child display devices have been enumerated, which only happens on `sys.platform == "win32"`), matching how the wx tray/dialog gate the same feature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FixProfileAssociationsDialogto Qt (DisplayCAL/ui/tools/fix_profile_associations.py): shows the display -> profile association table before enabling "Automatically fix profile associations", refreshed off a 1sQTimerthe same way the siblingProfileAssociationsDialog([Qt] Port ProfileAssociationsDialog and wire up the apply-profiles tray's "Profile associations" menu item #888) does.QtProfileLoader._toggle_fix_profile_associations(), overriding the wx version to show the new Qt dialog instead of constructing a wx one from the Qt process; the confirm/apply logic (setcfg,_set_display_profiles()/_reset_display_profile_associations(),writecfg()) is otherwise identical to the inherited wx behavior.ProfileAssociationsDialog, both gated onProfileLoader._can_fix_profile_associations()(Windows-only in practice, same as the wx original).3.10.0.dev55.Closes #889
Test plan
pytest tests/test_ui_fix_profile_associations.py tests/test_ui_profile_associations.py tests/test_qt_toggle_fix_profile_associations.py tests/test_profile_loader.py-- 37 passedruff checkon the three modified/added source files -- cleanpython -m DisplayCAL.ui.tools.apply_profileson macOS and confirmed the tray menu item shows up correctly disabled (no_can_fix_profile_associations()support off Windows)_can_fix_profile_associations/_set_display_profiles) and drove the full tray-click -> dialog -> accept/cancel flow headless, confirming cfg +_set_display_profiles/_reset_display_profile_associations/writecfgcalls happen as expected