Set "Save Required" flag
I have a plugin to set note colour but the score doesn't get the asterisk symbol to show that the file has changed and it doesn't ask to save on closing. What do I need to set to flag the score as changed?
I have a plugin to set note colour but the score doesn't get the asterisk symbol to show that the file has changed and it doesn't ask to save on closing. What do I need to set to flag the score as changed?
Do you still have an unanswered question? Please log in first to post your question.
Comments
The color notes and color voices plugins do set that flag, it seems.
In reply to The color notes and color… by Jojo-Schmitz
Does this happen in the Qt.quit() call?
In reply to Does this happen in the Qt… by mike320
No idea
In reply to Does this happen in the Qt… by mike320
Don't call "Qt.quit()" as it shuts down the entire plugin engine and all active plugins: see https://musescore.org/en/node/304874#comment-999964 for some background info and context on that.
In reply to The color notes and color… by Jojo-Schmitz
Thanks, I'll check it out and see what I've missed.
In reply to Thanks, I'll check it out… by yonah_ag
Couldn't find anything in "Colour Notes" so I'll check some other plugins. I'm using a docked dialogue and from reading other threads in this forum it looks like Qt.Quit() is a bad idea for them and doesn't look like it relates to the 'save required' flag.
Fixed
Needed to use startCmd() and endCmd()
In reply to Fixed Needed to use… by yonah_ag
That's what I thought, before I looked at those plugins mentioned above, They don't do this
In reply to That's what I thought,… by Jojo-Schmitz
I referred back to BSG's Articulation plugin and noticed that it used these so gave them a try. Luckily for me it was the solution. I remember wondering what they were for; well now I have a better idea.
In reply to I referred back to BSG's… by yonah_ag
They manage the "undostack", meaning everything between
startCmd
andendCmd
is what is considered a single edit, and also what will be undone when you trigger undo afterwards.ColorVoices doesn't call that, as for non-gui plugins the engine by default wraps them in a start/endCmd.
In reply to They manage the "undostack",… by jeetee
Neat. Now I understand.