From b65a70033d04ee74b5baaf0d7894812e21dc2175 Mon Sep 17 00:00:00 2001 From: "avihal@gmail.com" Date: Sat, 2 Apr 2011 08:09:36 +0000 Subject: [PATCH] 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 --- pcsx2/gui/RecentIsoList.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pcsx2/gui/RecentIsoList.cpp b/pcsx2/gui/RecentIsoList.cpp index e9d8e1504a..25ad64f14b 100644 --- a/pcsx2/gui/RecentIsoList.cpp +++ b/pcsx2/gui/RecentIsoList.cpp @@ -121,7 +121,9 @@ void RecentIsoManager::Repopulate() m_Separator = m_Menu->AppendSeparator(); - for( int i=0; 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;