New issue 83 by DavidMcK...@gmail.com: Morphed decks are saved without
prompting
http://code.google.com/p/ardb/issues/detail?id=83
What steps will reproduce the problem?
1. Save a deck from the Deck Builder.
2. Modify the vtescsv.zip so a card in that saved deck is removed. (This
can happen from a mistaken cardlist import, or if Pascal chooses to remove
a card from existence.)
3. Open the saved .xml file in your favorite text editor.
4. Open your saved deck in the Deck Builder. Notice that the .xml will be
saved IMMEDIATELY even though you'll get a warning about "Error while
adding card".
What is the expected output? What do you see instead?
The saved .xml will be updated without warning the user. This means, their
saved deck can be effectively emptied and lost. I'd like to see a prompt
for permission before changing any user files.
What version of the product are you using? On what operating system?
Build April 6, 2010 10:24:52
Windows Vista
Please provide any additional information below.
I think the right fix for this is to show a question dialog around line
1625 of deckmodel.cpp. Something like this:
Change it from:
if (bMorphed) {
ExportWithXSL (sFileName, NULL);
}
to:
if (bMorphed) {
wxMessageDialog oWarningDialog (NULL,
wxT ("The cardlist has changed since last saving this deck and your
deck must be resaved. This may remove cards from your deck that no longer
exist in the cardlist. Do you want to save this deck before proceeding?"),
wxT ("Save deck ?"),
wxYES | wxNO | wxICON_QUESTION);
if (oWarningDialog.ShowModal () == wxID_YES) {
ExportWithXSL (sFileName, NULL);
}
}
Alternatively, come up with an special databaseID that can go on cards that
are no longer in the vtescsv.