DroidFish: Removed the obsolete "go to move" item in the options menu.

This commit is contained in:
Peter Osterlund 2015-12-21 20:51:51 +01:00
parent 1949a4378e
commit d436b8567e
12 changed files with 8 additions and 89 deletions

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/move_number"
android:paddingRight="10dp">
</TextView>
<EditText
android:id="@+id/selmove_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minEms="3"
android:inputType="number">
</EditText>
</LinearLayout>

View File

@ -6,16 +6,6 @@
android:title="@string/option_new_game"
android:icon="@android:drawable/ic_menu_add">
</item>
<item
android:id="@+id/item_file_menu"
android:title="@string/option_file"
android:icon="@android:drawable/ic_menu_save">
</item>
<item
android:id="@+id/item_resign"
android:title="@string/option_resign_game"
android:icon="@android:drawable/ic_menu_delete">
</item>
<item
android:id="@+id/item_editboard"
android:title="@string/option_edit_board"
@ -27,9 +17,14 @@
android:icon="@android:drawable/ic_menu_preferences">
</item>
<item
android:id="@+id/item_goto_move"
android:title="@string/option_goto_move"
android:icon="@android:drawable/ic_menu_mylocation">
android:id="@+id/item_file_menu"
android:title="@string/option_file"
android:icon="@android:drawable/ic_menu_save">
</item>
<item
android:id="@+id/item_resign"
android:title="@string/option_resign_game"
android:icon="@android:drawable/ic_menu_delete">
</item>
<item
android:id="@+id/item_force_move"

View File

@ -244,7 +244,6 @@ wenn Sie es nicht aktiv nutzen.\
<string name="option_resign_game">Partie aufgeben</string>
<string name="option_edit_board">Stellung bearbeiten</string>
<string name="option_settings">Einstellungen</string>
<string name="option_goto_move">Gehe zu Zug</string>
<string name="option_force_computer_move">Computerzug erzwingen</string>
<string name="option_draw">Remis anbieten/annehmen</string>
<string name="option_select_book">Eröffnungsbuch auswählen</string>

View File

@ -242,7 +242,6 @@ Si está usted utilizando la batería, se recomienda que cambie los ajustes para
<string name="option_resign_game">Rendir partida</string>
<string name="option_edit_board">Editar Posición</string>
<string name="option_settings">Ajustes/Opciones</string>
<string name="option_goto_move">Ir a la jugada</string>
<string name="option_force_computer_move">Obligar a jugar al Programa</string>
<string name="option_draw">Ofrecer / Aceptar Tablas</string>
<string name="option_select_book">Seleccionar Libro</string>

View File

@ -241,7 +241,6 @@ préserver la batterie, ou de quitter <i>DroidFish</i> en utilisant la touche re
<string name="option_resign_game">Abandonner</string>
<string name="option_edit_board">Rentrer une position</string>
<string name="option_settings">Paramètres</string>
<string name="option_goto_move">Aller au coup</string>
<string name="option_force_computer_move">Forcer le coup de l\'ordinateur</string>
<string name="option_draw">Proposer/Accepter la Nulle</string>
<string name="option_select_book">Sélectionner le livre d\'ouverture</string>

View File

@ -235,7 +235,6 @@
<string name="option_resign_game">Abbandona la partita</string>
<string name="option_edit_board">Modifica la scacchiera</string>
<string name="option_settings">Impostazioni</string>
<string name="option_goto_move">Vai alla mossa</string>
<string name="option_force_computer_move">Forza mossa del Computer</string>
<string name="option_draw">Chiedi/Offri/Accetta la patta</string>
<string name="option_select_book">Seleziona Libro delle Aperture</string>

View File

@ -242,7 +242,6 @@ daadwerkelijk af te sluiten (gebruik hiervoor de return toets op uw telefoon).\<
<string name="option_resign_game">Opgeven</string>
<string name="option_edit_board">Bord bewerken</string>
<string name="option_settings">Instellingen</string>
<string name="option_goto_move">Ga naar zet</string>
<string name="option_force_computer_move">Forceer computer zet</string>
<string name="option_draw">Remise aanbieden/accepteren</string>
<string name="option_select_book">Selecteer openingsboek</string>

View File

