fix getting wrong networked window title even when configuring a

non-networked game.  And remove no-op method call.
This commit is contained in:
Andy2 2011-05-10 18:24:57 -07:00
parent 75e41caf90
commit 472ffd02bf

View file

@ -395,10 +395,7 @@ public class GameConfig extends XWActivity
m_phoniesSpinner = (Spinner)findViewById( R.id.phonies_spinner ); m_phoniesSpinner = (Spinner)findViewById( R.id.phonies_spinner );
m_smartnessSpinner = (Spinner)findViewById( R.id.smart_robot ); m_smartnessSpinner = (Spinner)findViewById( R.id.smart_robot );
String fmt = getString( m_notNetworkedGame ? setTitle();
R.string.title_game_configf
: R.string.title_gamenet_configf );
setTitle( String.format( fmt, GameUtils.gameName( this, m_path ) ) );
} // onCreate } // onCreate
@Override @Override
@ -414,7 +411,6 @@ public class GameConfig extends XWActivity
GameUtils.loadMakeGame( this, gamePtr, m_giOrig, m_gameLock ); GameUtils.loadMakeGame( this, gamePtr, m_giOrig, m_gameLock );
m_gameStarted = XwJNI.model_getNMoves( gamePtr ) > 0 m_gameStarted = XwJNI.model_getNMoves( gamePtr ) > 0
|| XwJNI.comms_isConnected( gamePtr ); || XwJNI.comms_isConnected( gamePtr );
m_giOrig.setInProgress( m_gameStarted );
if ( m_gameStarted ) { if ( m_gameStarted ) {
if ( null == m_gameLockedCheck ) { if ( null == m_gameLockedCheck ) {
@ -442,6 +438,7 @@ public class GameConfig extends XWActivity
m_car = new CommsAddrRec( m_carOrig ); m_car = new CommsAddrRec( m_carOrig );
m_notNetworkedGame = DeviceRole.SERVER_STANDALONE == m_gi.serverRole; m_notNetworkedGame = DeviceRole.SERVER_STANDALONE == m_gi.serverRole;
setTitle();
if ( !m_notNetworkedGame ) { if ( !m_notNetworkedGame ) {
m_joinPublicCheck = m_joinPublicCheck =
@ -977,4 +974,12 @@ public class GameConfig extends XWActivity
m_gi.nPlayers, m_roomChoose ).execute(); m_gi.nPlayers, m_roomChoose ).execute();
} }
private void setTitle()
{
String fmt = getString( m_notNetworkedGame ?
R.string.title_game_configf
: R.string.title_gamenet_configf );
setTitle( String.format( fmt, GameUtils.gameName( this, m_path ) ) );
}
} }