mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Save secondary list sorting.
Allow sorting by platform ascending. Fixes issue 5774.
This commit is contained in:
@ -51,6 +51,7 @@
|
||||
size_t CGameListCtrl::m_currentItem = 0;
|
||||
size_t CGameListCtrl::m_numberItem = 0;
|
||||
std::string CGameListCtrl::m_currentFilename;
|
||||
bool sorted = false;
|
||||
|
||||
static int CompareGameListItems(const GameListItem* iso1, const GameListItem* iso2,
|
||||
long sortData = CGameListCtrl::COLUMN_TITLE)
|
||||
@ -284,6 +285,7 @@ void CGameListCtrl::Update()
|
||||
InitBitmaps();
|
||||
|
||||
// add columns
|
||||
InsertColumn(COLUMN_DUMMY,_T(""));
|
||||
InsertColumn(COLUMN_PLATFORM, _T(""));
|
||||
InsertColumn(COLUMN_BANNER, _("Banner"));
|
||||
InsertColumn(COLUMN_TITLE, _("Title"));
|
||||
@ -303,6 +305,7 @@ void CGameListCtrl::Update()
|
||||
#endif
|
||||
|
||||
// set initial sizes for columns
|
||||
SetColumnWidth(COLUMN_DUMMY,0);
|
||||
SetColumnWidth(COLUMN_PLATFORM, 35 + platform_padding);
|
||||
SetColumnWidth(COLUMN_BANNER, 96 + platform_padding);
|
||||
SetColumnWidth(COLUMN_TITLE, 200 + platform_padding);
|
||||
@ -320,9 +323,14 @@ void CGameListCtrl::Update()
|
||||
|
||||
// Sort items by Title
|
||||
wxListEvent event;
|
||||
event.m_col = SConfig::GetInstance().m_ListSort; last_column = 0;
|
||||
event.m_col = SConfig::GetInstance().m_ListSort2;
|
||||
last_column = 1;
|
||||
OnColumnClick(event);
|
||||
|
||||
event.m_col = SConfig::GetInstance().m_ListSort;
|
||||
OnColumnClick(event);
|
||||
sorted = true;
|
||||
|
||||
SetColumnWidth(COLUMN_SIZE, wxLIST_AUTOSIZE);
|
||||
}
|
||||
else
|
||||
@ -414,9 +422,11 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
|
||||
GameListItem& rISOFile = *m_ISOFiles[_Index];
|
||||
m_gamePath.append(rISOFile.GetFileName() + '\n');
|
||||
|
||||
// Insert a first row with the platform image, that will be used as the Index
|
||||
long ItemIndex = InsertItem(_Index, wxEmptyString,
|
||||
m_PlatformImageIndex[rISOFile.GetPlatform()]);
|
||||
// Insert a first row with nothing in it, that will be used as the Index
|
||||
long ItemIndex = InsertItem(_Index, wxEmptyString);
|
||||
|
||||
// Insert the platform's image in the first (visible) column
|
||||
SetItemColumnImage(_Index, COLUMN_PLATFORM, m_PlatformImageIndex[rISOFile.GetPlatform()]);
|
||||
|
||||
if (rISOFile.GetImage().IsOk())
|
||||
ImageIndex = m_imageListSmall->Add(rISOFile.GetImage());
|
||||
@ -702,17 +712,19 @@ void CGameListCtrl::OnColumnClick(wxListEvent& event)
|
||||
{
|
||||
int current_column = event.GetColumn();
|
||||
|
||||
if(last_column == current_column)
|
||||
if (last_column == current_column)
|
||||
{
|
||||
last_sort = -last_sort;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sorted)
|
||||
SConfig::GetInstance().m_ListSort2 = last_sort;
|
||||
last_column = current_column;
|
||||
last_sort = current_column;
|
||||
}
|
||||
|
||||
SConfig::GetInstance().m_ListSort = last_sort;
|
||||
if (sorted)
|
||||
SConfig::GetInstance().m_ListSort = last_sort;
|
||||
caller = this;
|
||||
SortItems(wxListCompare, last_sort);
|
||||
}
|
||||
|
@ -57,7 +57,8 @@ public:
|
||||
|
||||
enum
|
||||
{
|
||||
COLUMN_PLATFORM = 0,
|
||||
COLUMN_DUMMY = 0,
|
||||
COLUMN_PLATFORM,
|
||||
COLUMN_BANNER,
|
||||
COLUMN_TITLE,
|
||||
COLUMN_NOTES,
|
||||
|
Reference in New Issue
Block a user