-
Notifications
You must be signed in to change notification settings - Fork 3
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 ability to store and retrieve app settings #82
Comments
I think this should be part of the core This is what we did in I think this approach - or a similar one - could be integrated into |
Interesting. It seems similar to what I did for iPANACEA: https://github.com/ImperialCollegeLondon/iPANACEA/blob/08df0d928dabfb66de4b168778c5927a11b137b8/ipanacea/settings_file.py As far as I can tell, you're not saving the settings to file anywhere in DT-CMR though, right? Perhaps we'd need a distinction between persistent and non-persistent settings? The fact that we've independently hit on something similar does suggest that it should be abstracted out into |
Rather than a singleton class, I used global dictionaries and functions in DTCMR, but otherwise it is the same idea, yes. What option is best, to be honest I don't know. Shall we bring other members of the team into the discussion to gather their opinion? @AdrianDAlessandro @dandavies99 @TinyMarsh @cc-a @CWestICL @dc2917 |
I think it's convenient to have a custom getter/setter for handling the settings (e.g. so that you can write the settings to disk when they're changed) and I did do it with a singleton class, but you could totally make it more dict-like if you wanted, by inheriting from |
I wrote something bespoke for iPANACEA, but I feel like it's a general enough solution that it could be moved to
guikit
in some form or other. The general idea is that you have a globalsettings
object (rather like the globallogger
object we have now) which you can use to get and set different values. When a value is changed, this is signalled usingpubsub
so e.g. the GUI can update.I'm not sure whether the best way to do this is as another extension or in some other way.
The text was updated successfully, but these errors were encountered: