[#890] Port ProfileLoaderExceptionsDialog to Qt - #896
Merged
Conversation
….0.dev56 Adds DisplayCAL/ui/tools/profile_loader_exceptions.py, a Qt port of profile_loader.ProfileLoaderExceptionsDialog, and wires the apply-profiles tray's "Exceptions" menu item to it via QtProfileLoader.set_exceptions() (mirroring wx's TaskBarIcon.set_exceptions), replacing the disabled placeholder action. The Qt table uses native checkboxes for the enabled/reset columns instead of wx's custom icon-swap grid renderer, with a legend below reusing the real apply-profiles-reset icon (normal/disabled) to keep the disable-vs-reset distinction readable.
The sample paths used forward-slash literals (e.g. "/apps/bar/bar.exe"), which round-trip fine through posixpath but not through ntpath on Windows: os.path.join() always inserts a backslash, so a path rebuilt from dirname()/basename() picked up a mixed separator and stopped matching its own dict key, and os.path.normpath() converts a leading "/" to "\", so QFileDialog-mocked paths no longer matched their expected keys either. Paths are now built with os.path.join() throughout, so they stay self-consistent (and match what normpath()/dirname()/basename() produce) on whichever platform the test runs on.
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
ProfileLoaderExceptionsDialogto Qt (DisplayCAL/ui/tools/profile_loader_exceptions.py): lets the user manage per-executable profile-loader exceptions (disable loading, or force a gamma-ramp reset, while a given executable is running).CustomCellBoolRenderericon-swap cells; a legend below the table reuses the realapply-profiles-reseticon (normal/disabled) so the disable-vs-reset distinction still reads the same as the wx dialog.QtProfileLoader.set_exceptions(), mirroring wx'sTaskBarIcon.set_exceptions, and wires the apply-profiles tray's "Exceptions" menu item to it, replacing the disabled "Not yet available in the Qt build" placeholder.profile_loader.exceptionsconfig on OK.3.10.0.dev56.Closes #890
Test plan
pytest tests/test_ui_profile_loader_exceptions.py-- 10 passed, covering population/sorting, checkbox toggling, selection-driven button state, delete (button + keyboard shortcut), known-app rejection, add-new, add-existing de-dup, and the browse-edit stale-entry fixpytest tests/ -k "qt or ui_"-- 1025 passed, 2 skipped (no regressions)ruff checkon the added/modified source files -- cleanQApplication) with sample exception data and drove Add/Browse/Delete/checkbox toggling by hand before confirming Cancel closes without persisting