@ -243,7 +243,6 @@ nie korzystasz aktywnie z programu.\</string>
<string name="option_resign_game">Poddaj partię</string>
<string name="option_edit_board">Edytuj pozycję</string>
<string name="option_settings">Ustawienia</string>
<string name="option_goto_move">Idź do posunięcia</string>
<string name="option_force_computer_move">Wymuś ruch komputera</string>
<string name="option_draw">Zaproponuj/przyjmij remis</string>
<string name="option_select_book">Wybierz książkę otwarć</string>

View File

@ -243,7 +243,6 @@ não estiver usando o programa diretamente.\</string>
<string name="option_resign_game">Abandonar partida</string>
<string name="option_edit_board">Editar tabuleiro</string>
<string name="option_settings">Configurações</string>
<string name="option_goto_move">Ir para o lance</string>
<string name="option_force_computer_move">Forçar lance do software</string>
<string name="option_draw">Pedir/Aceitar empate</string>
<string name="option_select_book">Livro de aberturas</string>

View File

@ -234,7 +234,6 @@
<string name="option_resign_game">Сдаться</string>
<string name="option_edit_board">Редактировать доску</string>
<string name="option_settings">Настройки</string>
<string name="option_goto_move">Перейти на ход</string>
<string name="option_force_computer_move">Форсировать ход компьютера</string>
<string name="option_draw">Заявить/Предложить/Принять ничью</string>
<string name="option_select_book">Выбрать открываемую книгу</string>

View File

@ -243,7 +243,6 @@ you are not actively using the program.\
<string name="option_resign_game">Resign game</string>
<string name="option_edit_board">Edit Board</string>
<string name="option_settings">Settings</string>
<string name="option_goto_move">Goto Move</string>
<string name="option_force_computer_move">Force Computer Move</string>
<string name="option_draw">Claim/Offer/Accept Draw</string>
<string name="option_select_book">Select Opening Book</string>

View File

@ -1339,10 +1339,6 @@ public class DroidFish extends Activity implements GUIInterface {
showDialog(dialog);
return true;
}
case R.id.item_goto_move: {
showDialog(SELECT_MOVE_DIALOG);
return true;
}
case R.id.item_force_move: {
ctrl.stopSearch();
return true;
@ -1779,7 +1775,6 @@ public class DroidFish extends Activity implements GUIInterface {
static private final int PROMOTE_DIALOG = 0;
static private final int BOARD_MENU_DIALOG = 1;
static private final int ABOUT_DIALOG = 2;
static private final int SELECT_MOVE_DIALOG = 3;
static private final int SELECT_BOOK_DIALOG = 4;
static private final int SELECT_ENGINE_DIALOG = 5;
static private final int SELECT_ENGINE_DIALOG_NOMANAGE = 6;
@ -1813,7 +1808,6 @@ public class DroidFish extends Activity implements GUIInterface {
case BOARD_MENU_DIALOG: return boardMenuDialog();
case FILE_MENU_DIALOG: return fileMenuDialog();
case ABOUT_DIALOG: return aboutDialog();
case SELECT_MOVE_DIALOG: return selectMoveDialog();
case SELECT_BOOK_DIALOG: return selectBookDialog();
case SELECT_ENGINE_DIALOG: return selectEngineDialog(false);
case SELECT_ENGINE_DIALOG_NOMANAGE: return selectEngineDialog(true);
@ -2103,46 +2097,6 @@ public class DroidFish extends Activity implements GUIInterface {
return alert;
}
private final Dialog selectMoveDialog() {
setAutoMode(AutoMode.OFF);
View content = View.inflate(this, R.layout.select_move_number, null);
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setView(content);
builder.setTitle(R.string.goto_move);
final EditText moveNrView = (EditText)content.findViewById(R.id.selmove_number);
moveNrView.setText("1");
final Runnable gotoMove = new Runnable() {
public void run() {
try {
int moveNr = Integer.parseInt(moveNrView.getText().toString());
ctrl.gotoMove(moveNr);
} catch (NumberFormatException nfe) {
Toast.makeText(getApplicationContext(), R.string.invalid_number_format, Toast.LENGTH_SHORT).show();
}
}
};
builder.setPositiveButton(android.R.string.ok, new Dialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
gotoMove.run();
}
});
builder.setNegativeButton(R.string.cancel, null);
final AlertDialog dialog = builder.create();
moveNrView.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
gotoMove.run();
dialog.cancel();
return true;
}
return false;
}
});
return dialog;
}
private final Dialog selectBookDialog() {
String[] fileNames = findFilesInDirectory(bookDir, new FileNameFilter() {
@Override