Browse Source

Check if folder exists before letting the user import/export saves

nce_cpp
PabloG02 3 years ago
committed by bunnei
parent
commit
b96e520f89
  1. 10
      src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt

10
src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt

@ -66,7 +66,14 @@ class ImportExportSavesFragment : DialogFragment() {
} }
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return MaterialAlertDialogBuilder(requireContext())
return if (savesFolderRoot == "") {
MaterialAlertDialogBuilder(requireContext())
.setTitle(R.string.import_export_saves)
.setMessage("No profileID found. Launch a game first and then come back.")
.setPositiveButton(android.R.string.ok, null)
.show()
} else {
MaterialAlertDialogBuilder(requireContext())
.setTitle("Import/Export Saves") .setTitle("Import/Export Saves")
.setPositiveButton("Export") { _, _ -> .setPositiveButton("Export") { _, _ ->
exportSave() exportSave()
@ -76,6 +83,7 @@ class ImportExportSavesFragment : DialogFragment() {
} }
.show() .show()
} }
}
/** /**
* Zips the save files located in the given folder path and creates a new zip file with the current date and time. * Zips the save files located in the given folder path and creates a new zip file with the current date and time.

Loading…
Cancel
Save