* Introduce visible workspaces that are workspaces to be shown in GUI
* Introduce method `findByTranslatableName` to be used when seeking `sourceWorkspace`
- Workspaces are saved automatically after each change (prevents
possible data loss after MuseScore crashes);
- Read-only workspaces are automatically saved to different location
with "edited" suffix;
- Edited versions of Basic and Advanced workspace hide the default
ones.
But the ones related to deprecations in third-party libs
* Remove unused variables
* Prevent calling non-virtual destructors
* Prevent the warning "Moving a temporary object prevents copy elision" by removing std::move call
* disable "`register` is deprecated" warning related to the 3rd party code
The new way avoids deleting the old workspace file before creating
the new one which should potentially prevent data loss in case the
new file cannot be created.
Some menu entries (e.g. plugins) are added independently of the
workspaces framework so do not have any corresponding strings
registered. Writing them to .workspace file makes empty menu entries
appear in custom workspaces. This commit fixes that by not storing
such entries in workspace files.
QMenuBar::clear() does not delete the corresponding QMenu objects
from the list of its children. Moreover, these QMenu's seem to never
be deleted. This commit deletes the obsolete QMenu objects manually.
Changes provide opt-in styling for toolbar button text so that, like
toolbar button icons, they change color as they change state.
- Stylesheet changes to allow text on toolbar buttons to change color
when pressed (and other cases, e.g. being disabled). QToolButtons with
the property "iconic-text" set to true get this new behaviour. (Note: at
present the color values are from the hard-coded color values in
miconengine.cpp. rather than from a stylesheet / theme file.)
- Applied the "iconic-text" property to the "Concert Pitch" button so its
text now changes color in the same way as icon images do on other toolbar
buttons.
- Ensure the "Concert Pitch" button changes height in line with toolbar
buttons that contain icons. This is done in a similar way - and at the
same time - that the Zoom Options and View Mode dropdown heights are
adjusted. It's required because the "Concert Pitch" button, like the Zoom
Option and View Mode buttons, has no icon that would generate the height
changes for the button.
- removed obsolete Score* _score from XmlReader
- removed not used variables
- added braces for initializer list
- fixed using similar var names in one scope
The old Preferences struct holding all preferences are removed in favor of a
new Preferences class which acts as a proxy for QSettings. The settings stored
in QSettings are accessed directly through access methods like getBool(key),
getInt(key), etc. and changed with setPreference(key, value).
Since we are using QSettings directly the preferences are stored automatically
without the need for a custom write() and read() method like before.
The preferences.cpp/.h and prefdialog.cpp/h are refactored to have fewer
responsibilities than before. The Preferences class are all about storing and
retrieving preferences - it should not contain any code to handle any other
aspect of MuseScore.
Testing:
The Preferences class can be used in tests. All preferences are initialized with
default values in mtest. If a test requires that a preference has a specific
value it can be changed using setPreference() for that single test. In the tests
the preferences are stored in memory only.
The Preference class is supposed to be used as a singleton. In preferences.h an
'extern Preferences preferences' is set and it is defined in preferences.cpp. All
files which includes preferences.h have access to the 'preferences' singleton
and should use this to get and set preferences.