From fb3ae94acb83f90a1554bf34b4c827c70850e40f Mon Sep 17 00:00:00 2001 From: Ryan Meredith Date: Sat, 9 Jun 2018 11:30:20 -0400 Subject: [PATCH] Android: Add AlertDialog for files without Game IDs in Game Settings --- .../org/dolphinemu/dolphinemu/adapters/GameAdapter.java | 9 ++++++--- .../dolphinemu/dolphinemu/adapters/GameRowPresenter.java | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java index 75cf4d59e9..b1f3fb0a7b 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameAdapter.java @@ -136,17 +136,20 @@ public final class GameAdapter extends RecyclerView.Adapter impl @Override public boolean onLongClick(View view) { + FragmentActivity activity = (FragmentActivity) view.getContext(); GameViewHolder holder = (GameViewHolder) view.getTag(); String gameId = holder.gameFile.getGameId(); if (gameId.isEmpty()) { - // We can't make a game-specific INI file if there is no game ID + AlertDialog.Builder builder = new AlertDialog.Builder(activity); + builder.setTitle("Game Settings"); + builder.setMessage("Files without game IDs don't support game-specific settings."); + + builder.show(); return true; } - FragmentActivity activity = (FragmentActivity) view.getContext(); - AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle("Game Settings") .setItems(R.array.gameSettingsMenus, new DialogInterface.OnClickListener() { diff --git a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java index d12ce579c1..4928a0b44e 100644 --- a/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java +++ b/Source/Android/app/src/main/java/org/dolphinemu/dolphinemu/adapters/GameRowPresenter.java @@ -89,7 +89,11 @@ public final class GameRowPresenter extends Presenter if (gameId.isEmpty()) { - // We can't make a game-specific INI file if there is no game ID + AlertDialog.Builder builder = new AlertDialog.Builder(activity); + builder.setTitle("Game Settings"); + builder.setMessage("Files without game IDs don't support game-specific settings."); + + builder.show(); return true; }