Memcard Manager:change error message for delete failure and remove unnecessary #defines

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3829 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99 2009-07-18 07:59:31 +00:00
parent ccfc004161
commit 9bc2e789d3
4 changed files with 18 additions and 23 deletions

View File

@ -326,7 +326,7 @@ void CMemcardManager::ChangePath(int id)
if (!strcasecmp(m_MemcardPath[slot2]->GetPath().mb_str(), m_MemcardPath[slot]->GetPath().mb_str()))
{
if(!m_MemcardPath[slot]->GetPath().IsEmpty())
PanicAlert(E_ALREADYOPENED);
PanicAlert("Memcard already opened");
}
else if (ReloadMemcard(m_MemcardPath[slot]->GetPath().mb_str(), slot))
{
@ -460,10 +460,10 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
}
break;
case NOMEMCARD:
PanicAlert(E_NOMEMCARD);
PanicAlert("File is not recognized as a memcard");
break;
case OPENFAIL:
PanicAlert(E_OPENFAIL);
PanicAlert("File could not be opened\nor does not have a valid extension");
break;
case OUTOFBLOCKS:
if (slot == -1)
@ -471,25 +471,25 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
PanicAlert(E_UNK);
break;
}
PanicAlert(E_OUTOFBLOCKS, memoryCard[slot]->GetFreeBlocks());
PanicAlert("Only %d blocks available", memoryCard[slot]->GetFreeBlocks());
break;
case OUTOFDIRENTRIES:
PanicAlert(E_OUTOFDIRENTRIES);
PanicAlert("No free dir index entries");
break;
case LENGTHFAIL:
PanicAlert(E_LENGTHFAIL);
PanicAlert("Imported file has invalid length");
break;
case INVALIDFILESIZE:
PanicAlert(E_INVALIDFILESIZE);
PanicAlert("The save you are trying to copy has an invalid file size");
break;
case TITLEPRESENT:
PanicAlert(E_TITLEPRESENT);
PanicAlert("Memcard already has a save for this title");
break;
case SAVFAIL:
PanicAlert(E_SAVFAIL);
PanicAlert("Imported file has sav extension\nbut does not have a correct header");
break;
case GCSFAIL:
PanicAlert(E_GCSFAIL);
PanicAlert("Imported file has gsc extension\nbut does not have a correct header");
break;
case FAIL:
if (slot == -1)
@ -497,11 +497,15 @@ bool CMemcardManager::CopyDeleteSwitch(u32 error, int slot)
PanicAlert("Export Failed");
return false;
}
PanicAlert(E_INVALID);
PanicAlert("Invalid bat.map or dir entry");
break;
case WRITEFAIL:
PanicAlert(E_SAVEFAILED);
break;
case DELETE_FAIL:
PanicAlert("Order of files in the File Directory do not match the block order\n"
"Right click and export all of the saves,\nand import the the saves to a new memcard\n");
break;
default:
PanicAlert(E_UNK);
break;

View File

@ -33,17 +33,7 @@
#undef MEMCARD_MANAGER_STYLE
#define MEMCARD_MANAGER_STYLE wxCAPTION | wxSYSTEM_MENU | wxDIALOG_NO_PARENT | wxCLOSE_BOX | wxRESIZE_BORDER | wxMAXIMIZE_BOX
#define MEMCARDMAN_TITLE "Memory Card Manager WARNING-Make backups before using, should be fixed but could mangle stuff!"
#define E_ALREADYOPENED "Memcard already opened"
#define E_INVALID "Invalid bat.map or dir entry"
#define E_NOMEMCARD "File is not recognized as a memcard"
#define E_TITLEPRESENT "Memcard already has a save for this title"
#define E_INVALIDFILESIZE "The save you are trying to copy has an invalid file size"
#define E_OUTOFBLOCKS "Only %d blocks available"
#define E_OUTOFDIRENTRIES "No free dir index entries"
#define E_LENGTHFAIL "Imported file has invalid length"
#define E_GCSFAIL "Imported file has gsc extension\nbut does not have a correct header"
#define E_SAVFAIL "Imported file has sav extension\nbut does not have a correct header"
#define E_OPENFAIL "File could not be opened\nor does not have a valid extension"
#define E_SAVEFAILED "File write failed"
#define E_UNK "Unknown error"
#define FIRSTPAGE 0

View File

@ -671,7 +671,7 @@ u32 GCMemcard::RemoveFile(u8 index) //index in the directory array
for (int i = 0; i < DIRLEN; i++)
{
if (startingblock > BE16(dir.Dir[i].FirstBlock))
return FAIL;
return DELETE_FAIL;
startingblock = BE16(dir.Dir[i].FirstBlock);
}

View File

@ -47,6 +47,7 @@ enum
GCSFAIL,
FAIL,
WRITEFAIL,
DELETE_FAIL,
MC_FST_BLOCKS = 0x05,
MBIT_TO_BLOCKS = 0x10,