JoshuaBonn1 / MuseScore

MuseScore is an open source and free music notation software. For support, contribution, bug reports, visit MuseScore.org. Fork and make pull requests!
https://musescore.org
Other
0 stars 0 forks source link

Local Preference Handling #19

Closed JoshuaBonn1 closed 6 years ago

JoshuaBonn1 commented 6 years ago

Current: Upon creation of a workspace, the current GUI preferences are saved to the workspace with a "useCustom=false" attribute. It also loads the GUI preferences into Workspace::localPreferences. In prefsdialog, there is a checkbox that will switch between local and global. Toggling it will change the current preferences in prefsdialog to the other preferences (local -> global or global -> local). Upon the time of workspace save (should be switched to after closing preferences), the "useCustom" tag should be the status of the checkbox. If the user switches to a workspace with "useCustom=true" then it automatically switches to the local preferences.

Issue: If the user switches from local -> global, then the local will clear from the workspace eventually. It's not specifically defined yet. Also, depending on when a save happens, if the user turns on local preferences on a workspace that has never had local preferences, it will load in old preferences.

Solutions:

  1. Only save preferences to the workspace if they want to have local preferences. a. When the user switches between local and global in prefsdialog, hold onto the local preferences until they click "Apply"/"OK". This way, they don't lose anything until they leave preferences and everything stays up to date.
  2. Hold onto the local preferences until they change workspaces or quit Musescore. a. This allows for easy switching if the user desires to mess around with their global preferences without completely losing the existing local preferences until they change workspaces.
  3. Always hold onto the last set of local preferences in the workspace file. a. This makes the local preferences never disappear and can always be loaded. However, if the user comes back to local preferences after a while, it will load in old local preferences that may be very different from their current setup.

These solutions are just ideas. I like 1, but 2 and 3 have some good features.

JoshuaBonn1 commented 6 years ago

An extension of 1: If the user doesn't have local preferences, then the preferences tag in the workspace xml will not be there. If the user switches from local to global and clicks "Apply/OK", then the workspace xml is saved and the preferences are removed. They would also be removed from Workspace::localPreferences (i.e. synced back up to the current global preferences).

JoshuaBonn1 commented 6 years ago

I'm thinking whatever is used for this should also be extended to handle any QDockWidget states (e.g. Timeline, Navigator, Palettes, Inspector, etc.)

JoshuaBonn1 commented 6 years ago

Or, for the extra QDockWidgets, we could entertain the idea you mentioned of a snapshot of the current items and save that, but I still think loading should be about the same if they don't want it to change when switching between workspaces.