Skip to content

Commit

Permalink
Merge pull request #6511 from MarcSabatella/309760-realize-twice
Browse files Browse the repository at this point in the history
fix #309760: chord symbols realized before executing dialog
  • Loading branch information
anatoly-os authored Sep 1, 2020
2 parents 661e074 + 049bd9f commit f116ed5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 2 additions & 3 deletions mscore/musescore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5934,10 +5934,9 @@ void MuseScore::transpose()
}

//---------------------------------------------------------
// cmdRealizeChordSymbols
// realizeChordSymbols
/// Realize selected chord symbols into notes on the staff.
/// Currently just pops up a dialog to list TPCs,
/// Intervals, and pitches.
/// Display dialog to offer overrides to default behavior
//---------------------------------------------------------

void MuseScore::realizeChordSymbols()
Expand Down
4 changes: 3 additions & 1 deletion mscore/propertymenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ void ScoreView::createElementPropertyMenu(Element* e, QMenu* popup)
}
else if (e->isHarmony()) {
genPropertyMenu1(e, popup);
popup->addAction(getAction("realize-chord-symbols"));
QAction* a = getAction("realize-chord-symbols");
if (a)
popup->addAction(a->text())->setData("realize-chord-symbols-dialog");
}
else if (e->isTempoText())
genPropertyMenu1(e, popup);
Expand Down
11 changes: 8 additions & 3 deletions mscore/scoreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,15 @@ void ScoreView::objectPopup(const QPoint& pos, Element* obj)
mscore->selectSimilarInRange(obj);
else if (cmd == "select-dialog")
mscore->selectElementDialog(obj);
else if (cmd == "realize-chord-symbols") {
else if (cmd == "realize-chord-symbols-dialog") {
if (obj->isEditable()) {
if (obj->score())
obj->score()->select(obj, SelectType::ADD);
// try to construct a reasonable selection
if (obj->score()) {
Score* score = obj->score();
if (score->selection().isRange())
mscore->selectSimilarInRange(obj);
score->select(obj, SelectType::ADD);
}
mscore->realizeChordSymbols();
}
}
Expand Down

0 comments on commit f116ed5

Please sign in to comment.