Implement saving and reloading of a global config file #37
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.
This is intended as a potential solution to #8. It is rather rough, I am not familiar with PyQT and this is probably not the ideal way to do things. However, it does work.
This changes the current storage, which is per vapoursynth script, to a per-file storage which contains only the elements relevant to that video (scening, last frame viewed, etc.), and a global config file, stored in either
~/.config/vspreview
or%APPDATA%/vspreview
depending on OS, which contains a user's settings they would like to carry over between sessions, such as window dimensions and which toolbars are open. This is a breaking change to how configs currently work, but it will not require any user intervention, as vspreview will simply issue ignorable warnings, and on close will overwrite the storage file with the new format.The reason I took this approach for saving and loading with a dict instead of with yaml tags is because yaml tags seemed to automatically place the entire yaml object into our main class. That is not compatible with what we want to do here, which is load some components from one file, and some components from another file, therefore this more manual but fine-grained approach was taken.