fix bug by always enabling set of widgets for local player in case

prev invocation of dialog hid it.
This commit is contained in:
Andy2 2010-08-31 06:21:46 -07:00
parent 784b5c8cdf
commit cad2854d08

View file

@ -174,16 +174,6 @@ public class GameConfig extends Activity implements View.OnClickListener,
loadPlayers(); loadPlayers();
} }
}) })
.setNegativeButton( R.string.button_cancel,
new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dlg,
int whichButton ) {
m_notNetworkedGameCheckbx
.setChecked( true );
m_notNetworkedGame = true;
loadPlayers();
}
})
.create(); .create();
dialog.setOnDismissListener( new DialogInterface.OnDismissListener() { dialog.setOnDismissListener( new DialogInterface.OnDismissListener() {
@Override @Override
@ -254,6 +244,8 @@ public class GameConfig extends Activity implements View.OnClickListener,
Utils.setText( m_curDialog, R.id.player_name_edit, lp.name ); Utils.setText( m_curDialog, R.id.player_name_edit, lp.name );
Utils.setText( m_curDialog, R.id.password_edit, lp.password ); Utils.setText( m_curDialog, R.id.password_edit, lp.password );
final View localSet = m_curDialog.findViewById( R.id.local_player_set );
CheckBox check = (CheckBox) CheckBox check = (CheckBox)
m_curDialog.findViewById( R.id.remote_check ); m_curDialog.findViewById( R.id.remote_check );
if ( isServer ) { if ( isServer ) {
@ -261,15 +253,15 @@ public class GameConfig extends Activity implements View.OnClickListener,
new CompoundButton.OnCheckedChangeListener() { new CompoundButton.OnCheckedChangeListener() {
public void onCheckedChanged( CompoundButton buttonView, public void onCheckedChanged( CompoundButton buttonView,
boolean checked ) { boolean checked ) {
View view localSet.setVisibility( checked ?
= m_curDialog.findViewById( R.id.local_player_set ); View.GONE : View.VISIBLE );
view.setVisibility( checked ? View.GONE : View.VISIBLE );
} }
}; };
check.setOnCheckedChangeListener( lstnr ); check.setOnCheckedChangeListener( lstnr );
check.setVisibility( View.VISIBLE ); check.setVisibility( View.VISIBLE );
} else { } else {
check.setVisibility( View.GONE ); check.setVisibility( View.GONE );
localSet.setVisibility( View.VISIBLE );
} }
check = (CheckBox)m_curDialog.findViewById( R.id.robot_check ); check = (CheckBox)m_curDialog.findViewById( R.id.robot_check );