Added ability to call a function on dialog cancel

I plan to use this in the new update process for the offline editor