Skip to content

Commit

Permalink
Fix #68431: More Default Zoom Preferences
Browse files Browse the repository at this point in the history
  • Loading branch information
worldwideweary committed May 1, 2020
1 parent cb469f0 commit 88584d7
Show file tree
Hide file tree
Showing 6 changed files with 138 additions and 75 deletions.
1 change: 1 addition & 0 deletions global/settings/types/preferencekeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
#define PREF_SCORE_HARMONY_PLAY "score/harmony/play"
#define PREF_SCORE_HARMONY_PLAY_ONEDIT "score/harmony/play/onedit"
#define PREF_SCORE_MAGNIFICATION "score/magnification"
#define PREF_SCORE_ZOOM_TYPE "score/zoomType"
#define PREF_SCORE_NOTE_PLAYONCLICK "score/note/playOnClick"
#define PREF_SCORE_NOTE_DEFAULTPLAYDURATION "score/note/defaultPlayDuration"
#define PREF_SCORE_NOTE_WARNPITCHRANGE "score/note/warnPitchRange"
Expand Down
1 change: 1 addition & 0 deletions mscore/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ void Preferences::init(bool storeInMemoryOnly)
{PREF_SCORE_HARMONY_PLAY, new BoolPreference(false, false)},
{PREF_SCORE_HARMONY_PLAY_ONEDIT, new BoolPreference(true, false)},
{PREF_SCORE_MAGNIFICATION, new DoublePreference(1.0, false)},
{PREF_SCORE_ZOOM_TYPE, new IntPreference(1, false)},
{PREF_SCORE_NOTE_PLAYONCLICK, new BoolPreference(true, false)},
{PREF_SCORE_NOTE_DEFAULTPLAYDURATION, new IntPreference(300 /* ms */, false)},
{PREF_SCORE_NOTE_WARNPITCHRANGE, new BoolPreference(true, false)},
Expand Down
14 changes: 14 additions & 0 deletions mscore/prefsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ PreferenceDialog::PreferenceDialog(QWidget* parent)
connect(resetToDefault, &QToolButton::clicked, this, &PreferenceDialog::resetAllValues);
connect(filterShortcuts, &QLineEdit::textChanged, this, &PreferenceDialog::filterShortcutsTextChanged);
connect(printShortcuts, &QToolButton::clicked, this, &PreferenceDialog::printShortcutsClicked);
connect(zoomType, &QComboBox::currentTextChanged, this, &PreferenceDialog::selectZoomType);

recordButtons = new QButtonGroup(this);
recordButtons->setExclusive(false);
Expand Down Expand Up @@ -540,6 +541,7 @@ void PreferenceDialog::updateValues(bool useDefaultValues)
// score settings
//
scale->setValue(preferences.getDouble(PREF_SCORE_MAGNIFICATION) * 100.0);
zoomType->setCurrentIndex(preferences.getInt(PREF_SCORE_ZOOM_TYPE));
showMidiControls->setChecked(preferences.getBool(PREF_IO_MIDI_SHOWCONTROLSINMIXER));

defaultPlayDuration->setValue(preferences.getInt(PREF_SCORE_NOTE_DEFAULTPLAYDURATION));
Expand Down Expand Up @@ -878,6 +880,17 @@ void PreferenceDialog::selectInstrumentList2()
instrumentList2->setText(s);
}

//---------------------------------------------------------
// selectZoomType
//---------------------------------------------------------

void PreferenceDialog::selectZoomType()
{
// Only enable editing of [zoom-percentage spinner widget] if [Percentage] is selected
zoomType->currentText() != "Percentage" ? scale->setEnabled(false) : scale->setEnabled(true);
}


//---------------------------------------------------------
// selectStartWith
//---------------------------------------------------------
Expand Down Expand Up @@ -1147,6 +1160,7 @@ void PreferenceDialog::apply()
preferences.setPreference(PREF_UI_APP_LANGUAGE, l);

preferences.setPreference(PREF_SCORE_MAGNIFICATION, scale->value()/100.0);
preferences.setPreference(PREF_SCORE_ZOOM_TYPE, zoomType->currentIndex());

if (showMidiControls->isChecked() != preferences.getBool(PREF_IO_MIDI_SHOWCONTROLSINMIXER)) {
preferences.setPreference(PREF_IO_MIDI_SHOWCONTROLSINMIXER, showMidiControls->isChecked());
Expand Down
1 change: 1 addition & 0 deletions mscore/prefsdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class PreferenceDialog : public AbstractDialog, private Ui::PrefsDialogBase {
void selectPluginsDirectory();
void selectImagesDirectory();
void selectExtensionsDirectory();
void selectZoomType();
void printShortcutsClicked();
void filterShortcutsTextChanged(const QString &);
void filterAdvancedPreferences(const QString&);
Expand Down
Loading

0 comments on commit 88584d7

Please sign in to comment.