mirror of https://github.com/PCSX2/pcsx2.git
Resent ISO list menu: Items order reversed such the the most recent ones appear at the top.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4524 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
f76e0e1d0d
commit
b65a70033d
|
@ -121,7 +121,9 @@ void RecentIsoManager::Repopulate()
|
|||
|
||||
m_Separator = m_Menu->AppendSeparator();
|
||||
|
||||
for( int i=0; i<cnt; ++i )
|
||||
//Note: the internal recent iso list (m_Items) has the most recent item last (also at the INI file)
|
||||
// but the menu is composed in reverse order such that the most recent item appears at the top.
|
||||
for( int i=cnt-1; i>=0; --i )
|
||||
InsertIntoMenu( i );
|
||||
}
|
||||
|
||||
|
@ -152,25 +154,19 @@ void RecentIsoManager::Add( const wxString& src )
|
|||
}
|
||||
}
|
||||
|
||||
//New item doesn't exist at the menu/internal-list, add it.
|
||||
|
||||
//New item doesn't exist at the menu/internal-list - add it, and refresh the menu.
|
||||
RemoveAllFromMenu();
|
||||
|
||||
m_Items.push_back( RecentItem( normalized ) );
|
||||
InsertIntoMenu( m_Items.size()-1 );
|
||||
|
||||
while( m_Items.size() > m_MaxLength )
|
||||
{ //We're removing items from the internal list, need to keep the menu IDs in sync, by refreshing the menu.
|
||||
//This 'while' loop typically iterates at most once.
|
||||
RemoveAllFromMenu();
|
||||
m_Items.erase( m_Items.begin() );
|
||||
Repopulate();
|
||||
}
|
||||
|
||||
//check the new (last) item
|
||||
m_Items[m_Items.size()-1].ItemPtr->Check();
|
||||
m_cursel = m_Items.size()-1;
|
||||
Repopulate();
|
||||
m_Items[m_cursel = m_Items.size()-1].ItemPtr->Check();
|
||||
}
|
||||
|
||||
//id here is the position index at the list of recent ISOs
|
||||
//id here is the position index at the internal list of recent ISOs (m_Items)
|
||||
void RecentIsoManager::InsertIntoMenu( int id )
|
||||
{
|
||||
if( m_Menu == NULL ) return;
|
||||
|
|
Loading…
Reference in New Issue