diff --git a/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp b/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp index 49781e826c..279ac55915 100644 --- a/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp +++ b/Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp @@ -313,6 +313,7 @@ void CheatSearchTab::CreateARCode(wxCommandEvent&) const u32 address = m_search_results[sel].address | ((m_search_type_size & ~1) << 24); CreateCodeDialog arcode_dlg(this, address); + arcode_dlg.SetExtraStyle(arcode_dlg.GetExtraStyle() & ~wxWS_EX_BLOCK_EVENTS); arcode_dlg.ShowModal(); } } diff --git a/Source/Core/DolphinWX/Cheats/CheatsWindow.cpp b/Source/Core/DolphinWX/Cheats/CheatsWindow.cpp index 9796f6a48c..03f63cf242 100644 --- a/Source/Core/DolphinWX/Cheats/CheatsWindow.cpp +++ b/Source/Core/DolphinWX/Cheats/CheatsWindow.cpp @@ -134,6 +134,7 @@ void wxCheatsWindow::Init_ChildControls() button_cancel->Bind(wxEVT_BUTTON, &wxCheatsWindow::OnEvent_ButtonClose_Press, this); Bind(wxEVT_CLOSE_WINDOW, &wxCheatsWindow::OnEvent_Close, this); + Bind(UPDATE_CHEAT_LIST_EVENT, &wxCheatsWindow::OnEvent_CheatsList_Update, this); wxStdDialogButtonSizer* const sButtons = new wxStdDialogButtonSizer(); sButtons->AddButton(m_button_apply); @@ -243,6 +244,11 @@ void wxCheatsWindow::OnEvent_CheatsList_ItemToggled(wxCommandEvent& WXUNUSED (ev } } +void wxCheatsWindow::OnEvent_CheatsList_Update(wxCommandEvent& event) +{ + Load_ARCodes(); +} + void wxCheatsWindow::OnEvent_ApplyChanges_Press(wxCommandEvent& ev) { // Apply AR Code changes diff --git a/Source/Core/DolphinWX/Cheats/CheatsWindow.h b/Source/Core/DolphinWX/Cheats/CheatsWindow.h index 2a83909db6..8586930fbc 100644 --- a/Source/Core/DolphinWX/Cheats/CheatsWindow.h +++ b/Source/Core/DolphinWX/Cheats/CheatsWindow.h @@ -93,6 +93,7 @@ private: // Cheats List void OnEvent_CheatsList_ItemSelected(wxCommandEvent& event); void OnEvent_CheatsList_ItemToggled(wxCommandEvent& event); + void OnEvent_CheatsList_Update(wxCommandEvent& event); // Apply Changes Button void OnEvent_ApplyChanges_Press(wxCommandEvent& event); diff --git a/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp b/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp index b266e9d7ab..aa4c0edbcc 100644 --- a/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp +++ b/Source/Core/DolphinWX/Cheats/CreateCodeDialog.cpp @@ -17,6 +17,9 @@ #include "DolphinWX/WxUtils.h" #include "DolphinWX/Cheats/CreateCodeDialog.h" +// Fired when an ActionReplay code is created. +wxDEFINE_EVENT(UPDATE_CHEAT_LIST_EVENT, wxCommandEvent); + CreateCodeDialog::CreateCodeDialog(wxWindow* const parent, const u32 address) : wxDialog(parent, -1, _("Create AR Code")) , m_code_address(address) @@ -95,6 +98,9 @@ void CreateCodeDialog::PressOK(wxCommandEvent& ev) //ActionReplay::UpdateActiveList(); } + // Propagate back to the parent frame to update the cheat list. + GetEventHandler()->AddPendingEvent(wxCommandEvent(UPDATE_CHEAT_LIST_EVENT)); + Close(); } diff --git a/Source/Core/DolphinWX/Cheats/CreateCodeDialog.h b/Source/Core/DolphinWX/Cheats/CreateCodeDialog.h index bcb10e92cc..97aed1728d 100644 --- a/Source/Core/DolphinWX/Cheats/CreateCodeDialog.h +++ b/Source/Core/DolphinWX/Cheats/CreateCodeDialog.h @@ -5,14 +5,16 @@ #pragma once #include +#include #include "Common/CommonTypes.h" class wxCheckBox; -class wxCommandEvent; class wxTextCtrl; class wxWindow; +wxDECLARE_EVENT(UPDATE_CHEAT_LIST_EVENT, wxCommandEvent); + class CreateCodeDialog final : public wxDialog { public: