Toolbar item states are incorrect after applying preferences
If the user goes to Edit | Preferences and then applies the preferences, the states of one or more of the toolbar items can become incorrect.
Steps to reproduce
- Go to Edit | Preferences, switch to the Note Input tab, check the Enable MIDI input checkbox, then click OK.
- Open any score.
- In the File Operations toolbar, set the zoom to Whole Page and the view to Continuous View.
- Observe that the zoom and view both change accordingly.
- In the Playback Controls toolbar, make sure that the Toggle 'MIDI Input' button is turned off (not pressed in).
- Test MIDI input and observe that MIDI input works correctly.
- Go to Edit | Preferences again and OK.
- Observe that the zoom toolbar item has been reset to 100%, the view toolbar item has been changed to Page View, and the Toggle 'MIDI Input' toolbar button has been turned on (pressed in).
- Observe that the actual zoom and view of the score do not change, despite the new state of the toolbar buttons.
- Test MIDI input again and observe that it doesn't work, despite the new state of the toolbar button.
Toolbar item states are unaffected by applying preferences.
One or more toolbar item states are changed for no apparent reason.
There are two different underlying causes for this issue. The first one applies to the two File Operations toolbar buttons: When preferences are applied, these toolbar buttons are actually destroyed and recreated, but the new toolbar buttons are not initialized to match the states of the old ones.
The second one applies to the Toggle 'MIDI Input' button: Its state becomes incorrect because its state is not being kept synchronized with the state of the Enable MIDI input checkbox on the Note Input tab of the MuseScore Preferences dialog.
OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 18.104.22.16848, revision: b5c26d1