newElement has bad refresh behaviour

• Oct 19, 2015 - 20:16
Type
Plugins
Severity
S4 - Minor
Status
active
Project

Version 2.0.2 Rev f51dc11

Select a measure, then run the plugin. There should be two strings displayed as STAFF_TEXT.

The first string "one" is created in the OnRun event handler. It displays immediately.

The second string "onemore" is created after you click the OK button. It doesn't display until you make a significant change to the score, such as saving it.

If you then undo (Ctrl-Z), "one" is deleted, but "onemore" appears and does not get deleted.

I posted this in the Plugin forum (https://musescore.org/en/node/83306), but no-one replied so I'm assuming it's a bug.

Attachment Size
testAddText.qml 1.25 KB

Comments

I know that this issue is 3 years old but, for the record, this behavior probably follows API design: dialog type plugins should call startCmd() and endCmd() manually when handling GUI events in order for an action to cause score updating and to make the action undoable. Maybe this could be altered a bit in 3.0 API to make it impossible to make it wrong, or could be reflected more explicitly in plugins API documentation. Anyway, this needs to be considered so I leave this open for now.