summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Config
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-23 17:32:15 -0700
committerGitHub <noreply@github.com>2017-06-23 17:32:15 -0700
commitced53e29200e3d02dbbc218bccc8b8a8826ef7a7 (patch)
treeed4cb548a2864fa52b4d78d4251a53e4e87c792b /Source/Core/DolphinWX/Config
parent1bd177561bf54e58855237e6c30c7bcaa39ab7e2 (diff)
parenta66b747366c8dc36cb4ed6f40efee679e9516749 (diff)
Merge pull request #5659 from shuffle2/gamelist-speedup-with-emustate
Gamelist speedup with emustate
Diffstat (limited to 'Source/Core/DolphinWX/Config')
-rw-r--r--Source/Core/DolphinWX/Config/ConfigMain.cpp21
-rw-r--r--Source/Core/DolphinWX/Config/ConfigMain.h7
-rw-r--r--Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp5
-rw-r--r--Source/Core/DolphinWX/Config/PathConfigPane.cpp6
4 files changed, 24 insertions, 15 deletions
diff --git a/Source/Core/DolphinWX/Config/ConfigMain.cpp b/Source/Core/DolphinWX/Config/ConfigMain.cpp
index 48fd35ab96..b04f2cc706 100644
--- a/Source/Core/DolphinWX/Config/ConfigMain.cpp
+++ b/Source/Core/DolphinWX/Config/ConfigMain.cpp
@@ -24,21 +24,21 @@
#include "DolphinWX/GameListCtrl.h"
#include "DolphinWX/WxUtils.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);
+wxDEFINE_EVENT(wxDOLPHIN_CFG_RESCAN_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
- m_refresh_game_list_on_close = false;
+ // Control refreshing of the GameListCtrl
+ m_event_on_close = wxEVT_NULL;
Bind(wxEVT_CLOSE_WINDOW, &CConfigMain::OnClose, this);
Bind(wxEVT_BUTTON, &CConfigMain::OnCloseButton, this, wxID_CLOSE);
Bind(wxEVT_SHOW, &CConfigMain::OnShow, this);
Bind(wxDOLPHIN_CFG_REFRESH_LIST, &CConfigMain::OnSetRefreshGameListOnClose, this);
+ Bind(wxDOLPHIN_CFG_RESCAN_LIST, &CConfigMain::OnSetRescanGameListOnClose, this);
wxDialog::SetExtraStyle(GetExtraStyle() & ~wxWS_EX_BLOCK_EVENTS);
@@ -115,8 +115,8 @@ void CConfigMain::OnClose(wxCloseEvent& WXUNUSED(event))
SConfig::GetInstance().SaveSettings();
- if (m_refresh_game_list_on_close)
- AddPendingEvent(wxCommandEvent{DOLPHIN_EVT_RELOAD_GAMELIST});
+ if (m_event_on_close != wxEVT_NULL)
+ AddPendingEvent(wxCommandEvent{m_event_on_close});
}
void CConfigMain::OnShow(wxShowEvent& event)
@@ -132,5 +132,12 @@ void CConfigMain::OnCloseButton(wxCommandEvent& WXUNUSED(event))
void CConfigMain::OnSetRefreshGameListOnClose(wxCommandEvent& WXUNUSED(event))
{
- m_refresh_game_list_on_close = true;
+ // Don't override a rescan
+ if (m_event_on_close == wxEVT_NULL)
+ m_event_on_close = DOLPHIN_EVT_REFRESH_GAMELIST;
+}
+
+void CConfigMain::OnSetRescanGameListOnClose(wxCommandEvent& WXUNUSED(event))
+{
+ m_event_on_close = DOLPHIN_EVT_RESCAN_GAMELIST;
}
diff --git a/Source/Core/DolphinWX/Config/ConfigMain.h b/Source/Core/DolphinWX/Config/ConfigMain.h
index 84c2f9121f..005797308b 100644
--- a/Source/Core/DolphinWX/Config/ConfigMain.h
+++ b/Source/Core/DolphinWX/Config/ConfigMain.h
@@ -10,7 +10,10 @@
class wxNotebook;
class wxPanel;
+// Fast refresh - can be fulfilled from cache
wxDECLARE_EVENT(wxDOLPHIN_CFG_REFRESH_LIST, wxCommandEvent);
+// Rescan and refresh - modifies cache
+wxDECLARE_EVENT(wxDOLPHIN_CFG_RESCAN_LIST, wxCommandEvent);
class CConfigMain : public wxDialog
{
@@ -41,8 +44,8 @@ private:
void OnCloseButton(wxCommandEvent& event);
void OnShow(wxShowEvent& event);
void OnSetRefreshGameListOnClose(wxCommandEvent& event);
+ void OnSetRescanGameListOnClose(wxCommandEvent& event);
wxNotebook* Notebook;
-
- bool m_refresh_game_list_on_close;
+ wxEventType m_event_on_close;
};
diff --git a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp
index 278e1697c3..d3308bc22e 100644
--- a/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp
+++ b/Source/Core/DolphinWX/Config/InterfaceConfigPane.cpp
@@ -196,9 +196,8 @@ void InterfaceConfigPane::LoadGUIValues()
void InterfaceConfigPane::LoadThemes()
{
- auto sv = Common::DoFileSearch(
- {""}, {File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR},
- /*recursive*/ false);
+ auto sv =
+ Common::DoFileSearch({File::GetUserPath(D_THEMES_IDX), File::GetSysDirectory() + THEMES_DIR});
for (const std::string& filename : sv)
{
std::string name, ext;
diff --git a/Source/Core/DolphinWX/Config/PathConfigPane.cpp b/Source/Core/DolphinWX/Config/PathConfigPane.cpp
index 5a0a1c1c13..ec3376acc2 100644
--- a/Source/Core/DolphinWX/Config/PathConfigPane.cpp
+++ b/Source/Core/DolphinWX/Config/PathConfigPane.cpp
@@ -163,7 +163,7 @@ void PathConfigPane::OnRecursiveISOCheckBoxChanged(wxCommandEvent& event)
{
SConfig::GetInstance().m_RecursiveISOFolder = m_recursive_iso_paths_checkbox->IsChecked();
- AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_REFRESH_LIST));
+ AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_RESCAN_LIST));
}
void PathConfigPane::OnAddISOPath(wxCommandEvent& event)
@@ -179,7 +179,7 @@ void PathConfigPane::OnAddISOPath(wxCommandEvent& event)
}
else
{
- AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_REFRESH_LIST));
+ AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_RESCAN_LIST));
m_iso_paths_listbox->Append(dialog.GetPath());
}
}
@@ -189,7 +189,7 @@ void PathConfigPane::OnAddISOPath(wxCommandEvent& event)
void PathConfigPane::OnRemoveISOPath(wxCommandEvent& event)
{
- AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_REFRESH_LIST));
+ AddPendingEvent(wxCommandEvent(wxDOLPHIN_CFG_RESCAN_LIST));
m_iso_paths_listbox->Delete(m_iso_paths_listbox->GetSelection());
// This seems to not be activated on Windows when it should be. wxw bug?