Skip to content

Commit c684b52

Browse files
committed
partial fix for #306911
* clarify the "don't ask again" * mention the current MuseScore version (that way the same dialog still works in MuseScore 4) * don't mark the score dirty if the reset is taken
1 parent 670af1f commit c684b52

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

libmscore/cmd.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,11 +2110,13 @@ static void resetElementPosition(void*, Element* e)
21102110
// cmdResetAllPositions
21112111
//---------------------------------------------------------
21122112

2113-
void Score::cmdResetAllPositions()
2113+
void Score::cmdResetAllPositions(bool undoable)
21142114
{
2115-
startCmd();
2115+
if (undoable)
2116+
startCmd();
21162117
scanElements(nullptr, resetElementPosition);
2117-
endCmd();
2118+
if (undoable)
2119+
endCmd();
21182120
}
21192121

21202122
//---------------------------------------------------------

libmscore/score.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ class Score : public QObject, public ScoreElement {
624624
void cmdAddOttava(OttavaType);
625625
void cmdAddStretch(qreal);
626626
void cmdResetNoteAndRestGroupings();
627-
void cmdResetAllPositions();
627+
void cmdResetAllPositions(bool undoable = true);
628628
void cmdDoubleDuration() { cmdIncDecDuration(-1, false); }
629629
void cmdHalfDuration() { cmdIncDecDuration( 1, false); }
630630
void cmdIncDurationDotted() { cmdIncDecDuration(-1, true); }

mscore/musescore.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,25 +2580,25 @@ void MuseScore::askResetOldScorePositions(Score* score)
25802580
if (resPref == "No")
25812581
return;
25822582
else if (resPref == "Yes")
2583-
score->cmdResetAllPositions();
2583+
score->cmdResetAllPositions(false);
25842584
else { // either set to "Ask" or not at all
25852585
QMessageBox msgBox;
25862586
QCheckBox ask;
2587-
ask.setText(tr("Don't ask me again."));
2587+
ask.setText(tr("Remember my choice and don't ask again"));
25882588
ask.setToolTip(tr("You can change this behaviour any time in 'Preferences… > Import > Reset Element Positions'"));
25892589
msgBox.setCheckBox(&ask);
25902590
QString question = tr("Reset the positions of all elements?");
25912591
msgBox.setWindowTitle(question);
2592-
msgBox.setText(tr("To best take advantage of automatic placement in MuseScore 3 when importing '%1' from MuseScore %2, it is recommended to reset the positions of all elements.")
2593-
.arg(score->masterScore()->fileInfo()->completeBaseName(), score->mscoreVersion()) + "\n\n" + question);
2592+
msgBox.setText(tr("To best take advantage of automatic placement in MuseScore %1 when importing '%2' from MuseScore %3, it is recommended to reset the positions of all elements.")
2593+
.arg(VERSION).arg(score->masterScore()->fileInfo()->completeBaseName(), score->mscoreVersion()) + "\n\n" + question);
25942594
msgBox.setIcon(QMessageBox::Question);
25952595
msgBox.setStandardButtons(
25962596
QMessageBox::Yes | QMessageBox::No
25972597
);
25982598

25992599
int res = msgBox.exec();
26002600
if (res == QMessageBox::Yes)
2601-
score->cmdResetAllPositions();
2601+
score->cmdResetAllPositions(false);
26022602
if (ask.checkState() == Qt::Checked)
26032603
preferences.setPreference(PREF_IMPORT_COMPATIBILITY_RESET_ELEMENT_POSITIONS, res == QMessageBox::No? "Yes" : "No");
26042604
}

0 commit comments

Comments
 (0)