mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
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:
parent
229d179b46
commit
079859f510
1 changed files with 18 additions and 9 deletions
|
@ -161,6 +161,14 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
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 )
|
||||
{
|
||||
Set<GameListItem> games = getGamesFromElems( rowID );
|
||||
|
@ -838,14 +846,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
updateField();
|
||||
|
||||
if ( DBUtils.ROWID_NOTFOUND != m_launchedGame ) {
|
||||
clearSelections();
|
||||
|
||||
GameListItem item = m_adapter.reloadGame( m_launchedGame );
|
||||
if ( null != item ) { // currently visible in list?
|
||||
item.setSelected( true );
|
||||
}
|
||||
m_selGames.add( m_launchedGame );
|
||||
|
||||
setSelGame( m_launchedGame );
|
||||
m_launchedGame = DBUtils.ROWID_NOTFOUND;
|
||||
}
|
||||
}
|
||||
|
@ -881,7 +882,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
break;
|
||||
case GAME_CREATED:
|
||||
mkListAdapter();
|
||||
m_launchedGame = rowid;
|
||||
setSelGame( rowid );
|
||||
break;
|
||||
default:
|
||||
Assert.fail();
|
||||
|
@ -1631,6 +1632,14 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
return madeGame;
|
||||
}
|
||||
|
||||
private void setSelGame( long rowid )
|
||||
{
|
||||
clearSelections();
|
||||
|
||||
m_selGames.add( rowid );
|
||||
m_adapter.setSelected( rowid, true );
|
||||
}
|
||||
|
||||
private void clearSelections()
|
||||
{
|
||||
boolean inval = false;
|
||||
|
|
Loading…
Reference in a new issue