mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-27 06:10:28 +01:00
Make it possible to copy analysis information to the clipboard
The analysis information is copied as text to the clipboard. The full text is copied, so the "truncate variations" and "hide statistics" settings have no effect on the text put in the clipboard.
This commit is contained in:
parent
2e7b345de0
commit
9face3a9f7
|
@ -2822,15 +2822,17 @@ public class DroidFish extends Activity
|
|||
}
|
||||
|
||||
private Dialog thinkingMenuDialog() {
|
||||
final int ADD_ANALYSIS = 0;
|
||||
final int MULTIPV_SET = 1;
|
||||
final int SHOW_WHOLE_VARS = 2;
|
||||
final int TRUNCATE_VARS = 3;
|
||||
final int HIDE_STATISTICS = 4;
|
||||
final int SHOW_STATISTICS = 5;
|
||||
final int ADD_ANALYSIS = 0;
|
||||
final int COPY_TO_CLIPBOARD = 1;
|
||||
final int MULTIPV_SET = 2;
|
||||
final int SHOW_WHOLE_VARS = 3;
|
||||
final int TRUNCATE_VARS = 4;
|
||||
final int HIDE_STATISTICS = 5;
|
||||
final int SHOW_STATISTICS = 6;
|
||||
List<String> lst = new ArrayList<>();
|
||||
final List<Integer> actions = new ArrayList<>();
|
||||
lst.add(getString(R.string.add_analysis)); actions.add(ADD_ANALYSIS);
|
||||
lst.add(getString(R.string.add_analysis)); actions.add(ADD_ANALYSIS);
|
||||
lst.add(getString(R.string.copy_to_clipboard)); actions.add(COPY_TO_CLIPBOARD);
|
||||
int numPV = this.numPV;
|
||||
final int maxPV = ctrl.maxPV();
|
||||
if (gameMode.analysisMode()) {
|
||||
|
@ -2878,6 +2880,21 @@ public class DroidFish extends Activity
|
|||
}
|
||||
break;
|
||||
}
|
||||
case COPY_TO_CLIPBOARD: {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (!thinkingStr1.isEmpty()) {
|
||||
sb.append(thinkingStr1);
|
||||
if (!thinkingStr2.isEmpty())
|
||||
sb.append('\n');
|
||||
}
|
||||
sb.append(thinkingStr2);
|
||||
ClipboardManager clipboard = (ClipboardManager)getSystemService(CLIPBOARD_SERVICE);
|
||||
ClipData cd = new ClipData("DroidFish game",
|
||||
new String[]{ ClipDescription.MIMETYPE_TEXT_PLAIN },
|
||||
new ClipData.Item(sb.toString()));
|
||||
clipboard.setPrimaryClip(cd);
|
||||
break;
|
||||
}
|
||||
case MULTIPV_SET: {
|
||||
MultiPVSet m = new MultiPVSet();
|
||||
m.multiPVDialog(numPVF, maxPV);
|
||||
|
|
|
@ -183,6 +183,7 @@ If you are running on battery power, it is recommended that you change settings
|
|||
<string name="failed_to_read_pgn_data">Failed to read PGN data</string>
|
||||
<string name="variation">Var:</string>
|
||||
<string name="add_analysis">Add Analysis</string>
|
||||
<string name="copy_to_clipboard">Copy to Clipboard</string>
|
||||
<string name="num_variations">Number of Variations</string>
|
||||
<string name="hide_statistics">Hide statistics</string>
|
||||
<string name="show_statistics">Show statistics</string>
|
||||
|
|
Loading…
Reference in New Issue
Block a user