diff --git a/xwords4/android/XWords4/res/values/strings.xml b/xwords4/android/XWords4/res/values/strings.xml index 1991df4df..322fdbdb1 100644 --- a/xwords4/android/XWords4/res/values/strings.xml +++ b/xwords4/android/XWords4/res/values/strings.xml @@ -179,6 +179,9 @@ Are you sure you want to delete this game? + Are you sure you want to delete + all selected games? This action cannot be undone. + Are you sure you want to reset this diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java index 138da5139..97912b56f 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesList.java @@ -88,6 +88,7 @@ public class GamesList extends XWExpandableListActivity private static final int SYNC_MENU_ACTION = 4; private static final int NEW_FROM_ACTION = 5; private static final int DELETE_GROUP_ACTION = 6; + private static final int DELETE_SELGAMES_ACTION = 7; private static final int[] DEBUGITEMS = { R.id.gamel_menu_loaddb , R.id.gamel_menu_storedb , R.id.gamel_menu_checkupdates @@ -587,6 +588,9 @@ public class GamesList extends XWExpandableListActivity GameUtils.deleteGroup( this, m_groupid ); onContentChanged(); break; + case DELETE_SELGAMES_ACTION: + deleteSelected(); + break; default: Assert.fail(); } @@ -708,6 +712,11 @@ public class GamesList extends XWExpandableListActivity showDialog( NEW_GROUP ); break; + case R.id.gamel_menu_delete: + showConfirmThen( R.string.confirm_seldeletes, R.string.button_delete, + DELETE_SELGAMES_ACTION ); + break; + case R.id.gamel_menu_dicts: DictsActivity.start( this ); break; @@ -1105,6 +1114,17 @@ public class GamesList extends XWExpandableListActivity return dialog; } + private void deleteSelected() + { + for ( Iterator iter = m_selected.iterator(); iter.hasNext(); ) { + long rowid = iter.next(); + GameUtils.deleteGame( this, rowid, false ); + } + m_selected.clear(); + + NetUtils.informOfDeaths( this ); + } + private boolean makeNewNetGameIf() { boolean madeGame = null != m_netLaunchInfo;