Realize Chord Symbols command in context menu executes before dialog appears

• Aug 28, 2020 - 17:38
Reported version
3.5
Priority
P2 - Medium
Type
Functional
Frequency
Once
Severity
S4 - Minor
Reproducibility
Always
Status
closed
Regression
Yes
Workaround
Yes
Project

1) empty score
2) add a chord symbol
3) right-click it
4) Realize Chord Symbols

Result: the action takes place before the dialog appears. The dialog then gives you the option to override settings, and when you hit OK, the action is executed again, with perhaps customized settings, possibly leaving remnants of the old realization behind (if you changed duration, for example).

It's not that big a deal, but I'd like to fix this for 3.5.1.

I think @anatoly-os and I stepped on each other's toes a little and inadvertently caused this. The original implementation had an issue - common to other context menu commands - where there was confusion over whether to apply the command to the selection or to what was right-clicked. This was #305739: Realize chord symbols dialog won't open, even though the option is displayed in the menu, which was fixed in https://github.com/musescore/MuseScore/pull/6128. However, I think this fix accidentally removed the handler for the command in the Tools menu, which led to that command become inoperative - #308023: Nothing happens when select Realize chord symbols via tools->Realize chord symbols. This was fixed by reinstating a command handler in https://github.com/musescore/MuseScore/pull/6348. This unfortunately caused the double handling of the context menu.

We have had quite a few bugs that come from these sort of interactions, so while I plan to address this directly for 3.x, I'm hoping to discover the whole system just works better for 4.0 :-)


Comments

Status PR created fixed

Fixed in branch 3.x, commit d23fbf2ef7

_fix #309760: chord symbols realized before executing dialog

Resolves: https://musescore.org/en/node/309760

There is a command realize-chord-symbols that you can access
from the tools menu or shortcut if you have defined it,
and also a similarly item on the context menu for chord symbols.
They are slightly differently, however -
the command just runs, whereas the context menu brings up a dialog.
Because they shared the same action,
the context menu was actually executing both versions.
This is fixed by creating a new action for the context menu.
I reuse the name of the command but add an ellipsis,
since it brings up a dialog.

I suppose it's an open question why the behaviors should be different
between invoking this from the Tools menu versus the context menu,
but I'll wait until someone actually complains before changing it._

Fix version
3.5.1