From d089067b94f0d8fe093134ba03b7e378dd26f855 Mon Sep 17 00:00:00 2001 From: Jesse Greene Date: Sun, 28 Apr 2024 09:14:18 -0700 Subject: [PATCH] Update: Save toggle state as preference (#450) Co-authored-by: Joachim Schmitz --- libmscore/cmd.cpp | 1 - mscore/musescore.cpp | 3 +++ mscore/scoreview.cpp | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libmscore/cmd.cpp b/libmscore/cmd.cpp index 8522c14fa0ff7..f790f613147fc 100644 --- a/libmscore/cmd.cpp +++ b/libmscore/cmd.cpp @@ -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(); }}, diff --git a/mscore/musescore.cpp b/mscore/musescore.cpp index 313c3c8d564f3..53652cdea21e4 100644 --- a/mscore/musescore.cpp +++ b/mscore/musescore.cpp @@ -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) @@ -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)); //------------------------------- diff --git a/mscore/scoreview.cpp b/mscore/scoreview.cpp index 58bfc2be2be85..b88a4fe6bf08b 100644 --- a/mscore/scoreview.cpp +++ b/mscore/scoreview.cpp @@ -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);