From 40e719ef3af9e2515217ecc4fbc8029ebc4b5240 Mon Sep 17 00:00:00 2001 From: ramapcsx2 Date: Wed, 23 Feb 2011 23:38:04 +0000 Subject: [PATCH] Patch to the memcard manager from ValDanX. It used to overwrite formatted memory cards before this, oops :p git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4348 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/gui/Panels/MemoryCardListPanel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pcsx2/gui/Panels/MemoryCardListPanel.cpp b/pcsx2/gui/Panels/MemoryCardListPanel.cpp index 6230ce0413..0aa3857911 100644 --- a/pcsx2/gui/Panels/MemoryCardListPanel.cpp +++ b/pcsx2/gui/Panels/MemoryCardListPanel.cpp @@ -400,7 +400,7 @@ public: { wxFileName tempname; tempname.AssignTempFileName( basepath.ToString() ); - + //Console.Warning( "srcExists && destExists" ); // Neat trick to handle errors. result = result && wxRenameFile( srcfile.GetFullPath(), tempname.GetFullPath(), true ); result = result && wxRenameFile( destfile.GetFullPath(), srcfile.GetFullPath(), false ); @@ -408,10 +408,12 @@ public: } else if( destExists ) { + //Console.Warning( "destExists" ); result = wxRenameFile( destfile.GetFullPath(), srcfile.GetFullPath() ); } else if( srcExists ) { + //Console.Warning( "srcExists" ); result = wxRenameFile( srcfile.GetFullPath(), destfile.GetFullPath() ); } @@ -577,7 +579,7 @@ void Panels::MemoryCardListPanel_Simple::OnCreateCard(wxCommandEvent& evt) if( m_Cards[slot].IsPresent ) { - wxWindowID result = wxID_YES; + bool result = true; if( m_Cards[slot].IsFormatted ) { wxString content; @@ -591,8 +593,9 @@ void Panels::MemoryCardListPanel_Simple::OnCreateCard(wxCommandEvent& evt) result = Msgbox::YesNo( content, _("Delete memory card?") ); } - if( result == wxID_YES ) + if( result ) { + //Console.Warning( "Overwriting whatever was here" ); wxFileName fullpath( m_FolderPicker->GetPath() + g_Conf->Mcd[slot].Filename.GetFullName() ); wxRemoveFile( fullpath.GetFullPath() ); }