mirror of https://github.com/PCSX2/pcsx2.git
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
This commit is contained in:
parent
84ee819258
commit
40e719ef3a
|
@ -400,7 +400,7 @@ public:
|
||||||
{
|
{
|
||||||
wxFileName tempname;
|
wxFileName tempname;
|
||||||
tempname.AssignTempFileName( basepath.ToString() );
|
tempname.AssignTempFileName( basepath.ToString() );
|
||||||
|
//Console.Warning( "srcExists && destExists" );
|
||||||
// Neat trick to handle errors.
|
// Neat trick to handle errors.
|
||||||
result = result && wxRenameFile( srcfile.GetFullPath(), tempname.GetFullPath(), true );
|
result = result && wxRenameFile( srcfile.GetFullPath(), tempname.GetFullPath(), true );
|
||||||
result = result && wxRenameFile( destfile.GetFullPath(), srcfile.GetFullPath(), false );
|
result = result && wxRenameFile( destfile.GetFullPath(), srcfile.GetFullPath(), false );
|
||||||
|
@ -408,10 +408,12 @@ public:
|
||||||
}
|
}
|
||||||
else if( destExists )
|
else if( destExists )
|
||||||
{
|
{
|
||||||
|
//Console.Warning( "destExists" );
|
||||||
result = wxRenameFile( destfile.GetFullPath(), srcfile.GetFullPath() );
|
result = wxRenameFile( destfile.GetFullPath(), srcfile.GetFullPath() );
|
||||||
}
|
}
|
||||||
else if( srcExists )
|
else if( srcExists )
|
||||||
{
|
{
|
||||||
|
//Console.Warning( "srcExists" );
|
||||||
result = wxRenameFile( srcfile.GetFullPath(), destfile.GetFullPath() );
|
result = wxRenameFile( srcfile.GetFullPath(), destfile.GetFullPath() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -577,7 +579,7 @@ void Panels::MemoryCardListPanel_Simple::OnCreateCard(wxCommandEvent& evt)
|
||||||
|
|
||||||
if( m_Cards[slot].IsPresent )
|
if( m_Cards[slot].IsPresent )
|
||||||
{
|
{
|
||||||
wxWindowID result = wxID_YES;
|
bool result = true;
|
||||||
if( m_Cards[slot].IsFormatted )
|
if( m_Cards[slot].IsFormatted )
|
||||||
{
|
{
|
||||||
wxString content;
|
wxString content;
|
||||||
|
@ -591,8 +593,9 @@ void Panels::MemoryCardListPanel_Simple::OnCreateCard(wxCommandEvent& evt)
|
||||||
result = Msgbox::YesNo( content, _("Delete memory card?") );
|
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() );
|
wxFileName fullpath( m_FolderPicker->GetPath() + g_Conf->Mcd[slot].Filename.GetFullName() );
|
||||||
wxRemoveFile( fullpath.GetFullPath() );
|
wxRemoveFile( fullpath.GetFullPath() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue