This time when you click "Cancel" in Wiimote dialog, all changes are really discarded.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4700 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
ayuanx 2009-12-16 19:12:07 +00:00
parent 0ae7be2c1c
commit 84e6070e61
2 changed files with 24 additions and 13 deletions

View File

@ -68,6 +68,8 @@ WiimoteBasicConfigDialog::WiimoteBasicConfigDialog(wxWindow *parent, wxWindowID
void WiimoteBasicConfigDialog::OnClose(wxCloseEvent& event)
{
// necessary as this dialog is only showed/hided
UpdateGUI();
g_FrameOpen = false;
EndModal(wxID_CLOSE);
}
@ -124,7 +126,6 @@ void WiimoteBasicConfigDialog::ButtonClick(wxCommandEvent& event)
}
}
// Execute a delayed function
void WiimoteBasicConfigDialog::UpdateOnce(wxTimerEvent& event)
{
@ -455,20 +456,30 @@ void WiimoteBasicConfigDialog::UpdateIRCalibration()
void WiimoteBasicConfigDialog::UpdateGUI(int Slot)
{
// Update the Wiimote IR pointer calibration
UpdateIRCalibration();
/* We only allow a change of extension if we are not currently using the real Wiimote, if it's in use the status will be updated
from the data scanning functions in main.cpp */
bool AllowExtensionChange = !(g_RealWiiMotePresent && g_Config.bConnectRealWiimote && g_Config.bUseRealWiimote && g_EmulatorRunning);
extensionChoice[Page]->SetSelection(g_Config.iExtensionConnected);
extensionChoice[Page]->Enable(AllowExtensionChange);
/* I have disabled this option during a running game because it's enough to be able to switch
between using and not using then. To also use the connect option during a running game would
mean that the wiimote must be sent the current reporting mode and the channel ID after it
has been initialized. Functions for that are basically already in place so these two options
could possibly be simplified to one option. */
m_ConnectRealWiimote[Page]->SetValue(g_Config.bConnectRealWiimote);
m_ConnectRealWiimote[Page]->Enable(!g_EmulatorRunning);
m_UseRealWiimote[Page]->SetValue(g_Config.bUseRealWiimote);
m_UseRealWiimote[Page]->Enable((m_bEnableUseRealWiimote && g_RealWiiMotePresent && g_Config.bConnectRealWiimote) || (!g_EmulatorRunning && g_Config.bConnectRealWiimote));
m_InputActive[Page]->SetValue(g_Config.bInputActive);
m_SidewaysWiimote[Page]->SetValue(g_Config.bSideways);
m_UprightWiimote[Page]->SetValue(g_Config.bUpright);
m_WiiMotionPlusConnected[Page]->SetValue(g_Config.bMotionPlusConnected);
/* We only allow a change of extension if we are not currently using the real Wiimote, if it's in use the status will be updated
from the data scanning functions in main.cpp */
bool AllowExtensionChange = !(g_RealWiiMotePresent && g_Config.bConnectRealWiimote && g_Config.bUseRealWiimote && g_EmulatorRunning);
extensionChoice[Page]->SetSelection(g_Config.iExtensionConnected);
extensionChoice[Page]->Enable(AllowExtensionChange);
// Update the Wiimote IR pointer calibration
UpdateIRCalibration();
}

View File

@ -260,7 +260,7 @@ void WiimotePadConfigDialog::DoSave(bool ChangePad, int Slot)
for(int i = 0; i < 1; i++) // Only got 1 wiimote yet
SaveButtonMapping(i, true);
// Save the settings for the current pad
g_Config.Save(Slot);
// g_Config.Save(Slot);
// Now we can update the ID
WiiMoteEmu::PadMapping[Page].ID = m_Joyname[Page]->GetSelection();
}
@ -269,7 +269,7 @@ void WiimotePadConfigDialog::DoSave(bool ChangePad, int Slot)
// Update PadMapping[] from the GUI controls
for(int i = 0; i < 1; i++) // Only got 1 wiimote yet
SaveButtonMapping(i);
g_Config.Save(Slot);
// g_Config.Save(Slot);
}
// Then change it back to ""
@ -987,7 +987,7 @@ void WiimotePadConfigDialog::GeneralSettingsChanged(wxCommandEvent& event)
SaveButtonMappingAll(Page);
break;
}
g_Config.Save();
// g_Config.Save();
UpdateGUI();
}