From 5fce6d8e261a826cfca6f668b13b86d5d920b576 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sat, 18 Apr 2020 14:35:36 -0700 Subject: [PATCH] add delete option for suspect-corrupt files --- .../java/org/eehouse/android/xw4/DlgDelegate.java | 3 ++- .../org/eehouse/android/xw4/GamesListDelegate.java | 13 ++++++++++--- xwords4/android/app/src/main/res/values/strings.xml | 4 ++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java index 0792253a3..a692573f6 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DlgDelegate.java @@ -53,7 +53,8 @@ public class DlgDelegate { SEND_EMAIL, WRITE_LOG_DB, CLEAR_LOG_DB, - CLEAR_QUARANTINE, + QUARANTINE_CLEAR, + QUARANTINE_DELETE, // BoardDelegate UNDO_LAST_ACTION, diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index 5e5bda7af..11caabfe1 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -1237,8 +1237,10 @@ public class GamesListDelegate extends ListDelegateBase .show(); } else { makeConfirmThenBuilder( R.string.unsafe_open_warning, - Action.CLEAR_QUARANTINE ) + Action.QUARANTINE_CLEAR ) .setPosButton( R.string.unsafe_open_disregard ) + .setActionPair( Action.QUARANTINE_DELETE, + R.string.button_delete ) .setParams( rowid, summary ) .show(); } @@ -1357,13 +1359,18 @@ public class GamesListDelegate extends ListDelegateBase case OPEN_GAME: doOpenGame( params ); break; - case CLEAR_QUARANTINE: + case QUARANTINE_CLEAR: long rowid = (long)params[0]; Quarantine.clear( rowid ); - GameSummary summary = (GameSummary)params[0]; + GameSummary summary = (GameSummary)params[1]; openWithChecks( rowid, summary ); break; + case QUARANTINE_DELETE: + rowid = (long)params[0]; + deleteGames( new long[] {rowid}, true ); + break; + case CLEAR_SELS: clearSelections(); break; diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 3e232ecde..8d3879962 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -2521,8 +2521,8 @@ Auto-paused. This game has caused CrossWords - to crash recently and is likely corrupt. Do you want to open it - anyway? + to crash recently and is likely damaged. Opening it might cause + another crash. Do you want to open it anyway? Open anyway Debug logs