Set "Save Required" flag

• Sep 26, 2020 - 17:13

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?


Comments

In reply to 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()

function setFingerColour(fing)
{
    var note = find_note();
    if (!note) return false;
    curScore.startCmd();
    note.color = fingrgb[fing];
    curScore.endCmd();
}

In reply to by yonah_ag

They manage the "undostack", meaning everything between startCmd and endCmd 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.

Do you still have an unanswered question? Please log in first to post your question.