fix new game creation putting list into state where games couldn't be

launched: don't use m_launchedGame except to track that the UI's
launched a game.
This commit is contained in:
Eric House 2014-07-13 09:09:48 -07:00
parent 229d179b46
commit 079859f510

View file

@ -161,6 +161,14 @@ public class GamesListDelegate extends ListDelegateBase
return result; return result;
} }
void setSelected( long rowID, boolean selected )
{
Set<GameListItem> games = getGamesFromElems( rowID );
if ( 1 == games.size() ) {
games.iterator().next().setSelected( selected );
}
}
void invalName( long rowID ) void invalName( long rowID )
{ {
Set<GameListItem> games = getGamesFromElems( rowID ); Set<GameListItem> games = getGamesFromElems( rowID );
@ -838,14 +846,7 @@ public class GamesListDelegate extends ListDelegateBase
updateField(); updateField();
if ( DBUtils.ROWID_NOTFOUND != m_launchedGame ) { if ( DBUtils.ROWID_NOTFOUND != m_launchedGame ) {
clearSelections(); setSelGame( m_launchedGame );
GameListItem item = m_adapter.reloadGame( m_launchedGame );
if ( null != item ) { // currently visible in list?
item.setSelected( true );
}
m_selGames.add( m_launchedGame );
m_launchedGame = DBUtils.ROWID_NOTFOUND; m_launchedGame = DBUtils.ROWID_NOTFOUND;
} }
} }
@ -881,7 +882,7 @@ public class GamesListDelegate extends ListDelegateBase
break; break;
case GAME_CREATED: case GAME_CREATED:
mkListAdapter(); mkListAdapter();
m_launchedGame = rowid; setSelGame( rowid );
break; break;
default: default:
Assert.fail(); Assert.fail();
@ -1631,6 +1632,14 @@ public class GamesListDelegate extends ListDelegateBase
return madeGame; return madeGame;
} }
private void setSelGame( long rowid )
{
clearSelections();
m_selGames.add( rowid );
m_adapter.setSelected( rowid, true );
}
private void clearSelections() private void clearSelections()
{ {
boolean inval = false; boolean inval = false;