From f1f5b63a0df7addc609a5f62a0a59a0c4ffd0cf8 Mon Sep 17 00:00:00 2001 From: eehouse Date: Thu, 8 Apr 2010 04:12:51 +0000 Subject: [PATCH] put ok/cancel buttons back on player edit dialog. Just feels better that way. --- .../org/eehouse/android/xw4/GameConfig.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java index 9457c1f8e..f640a2145 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GameConfig.java @@ -127,15 +127,16 @@ public class GameConfig extends Activity implements View.OnClickListener { dialog = new AlertDialog.Builder( this ) .setTitle(R.string.player_edit_title) .setView(playerEditView) + .setPositiveButton( R.string.button_ok, + new DialogInterface.OnClickListener() { + public void onClick( DialogInterface dlg, + int whichButton ) { + getPlayerSettings(); + loadPlayers(); + } + }) + .setNegativeButton( R.string.button_cancel, null ) .create(); - dialog.setOnDismissListener( new DialogInterface.OnDismissListener() { - @Override - public void onDismiss( DialogInterface di ) - { - getPlayerSettings(); - loadPlayers(); - } - }); break; case ROLE_EDIT_RELAY: case ROLE_EDIT_SMS: @@ -159,6 +160,14 @@ public class GameConfig extends Activity implements View.OnClickListener { .setTitle( R.string.force_title ) .setView( LayoutInflater.from(this) .inflate( layoutForDlg(id), null ) ) + .setPositiveButton( R.string.button_ok, + new DialogInterface.OnClickListener() { + public void onClick( DialogInterface dlg, + int whichButton ) { + loadPlayers(); + } + }) + .setNegativeButton( R.string.button_cancel, null ) .create(); dialog.setOnDismissListener( new DialogInterface.OnDismissListener() { @Override @@ -168,8 +177,8 @@ public class GameConfig extends Activity implements View.OnClickListener { // force one to remote -- or make it // standalone??? m_gi.players[0].isLocal = false; + loadPlayers(); } - loadPlayers(); } }); break;