DroidFish: Report engine name in the GUI when a new engine is started.

This commit is contained in:
Peter Osterlund
2011-12-31 13:42:48 +00:00
parent e458b95d33
commit 6f25af50d9
4 changed files with 12 additions and 0 deletions

View File

@@ -400,6 +400,7 @@ you are not actively using the program.\
<string name="before_selected">Before Selected</string>
<string name="after_selected">After Selected</string>
<string name="replace_selected">Replace Selected</string>
<string name="engine">Engine</string>
<string name="err_too_few_spaces">Too few spaces</string>
<string name="err_invalid_piece">Invalid piece</string>

View File

@@ -1765,6 +1765,13 @@ public class DroidFish extends Activity implements GUIInterface {
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void reportEngineName(String engine) {
String msg = String.format("%s: %s",
getString(R.string.engine), engine);
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
}
@Override
public void computerMoveMade() {
if (soundEnabled) {

View File

@@ -64,6 +64,9 @@ public interface GUIInterface {
/** Report that user attempted to make an invalid move. */
public void reportInvalidMove(Move m);
/** Report UCI engine name. */
public void reportEngineName(String engine);
/** Called when computer made a move. GUI can notify user, for example by playing a sound. */
public void computerMoveMade();

View File

@@ -697,6 +697,7 @@ public class DroidChessController {
gui.runOnUIThread(new Runnable() {
public void run() {
updatePlayerNames(engineName);
gui.reportEngineName(engineName);
}
});
}