From 0aba0eb3dcc562ad2e604b07780a1acba6cf162d Mon Sep 17 00:00:00 2001 From: Marc Sabatella Date: Tue, 18 Feb 2014 19:26:31 -0700 Subject: [PATCH] fix #24732: update Style for part in prefs dialog --- libmscore/mscore.cpp | 2 ++ libmscore/score.cpp | 10 ++++++++++ mscore/preferences.cpp | 2 ++ 3 files changed, 14 insertions(+) diff --git a/libmscore/mscore.cpp b/libmscore/mscore.cpp index 59b0bae7008a5..78fa8556b7a9a 100644 --- a/libmscore/mscore.cpp +++ b/libmscore/mscore.cpp @@ -190,6 +190,7 @@ MStyle* MScore::defaultStyle() MStyle* MScore::defaultStyleForParts() { +#if 0 if (!_defaultStyleForParts) { QSettings s; QString partStyle = s.value("partStyle").toString(); @@ -204,6 +205,7 @@ MStyle* MScore::defaultStyleForParts() } } } +#endif return _defaultStyleForParts; } diff --git a/libmscore/score.cpp b/libmscore/score.cpp index 79d2bb61f646a..5aad4b09978d1 100644 --- a/libmscore/score.cpp +++ b/libmscore/score.cpp @@ -378,15 +378,25 @@ Score::Score(Score* parent) _parentScore = parent; init(); + // inherit most style settings from parent _style = *parent->style(); + // style inheritance overrides QSettings s; QString partStyle = s.value("partStyle").toString(); if (!partStyle.isEmpty()) { + // allow "Style for part" preference to override QFile f(partStyle); if (f.open(QIODevice::ReadOnly)) _style.load(&f); } + else { + // allow defaultStyle page layout settings to override + const PageFormat* pf = MScore::defaultStyle()->pageFormat(); + qreal sp = MScore::defaultStyle()->spatium(); + _style.setPageFormat(*pf); + _style.setSpatium(sp); + } _synthesizerState = parent->_synthesizerState; } diff --git a/mscore/preferences.cpp b/mscore/preferences.cpp index ab1ab0e8e0724..e51d729fd8e57 100644 --- a/mscore/preferences.cpp +++ b/mscore/preferences.cpp @@ -989,6 +989,8 @@ void PreferenceDialog::updateValues() animations->setChecked(prefs.animations); defaultStyle->setText(prefs.defaultStyleFile); + QSettings s; + partStyle->setText(s.value("partStyle").toString()); myScores->setText(prefs.myScoresPath); myStyles->setText(prefs.myStylesPath);