Fix the PadSimple and GCPad plugins so their dialogs close properly.

Get rid of g_FrameOpen variable in Wiimote plugin.  It isn't needed anymore.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4948 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Glenn Rice 2010-01-24 14:41:53 +00:00
parent 177ec96472
commit afb82b1d8c
5 changed files with 10 additions and 17 deletions

View File

@ -161,8 +161,9 @@ void DllConfig(HWND _hParent)
{ {
m_ConfigFrame = new GCPadConfigDialog(GetParentedWxWindow(_hParent)); m_ConfigFrame = new GCPadConfigDialog(GetParentedWxWindow(_hParent));
m_ConfigFrame->ShowModal(); m_ConfigFrame->ShowModal();
m_ConfigFrame->Destroy();
delete m_ConfigFrame; delete m_ConfigFrame;
m_ConfigFrame = 0; m_ConfigFrame = NULL;
} }
#endif #endif
} }

View File

@ -623,16 +623,11 @@ void DllConfig(HWND _hParent)
// Show wxDialog // Show wxDialog
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
if (!m_ConfigFrame) m_ConfigFrame = new PADConfigDialogSimple(GetParentedWxWindow(_hParent));
m_ConfigFrame = new PADConfigDialogSimple(GetParentedWxWindow(_hParent)); m_ConfigFrame->ShowModal();
else if (!m_ConfigFrame->GetParent()->IsShown()) m_ConfigFrame->Destroy();
m_ConfigFrame->Close(true); delete m_ConfigFrame;
m_ConfigFrame = NULL;
// Only allow one open at a time
if (!m_ConfigFrame->IsShown())
m_ConfigFrame->ShowModal();
else
m_ConfigFrame->Hide();
#endif #endif
// Save configuration // Save configuration

View File

@ -76,7 +76,6 @@ WiimoteBasicConfigDialog::WiimoteBasicConfigDialog(wxWindow *parent, wxWindowID
void WiimoteBasicConfigDialog::OnClose(wxCloseEvent& event) void WiimoteBasicConfigDialog::OnClose(wxCloseEvent& event)
{ {
g_FrameOpen = false;
EndModal(wxID_CLOSE); EndModal(wxID_CLOSE);
} }

View File

@ -50,7 +50,6 @@ PLUGIN_GLOBALS* globals = NULL;
// General // General
bool g_EmulatorRunning = false; bool g_EmulatorRunning = false;
u32 g_ISOId = 0; u32 g_ISOId = 0;
bool g_FrameOpen = false;
bool g_SearchDeviceDone = false; bool g_SearchDeviceDone = false;
bool g_RealWiiMotePresent = false; bool g_RealWiiMotePresent = false;
bool g_RealWiiMoteInitialized = false; bool g_RealWiiMoteInitialized = false;
@ -184,9 +183,10 @@ void DllConfig(HWND _hParent)
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
m_BasicConfigFrame = new WiimoteBasicConfigDialog(GetParentedWxWindow(_hParent)); m_BasicConfigFrame = new WiimoteBasicConfigDialog(GetParentedWxWindow(_hParent));
g_FrameOpen = true;
m_BasicConfigFrame->ShowModal(); m_BasicConfigFrame->ShowModal();
m_BasicConfigFrame->Destroy(); m_BasicConfigFrame->Destroy();
delete m_BasicConfigFrame;
m_BasicConfigFrame = NULL;
#endif #endif
} }
@ -199,7 +199,7 @@ void Initialize(void *init)
// Update the GUI if the configuration window is already open // Update the GUI if the configuration window is already open
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
if (g_FrameOpen) if (m_BasicConfigFrame)
{ {
// Save the settings // Save the settings
g_Config.Save(); g_Config.Save();
@ -263,7 +263,6 @@ void DoState(unsigned char **ptr, int mode)
//p.Do(g_EmulatorRunning); //p.Do(g_EmulatorRunning);
//p.Do(g_ISOId); //p.Do(g_ISOId);
//p.Do(g_FrameOpen);
//p.Do(g_RealWiiMotePresent); //p.Do(g_RealWiiMotePresent);
//p.Do(g_RealWiiMoteInitialized); //p.Do(g_RealWiiMoteInitialized);
//p.Do(g_EmulatedWiiMoteInitialized); //p.Do(g_EmulatedWiiMoteInitialized);

View File

@ -61,7 +61,6 @@ struct SRecordingAll
// General // General
extern bool g_EmulatorRunning; extern bool g_EmulatorRunning;
extern u32 g_ISOId; extern u32 g_ISOId;
extern bool g_FrameOpen;
extern bool g_SearchDeviceDone; extern bool g_SearchDeviceDone;
extern bool g_RealWiiMotePresent; extern bool g_RealWiiMotePresent;
extern bool g_RealWiiMoteInitialized; extern bool g_RealWiiMoteInitialized;