mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Android: Only allow conversion when appropriate
This commit is contained in:
@ -29,6 +29,7 @@ public class GamePropertiesDialog extends DialogFragment
|
||||
private static final String ARG_GAMEID = "game_id";
|
||||
public static final String ARG_REVISION = "revision";
|
||||
private static final String ARG_PLATFORM = "platform";
|
||||
private static final String ARG_SHOULD_ALLOW_CONVERSION = "should_allow_conversion";
|
||||
|
||||
public static GamePropertiesDialog newInstance(GameFile gameFile)
|
||||
{
|
||||
@ -39,6 +40,7 @@ public class GamePropertiesDialog extends DialogFragment
|
||||
arguments.putString(ARG_GAMEID, gameFile.getGameId());
|
||||
arguments.putInt(ARG_REVISION, gameFile.getRevision());
|
||||
arguments.putInt(ARG_PLATFORM, gameFile.getPlatform());
|
||||
arguments.putBoolean(ARG_SHOULD_ALLOW_CONVERSION, gameFile.shouldAllowConversion());
|
||||
fragment.setArguments(arguments);
|
||||
|
||||
return fragment;
|
||||
@ -52,6 +54,7 @@ public class GamePropertiesDialog extends DialogFragment
|
||||
String gameId = requireArguments().getString(ARG_GAMEID);
|
||||
int revision = requireArguments().getInt(ARG_REVISION);
|
||||
int platform = requireArguments().getInt(ARG_PLATFORM);
|
||||
boolean shouldAllowConversion = requireArguments().getBoolean(ARG_SHOULD_ALLOW_CONVERSION);
|
||||
|
||||
AlertDialogItemsBuilder itemsBuilder = new AlertDialogItemsBuilder(requireContext());
|
||||
|
||||
@ -59,8 +62,11 @@ public class GamePropertiesDialog extends DialogFragment
|
||||
GameDetailsDialog.newInstance(path).show(requireActivity()
|
||||
.getSupportFragmentManager(), "game_details"));
|
||||
|
||||
itemsBuilder.add(R.string.properties_convert, (dialog, i) ->
|
||||
ConvertActivity.launch(getContext(), path));
|
||||
if (shouldAllowConversion)
|
||||
{
|
||||
itemsBuilder.add(R.string.properties_convert, (dialog, i) ->
|
||||
ConvertActivity.launch(getContext(), path));
|
||||
}
|
||||
|
||||
itemsBuilder.add(R.string.properties_set_default_iso, (dialog, i) ->
|
||||
{
|
||||
|
@ -48,6 +48,8 @@ public class GameFile
|
||||
|
||||
public native boolean shouldShowFileFormatDetails();
|
||||
|
||||
public native boolean shouldAllowConversion();
|
||||
|
||||
public native long getFileSize();
|
||||
|
||||
public native boolean isDatelDisc();
|
||||
|
@ -73,6 +73,8 @@ JNIEXPORT jstring JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_model_GameFile_getCompressionMethod(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_model_GameFile_shouldShowFileFormatDetails(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_model_GameFile_shouldAllowConversion(JNIEnv* env, jobject obj);
|
||||
JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getFileSize(JNIEnv* env,
|
||||
jobject obj);
|
||||
JNIEXPORT jboolean JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_isDatelDisc(JNIEnv* env,
|
||||
@ -188,6 +190,12 @@ Java_org_dolphinemu_dolphinemu_model_GameFile_shouldShowFileFormatDetails(JNIEnv
|
||||
return static_cast<jboolean>(GetRef(env, obj)->ShouldShowFileFormatDetails());
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_org_dolphinemu_dolphinemu_model_GameFile_shouldAllowConversion(JNIEnv* env, jobject obj)
|
||||
{
|
||||
return static_cast<jboolean>(GetRef(env, obj)->ShouldAllowConversion());
|
||||
}
|
||||
|
||||
JNIEXPORT jlong JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getFileSize(JNIEnv* env,
|
||||
jobject obj)
|
||||
{
|
||||
|
Reference in New Issue
Block a user