Serazahr / ardb

Anarch Revolt Deck Builder
GNU General Public License v2.0
0 stars 0 forks source link

Morphed decks are saved without prompting #83

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by DavidMcK...@gmail.com on 10 Apr 2012 at 5:46

GoogleCodeExporter commented 9 years ago
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.

Original comment by DavidMcK...@gmail.com on 12 Apr 2012 at 9:26