summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Config/ConfigMain.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2015-03-18 20:33:20 -0400
committerLioncash <mathew1800@gmail.com>2015-03-18 22:48:05 -0400
commitb459a8ec61c1c10f4484edaa02908f9ed90b1e15 (patch)
tree91dbabe24b0e02d99a225bc5f0c4fee82518cbc3 /Source/Core/DolphinWX/Config/ConfigMain.cpp
parentfebd3909c6be90ad289a3a8f934fdb4bea70c5fa (diff)
DolphinWX: Propagate event to refresh the game list
Prior to this refactor, certain options would cause the game list to refresh when the config modal dialog is closed (such as adding a folder to the path list). This restores that functionality.
Diffstat (limited to 'Source/Core/DolphinWX/Config/ConfigMain.cpp')
-rw-r--r--Source/Core/DolphinWX/Config/ConfigMain.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/Core/DolphinWX/Config/ConfigMain.cpp b/Source/Core/DolphinWX/Config/ConfigMain.cpp
index 334ef7df97..3bd1bb9520 100644
--- a/Source/Core/DolphinWX/Config/ConfigMain.cpp
+++ b/Source/Core/DolphinWX/Config/ConfigMain.cpp
@@ -19,15 +19,20 @@
#include "DolphinWX/Config/PathConfigPane.h"
#include "DolphinWX/Config/WiiConfigPane.h"
+// Sent by child panes to signify that the game list should
+// be updated when this modal dialog closes.
+wxDEFINE_EVENT(wxDOLPHIN_CFG_REFRESH_LIST, wxCommandEvent);
+
CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
const wxPoint& position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
// Control refreshing of the ISOs list
- bRefreshList = false;
+ m_refresh_game_list_on_close = false;
Bind(wxEVT_CLOSE_WINDOW, &CConfigMain::OnClose, this);
Bind(wxEVT_BUTTON, &CConfigMain::OnOk, this, wxID_OK);
+ Bind(wxDOLPHIN_CFG_REFRESH_LIST, &CConfigMain::OnSetRefreshGameListOnClose, this);
CreateGUIControls();
}
@@ -79,7 +84,7 @@ void CConfigMain::CreateGUIControls()
void CConfigMain::OnClose(wxCloseEvent& WXUNUSED(event))
{
- EndModal((bRefreshList) ? wxID_OK : wxID_CANCEL);
+ EndModal((m_refresh_game_list_on_close) ? wxID_OK : wxID_CANCEL);
}
void CConfigMain::OnOk(wxCommandEvent& WXUNUSED(event))
@@ -89,3 +94,8 @@ void CConfigMain::OnOk(wxCommandEvent& WXUNUSED(event))
// Save the config. Dolphin crashes too often to only save the settings on closing
SConfig::GetInstance().SaveSettings();
}
+
+void CConfigMain::OnSetRefreshGameListOnClose(wxCommandEvent& WXUNUSED(event))
+{
+ m_refresh_game_list_on_close = true;
+}