Is there a way to intercept and potentially cancel/re-trigger saving? I’m working on a plugin which operates, by default, on readonly files. I know that sounds odd, but this is how life works in Perforce. Essentially, the workflow is something like this:
- user wants to edit a file, so they open it (at this point the file is still readonly).
- user makes some changes, then wants to save, which would throw an error because the file is readonly…except with my plugin (assuming I can figure this out), the save event would be intercepted, then if the file is not unlocked yet, a Perforce command would be executed thereby unlocking the file. Assuming the unlocking is successful, the save event would be automatically re-triggered.