Skip to content

Commit

Permalink
fix #72451: Provide options to change default transposition options
Browse files Browse the repository at this point in the history
This commit adds four preferences: default/transpose/keySignatures, default/transpose/keepDegreeAlterations, default/transpose/chordSymbols, and default/transpose/useDoubleSharpsAndFlats. These four preferences are exposed to the user via the "Advanced" tab in the Preferences window. These preferences determine the default state of their corresponding checkboxes in the Transpose dialog.
  • Loading branch information
mattmcclinch committed Sep 13, 2019
1 parent e36df56 commit 864be64
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions mscore/preferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ void Preferences::init(bool storeInMemoryOnly)
{PREF_APP_STARTUP_STARTSCORE, new StringPreference(":/data/My_First_Score.mscx", false)},
{PREF_UI_APP_STARTUP_SHOWTOURS, new BoolPreference(true)},
{PREF_APP_WORKSPACE, new StringPreference("Basic", false)},
{PREF_DEFAULT_TRANSPOSE_KEYSIGNATURES, new BoolPreference(true)},
{PREF_DEFAULT_TRANSPOSE_KEEPDEGREEALTERATIONS, new BoolPreference(true)},
{PREF_DEFAULT_TRANSPOSE_CHORDSYMBOLS, new BoolPreference(true)},
{PREF_DEFAULT_TRANSPOSE_USEDOUBLESHARPSANDFLATS, new BoolPreference(true)},
{PREF_EXPORT_AUDIO_NORMALIZE, new BoolPreference(true)},
{PREF_EXPORT_AUDIO_SAMPLERATE, new IntPreference(44100, false)},
{PREF_EXPORT_MP3_BITRATE, new IntPreference(128, false)},
Expand Down
4 changes: 4 additions & 0 deletions mscore/preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ enum class MusicxmlExportBreaks : char {
#define PREF_APP_STARTUP_SESSIONSTART "application/startup/sessionStart"
#define PREF_APP_STARTUP_STARTSCORE "application/startup/startScore"
#define PREF_APP_WORKSPACE "application/workspace"
#define PREF_DEFAULT_TRANSPOSE_KEYSIGNATURES "default/transpose/keySignatures"
#define PREF_DEFAULT_TRANSPOSE_KEEPDEGREEALTERATIONS "default/transpose/keepDegreeAlterations"
#define PREF_DEFAULT_TRANSPOSE_CHORDSYMBOLS "default/transpose/chordSymbols"
#define PREF_DEFAULT_TRANSPOSE_USEDOUBLESHARPSANDFLATS "default/transpose/useDoubleSharpsAndFlats"
#define PREF_EXPORT_AUDIO_NORMALIZE "export/audio/normalize"
#define PREF_EXPORT_AUDIO_SAMPLERATE "export/audio/sampleRate"
#define PREF_EXPORT_MP3_BITRATE "export/mp3/bitRate"
Expand Down
9 changes: 7 additions & 2 deletions mscore/transposedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "libmscore/segment.h"
#include "libmscore/stafftype.h"
#include "libmscore/clef.h"
#include "preferences.h"

namespace Ms {

Expand All @@ -46,6 +47,10 @@ TransposeDialog::TransposeDialog(QWidget* parent)
{
setObjectName("TransposeDialog");
setupUi(this);
transposeKeys->setChecked(preferences.getBool(PREF_DEFAULT_TRANSPOSE_KEYSIGNATURES));
keepDegreeAlterations->setChecked(preferences.getBool(PREF_DEFAULT_TRANSPOSE_KEEPDEGREEALTERATIONS));
transposeChordNames->setChecked(preferences.getBool(PREF_DEFAULT_TRANSPOSE_CHORDSYMBOLS));
accidentalOptions->setCurrentIndex(preferences.getBool(PREF_DEFAULT_TRANSPOSE_USEDOUBLESHARPSANDFLATS) ? 1 : 0);
setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);

connect(transposeByKey, SIGNAL(clicked(bool)), SLOT(transposeByKeyToggled(bool)));
Expand Down Expand Up @@ -101,8 +106,8 @@ void TransposeDialog::enableTransposeByKey(bool val)
void TransposeDialog::enableTransposeChordNames(bool val)
{
transposeChordNames->setEnabled(val);
transposeChordNames->setChecked(!val);
transposeChordNames->setChecked(val);
if (!val)
transposeChordNames->setChecked(false);
}

//---------------------------------------------------------
Expand Down

0 comments on commit 864be64

Please sign in to comment.