Emit redo / undo events and lock buttons when it's appropriate

[#74712160]