Save game list sorting.

Fixes issue 5771.
This commit is contained in:
rog 2012-12-08 23:22:29 -05:00
parent 4fc0125fb3
commit 43d673b576
3 changed files with 10 additions and 6 deletions

View File

@ -211,6 +211,7 @@ void SConfig::SaveSettings()
ini.Set("GameList", "ListKorea", m_ListKorea);
ini.Set("GameList", "ListTaiwan", m_ListTaiwan);
ini.Set("GameList", "ListUnknown", m_ListUnknown);
ini.Set("GameList", "ListSort", m_ListSort);
// Core
ini.Set("Core", "HLE_BS2", m_LocalCoreStartupParameter.bHLE_BS2);
@ -344,11 +345,12 @@ void SConfig::LoadSettings()
ini.Get("GameList", "ListPal", &m_ListPal, true);
ini.Get("GameList", "ListUsa", &m_ListUsa, true);
ini.Get("GameList", "ListFrance", &m_ListFrance, true);
ini.Get("GameList", "ListItaly", &m_ListItaly, true);
ini.Get("GameList", "ListKorea", &m_ListKorea, true);
ini.Get("GameList", "ListTaiwan", &m_ListTaiwan, true);
ini.Get("GameList", "ListUnknown", &m_ListUnknown, true);
ini.Get("GameList", "ListFrance", &m_ListFrance, true);
ini.Get("GameList", "ListItaly", &m_ListItaly, true);
ini.Get("GameList", "ListKorea", &m_ListKorea, true);
ini.Get("GameList", "ListTaiwan", &m_ListTaiwan, true);
ini.Get("GameList", "ListUnknown", &m_ListUnknown, true);
ini.Get("GameList", "ListSort", &m_ListSort, 2);
// Core
ini.Get("Core", "HLE_BS2", &m_LocalCoreStartupParameter.bHLE_BS2, false);

View File

@ -62,6 +62,7 @@ struct SConfig : NonCopyable
bool m_InterfaceLogWindow;
bool m_InterfaceLogConfigWindow;
bool m_InterfaceConsole;
int m_ListSort;
bool m_ListDrives;
bool m_ListWad;

View File

@ -320,7 +320,7 @@ void CGameListCtrl::Update()
// Sort items by Title
wxListEvent event;
event.m_col = COLUMN_TITLE; last_column = 0;
event.m_col = SConfig::GetInstance().m_ListSort; last_column = 0;
OnColumnClick(event);
SetColumnWidth(COLUMN_SIZE, wxLIST_AUTOSIZE);
@ -708,6 +708,7 @@ void CGameListCtrl::OnColumnClick(wxListEvent& event)
last_sort = current_column;
}
SConfig::GetInstance().m_ListSort = last_sort;
caller = this;
SortItems(wxListCompare, last_sort);
}