-
-
Notifications
You must be signed in to change notification settings - Fork 419
Add signal when file naming related settings are changed #2567
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
Add signal when file naming related settings are changed #2567
Conversation
|
To make this signal more "generic", we could include a function in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this is a good approach. But I think we should avoid adding this very specific logic to the settings module. I'd instead have the settings emit a generic signal when settings have changed and have the update logic in e.g. the metadata box handle the specifics.
We have multiple places where we could make use of this. E.g. syncing the rename andove file settings with the menu and the script editor dialog.
Yeah, that makes sense. I'll modify it to emit a signal when a setting value has changed, with the signal providing the name of the setting as an argument. If the new value for the setting is the same as the old value then the signal will not be emitted. This should avoid the situation of emitting signals for every setting when only one setting on an option page has changed (but all settings on the page are saved). |
2b0ea4c to
da47bbe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good move, it looks good to me.
There was a problem hiding this 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.
Just an idea, but no blocker: should the signal also emit the new value and old value of the setting? Not sure we have a use case for this, but it would avoid querying the settings again.
That would make it more complete for sure. I'll have a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even better with old & new values passed to signal, LGTM.
Summary
Problem
File naming related settings can be changed in a number of places, and there is no consolidated way to capture whether a setting has been changed. Something like this is required for #2563
Solution
This PR adds a signal to the config settings class to determine when a file naming related setting has been updated.
Action
Additional actions required: