From 472a17329749c18757fbdb6bff4771433e53fb4a Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 13 Jul 2016 17:03:18 -0700 Subject: [PATCH] disable delete if selected game is currently open --- .../src/org/eehouse/android/xw4/GamesListDelegate.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java index 8da8c0233..a9289d1ca 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/GamesListDelegate.java @@ -1382,9 +1382,13 @@ public class GamesListDelegate extends ListDelegateBase Utils.setItemVisible( menu, R.id.games_menu_newgame_net, nothingSelected || 1 == nGroupsSelected ); - // Multiples can be deleted - Utils.setItemVisible( menu, R.id.games_game_delete, - 0 < nGamesSelected ); + // Multiples can be deleted, but disable if any selected game is + // currently open + enable = 0 < nGamesSelected; + for ( long row : m_selGames ) { + enable = enable && !m_launchedGames.contains( row ); + } + Utils.setItemVisible( menu, R.id.games_game_delete, enable ); // multiple games can be regrouped/reset. Utils.setItemVisible( menu, R.id.games_game_move,