Skip to content

Commit

Permalink
Update: Save toggle state as preference (#450)
Browse files Browse the repository at this point in the history
Co-authored-by: Joachim Schmitz <[email protected]>
  • Loading branch information
worldwideweary and Jojo-Schmitz authored Apr 28, 2024
1 parent 71e480d commit d089067
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion libmscore/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4425,7 +4425,6 @@ void Score::cmd(const QAction* a, EditData& ed)
{ "pitch-spell", [](Score* cs, EditData&){ cs->spell(); }},
{ "select-all", [](Score* cs, EditData&){ cs->cmdSelectAll(); }},
{ "select-section", [](Score* cs, EditData&){ cs->cmdSelectSection(); }},
{ "toggle-mouse-entry", [](Score* cs, EditData&){ cs->cmdToggleMouseEntry(); }},
{ "add-brackets", [](Score* cs, EditData&){ cs->cmdAddBracket(); }},
{ "add-parentheses", [](Score* cs, EditData&){ cs->cmdAddParentheses(); }},
{ "add-braces", [](Score* cs, EditData&){ cs->cmdAddBraces(); }},
Expand Down
3 changes: 3 additions & 0 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,9 @@ void MuseScore::preferencesChanged(bool fromWorkspace, bool changeUI)
getAction("midi-on")->setChecked(preferences.getBool(PREF_IO_MIDI_ENABLEINPUT));
getAction("toggle-statusbar")->setChecked(preferences.getBool(PREF_UI_APP_SHOWSTATUSBAR));
getAction("show-tours")->setChecked(preferences.getBool(PREF_UI_APP_STARTUP_SHOWTOURS));
getAction("toggle-mouse-entry")->setChecked(!preferences.getBool(PREF_SCORE_NOTE_INPUT_DISABLE_MOUSE_INPUT));
getAction("toggle-edit-playback")->setChecked(preferences.getBool(PREF_SCORE_NOTE_PLAYONCLICK));

_statusBar->setVisible(preferences.getBool(PREF_UI_APP_SHOWSTATUSBAR));

if (!cs)
Expand Down Expand Up @@ -1338,6 +1340,7 @@ MuseScore::MuseScore()

populateNoteInputMenu();

getAction("toggle-mouse-entry")->setChecked(!preferences.getBool(PREF_SCORE_NOTE_INPUT_DISABLE_MOUSE_INPUT));
getAction("toggle-edit-playback")->setChecked(preferences.getBool(PREF_SCORE_NOTE_PLAYONCLICK));

//-------------------------------
Expand Down
4 changes: 4 additions & 0 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2866,6 +2866,10 @@ void ScoreView::cmd(const char* s)
cv->score()->endCmd();
}
}},
{{"toggle-mouse-entry"}, [](ScoreView*, const QByteArray&) {
MScore::disableMouseEntry = !MScore::disableMouseEntry;
preferences.setPreference(PREF_SCORE_NOTE_INPUT_DISABLE_MOUSE_INPUT, MScore::disableMouseEntry);
}},
{{"toggle-edit-playback"}, [](ScoreView* /*cv*/, const QByteArray&) {

bool value = preferences.getBool(PREF_SCORE_NOTE_PLAYONCLICK);
Expand Down

0 comments on commit d089067

Please sign in to comment.