Fix issue #72 (Prompt for confirmation before exiting dialog)
Description
Fixes #72.
The confirmation popup is shown in some cases where I don't think it's necessary. If the user adds occlusions, clicks on one of the buttons to create the cards and then closes the editor dialog they are
prompted for confirmation.
The only way I can think of to prevent this is to reset the svg-edit undo stack when the user clicks on the button, but I'm not sure if that's acceptable.
I changed the way the popup opens from directly calling the constructor to opening it via aqt.dialogs.open(...) so it behaves more like the other dialogs in Anki.
I used the askUser(...) function from aqt.utils to show the popup as you can see in the following screenshot:

Checklist:
- [x] I've read and understood the contribution guidelines
- [x] I've tested my changes against at least one of the following Anki builds:
- [x] Latest standard Anki 2.1 binary build [required for Anki-compatible 2.1 add-ons]
- [ ] Latest alternative Anki 2.1 binary build
- [ ] Latest Anki 2.0 binary build [required for Anki 2.0-compatible add-ons]
- [x] I've tested my changes on at least one of the following platforms:
- [x] Linux, version:
- [ ] Windows, version:
- [ ] macOS, version:
- [ ] My changes potentially affect non-desktop platforms, of which I've tested:
- [ ] AnkiMobile, version:
- [ ] AnkiDroid, version:
- [ ] AnkiWeb
I thought of a new way to check whether or not to ask for confirmation: Compare the element on top of the undo stack to the element that was on top when the user clicked on the button to create the cards. If it's not the same (comparison by reference), ask for confirmation.
Now it should hopefully only ask for confirmation if there are actually changes that could be lost.
Thanks for yet another thoughtful contribution, @5hir0kur0! Same here as with the other PR, will revisit this as soon as SVG-Edit is upgraded.
Hey 5hir0kur0, just wanted to let you know that I pushed a slightly different solution in e1e10e779f92217aec38a93a58c50fbfc5be34d0, primarily because I forgot about your PR here :sweat_smile:. The solution there also takes field content into account, but doesn't take into consideration whether the current masks were already used to create cards (which I really love about your solution).
So leaving this PR open in order to hopefully merge both approaches in the next IO release (since 2.1.50 is at the doorstep and there's need to get the current release out quickly).
Thanks again!