Automation for Instrument Change command missing when using menu as opposed to palette

• Dec 16, 2020 - 17:36
Reported version
3.5
Type
Ergonomical (UX)
Frequency
Once
Severity
S3 - Major
Reproducibility
Always
Status
active
Regression
No
Workaround
No
Project

OS: Windows 10 (10.0), Arch.: x86_64, MuseScore version (64-bit): 3.5.2.311459983, revision: 465e7b6

Set up an oboe staff, say, and add "Change instrument" text from the palette. Change to "English horn" say. Now do exactly the same thing using the menu: Add > Text > Instrument change.

Expected result: Both methods should lead to the same result via the same sequence of steps?
Actual result: Same result but via a different sequence of steps.

The obvious suggestion is to ensure that the menu version of the procedure matches the palette version.


Comments

Title Instrument change procedure differs depending on whether done from palette or from menu Automation for Instrument Change command missing when using menu as opposed to palette

Confirmed, the automation present when adding from the palette doesn't happen when using the menu command.

Add > Text > Instrument change does exist though, what is missing (I guess) is the internal command to do the work, right?

Well... I see (not working):

      {
         MsWidget::SCORE_TAB,
         STATE_NORMAL | STATE_NOTE_ENTRY,
         "instrument-change-text",
         QT_TRANSLATE_NOOP("action","Instrument Change"),
         QT_TRANSLATE_NOOP("action","Add instrument change")
         },

and:

            {{"instrument-change-text"}, [](ScoreView* cv, const QByteArray&) {
                  cv->cmdAddText(Tid::INSTRUMENT_CHANGE);
                  }},

and:

            case Tid::INSTRUMENT_CHANGE:
                  {
                  ChordRest* cr = _score->getSelectedChordRest();
                  if (!cr)
                        break;
                  s = new InstrumentChange(_score);
                  cr->undoAddAnnotation(s);
                  }
                  break;

vs. (working)

      InstrumentChange* is = new InstrumentChange(gscore);
      is->setXmlText(QT_TRANSLATE_NOOP("Palette", "Change Instr."));
      sp->append(is, QT_TRANSLATE_NOOP("Palette", "Instrument change"))->setElementTranslated(true);

Looks OK to me, what am I missing?

To be clear: what I expect is to see the dialog pop up asking you to select an instrument, whereupon the text is filled in for you along with the other properties. I don't see anything about that here. So I'm suspecting that happens elsewhere, like perhaps what I see in palette.cpp, applyDrop():

mscore->currentScoreView()->selectInstrument(toInstrumentChange(el));