add delete option for suspect-corrupt files

This commit is contained in:
Eric House 2020-04-18 14:35:36 -07:00
parent 8c50bb1895
commit 5fce6d8e26
3 changed files with 14 additions and 6 deletions

View file

@ -53,7 +53,8 @@ public class DlgDelegate {
SEND_EMAIL, SEND_EMAIL,
WRITE_LOG_DB, WRITE_LOG_DB,
CLEAR_LOG_DB, CLEAR_LOG_DB,
CLEAR_QUARANTINE, QUARANTINE_CLEAR,
QUARANTINE_DELETE,
// BoardDelegate // BoardDelegate
UNDO_LAST_ACTION, UNDO_LAST_ACTION,

View file

@ -1237,8 +1237,10 @@ public class GamesListDelegate extends ListDelegateBase
.show(); .show();
} else { } else {
makeConfirmThenBuilder( R.string.unsafe_open_warning, makeConfirmThenBuilder( R.string.unsafe_open_warning,
Action.CLEAR_QUARANTINE ) Action.QUARANTINE_CLEAR )
.setPosButton( R.string.unsafe_open_disregard ) .setPosButton( R.string.unsafe_open_disregard )
.setActionPair( Action.QUARANTINE_DELETE,
R.string.button_delete )
.setParams( rowid, summary ) .setParams( rowid, summary )
.show(); .show();
} }
@ -1357,13 +1359,18 @@ public class GamesListDelegate extends ListDelegateBase
case OPEN_GAME: case OPEN_GAME:
doOpenGame( params ); doOpenGame( params );
break; break;
case CLEAR_QUARANTINE: case QUARANTINE_CLEAR:
long rowid = (long)params[0]; long rowid = (long)params[0];
Quarantine.clear( rowid ); Quarantine.clear( rowid );
GameSummary summary = (GameSummary)params[0]; GameSummary summary = (GameSummary)params[1];
openWithChecks( rowid, summary ); openWithChecks( rowid, summary );
break; break;
case QUARANTINE_DELETE:
rowid = (long)params[0];
deleteGames( new long[] {rowid}, true );
break;
case CLEAR_SELS: case CLEAR_SELS:
clearSelections(); clearSelections();
break; break;

View file

@ -2521,8 +2521,8 @@
<string name="history_autopause">Auto-paused.</string> <string name="history_autopause">Auto-paused.</string>
<string name="unsafe_open_warning">This game has caused CrossWords <string name="unsafe_open_warning">This game has caused CrossWords
to crash recently and is likely corrupt. Do you want to open it to crash recently and is likely damaged. Opening it might cause
anyway?</string> another crash. Do you want to open it anyway?</string>
<string name="unsafe_open_disregard">Open anyway</string> <string name="unsafe_open_disregard">Open anyway</string>
<string name="gamel_menu_logs">Debug logs</string> <string name="gamel_menu_logs">Debug logs</string>