Skip to content

Conversation

phw
Copy link
Member

@phw phw commented Jan 1, 2025

Summary

  • This is a…
    • Bug fix
    • Feature addition
    • Refactoring
    • Minor / simple change (like a typo)
    • Other
  • Describe this change in 1-2 sentences:

Problem

This addresses several issues with option profiles.

  1. PICARD-3019: Changing profile using the menu is not persisted and does not update the other quick setting toggles in the Option menu. This issue is also present in the current release version 2.13.3.
  2. Option profiles are not initialized properly on startup until the Options dialog got opened the first time, as settings being part of profiles are registered late in the profile page constructors since Move option declarations to picard/options.py and introduce const.defaults #2433

See also comment in #2569

Solution

  1. The first issue is addressed by generalizing the the new setting_changed signal and using it to listen to profile changes. If profiles are changed rebuild the full option menu and the CD lookup config.
  2. For fixing the option profile registration move the registration back to initialization by making register_setting static and have each option page define an OPTIONS tuple again. It's a bit similar to old 2.x code, but the OPTIONS tuple is simplified and just consists of the name and the highlights.

phw added 3 commits January 1, 2025 12:54
Move option dialog setting registration out of constructors. Fixes option
profiles only working after options dialog has been opened.
@phw phw requested review from rdswift and zas January 1, 2025 12:00
@phw
Copy link
Member Author

phw commented Jan 1, 2025

@rdswift One detail I was unsure about was whether not persisting the profile when changed via menu was intentional or not. But IMHO it should be persisted. Otherwise it also is not properly applied.

@rdswift
Copy link
Collaborator

rdswift commented Jan 1, 2025

@rdswift One detail I was unsure about was whether not persisting the profile when changed via menu was intentional or not. But IMHO it should be persisted. Otherwise it also is not properly applied.

Not intentional. I agree with you that it should be persisted.

@rdswift
Copy link
Collaborator

rdswift commented Jan 1, 2025

I'm seeing a duplication of the changes that added the setting changed signal. Does this need to be rebased on the master branch?

EDIT: Oops, I see that the signal code was actually moved to the parent class, as you had mentioned in Item 1 of your Solution description (which I obviously didn't read closely enough). Sorry about that. Please disregard my comment.

Copy link
Collaborator

@rdswift rdswift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The only thing I noticed was that you didn't update the copyright notice in most of the files. 😉

Copy link
Collaborator

@zas zas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix, and moving options back to OPTIONS makes things cleaner. LGTM.

@phw
Copy link
Member Author

phw commented Jan 2, 2025

The only thing I noticed was that you didn't update the copyright notice in most of the files. 😉

I thought the changes were really minor, and also we should probably rerun our fix-headers script again.

@phw phw merged commit 7d95755 into metabrainz:master Jan 2, 2025
48 checks passed
@phw phw deleted the fix-option-profiles branch January 3, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants