Memcard Manager:

- Suspend emulation when opening the manager. Avoids all kinds of file access permission trouble.


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4362 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2011-02-25 20:20:04 +00:00
parent d1371e85f6
commit c86fff7760
2 changed files with 15 additions and 1 deletions

View File

@ -129,6 +129,7 @@ namespace Dialogs
protected: protected:
Panels::BaseMcdListPanel* m_panel_mcdlist; Panels::BaseMcdListPanel* m_panel_mcdlist;
bool m_needs_suspending;
public: public:
virtual ~McdConfigDialog() throw() {} virtual ~McdConfigDialog() throw() {}

View File

@ -95,6 +95,7 @@ Dialogs::McdConfigDialog::McdConfigDialog( wxWindow* parent )
: BaseConfigurationDialog( parent, _("MemoryCard Manager"), 600 ) : BaseConfigurationDialog( parent, _("MemoryCard Manager"), 600 )
{ {
m_panel_mcdlist = new MemoryCardListPanel_Simple( this ); m_panel_mcdlist = new MemoryCardListPanel_Simple( this );
m_needs_suspending = false;
// [TODO] : Plan here is to add an advanced tab which gives the user the ability // [TODO] : Plan here is to add an advanced tab which gives the user the ability
// to configure the names of each memory card slot. // to configure the names of each memory card slot.
@ -128,6 +129,18 @@ void Dialogs::McdConfigDialog::OnMultitapClicked( wxCommandEvent& evt )
bool Dialogs::McdConfigDialog::Show( bool show ) bool Dialogs::McdConfigDialog::Show( bool show )
{ {
// Suspend the emulation before any file operations on the memory cards can be done.
if( show && CoreThread.IsRunning() )
{
m_needs_suspending = true;
CoreThread.Suspend();
}
else if( !show && m_needs_suspending == true )
{
m_needs_suspending = false;
CoreThread.Resume();
}
if( show && m_panel_mcdlist ) if( show && m_panel_mcdlist )
m_panel_mcdlist->OnShown(); m_panel_mcdlist->OnShown();