Normally I wouldn't have notice this, but I have 1-2 bug reports for similar code elsewhere. You should take into consideration multiscreen setups. The code should center the dialog on the same screen where (most of) the main window is shown. I don't if it's easy to do. If it's not I'll merge it as is.

The rest of the code looks good and I tested it. It seems to work nice.