summaryrefslogtreecommitdiffstats
path: root/src/android
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-06-02 05:56:14 +0200
committerbunnei <bunneidev@gmail.com>2023-06-03 09:06:08 +0200
commitc927a30d09789f255d7d510f6314871658d3d97c (patch)
treed66c05cf5749e01b760737874e92d4d236aec8eb /src/android
parentandroid: Warning dialogs for key errors (diff)
downloadyuzu-c927a30d09789f255d7d510f6314871658d3d97c.tar
yuzu-c927a30d09789f255d7d510f6314871658d3d97c.tar.gz
yuzu-c927a30d09789f255d7d510f6314871658d3d97c.tar.bz2
yuzu-c927a30d09789f255d7d510f6314871658d3d97c.tar.lz
yuzu-c927a30d09789f255d7d510f6314871658d3d97c.tar.xz
yuzu-c927a30d09789f255d7d510f6314871658d3d97c.tar.zst
yuzu-c927a30d09789f255d7d510f6314871658d3d97c.zip
Diffstat (limited to 'src/android')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt2
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt24
-rw-r--r--src/android/app/src/main/res/values/strings.xml10
3 files changed, 21 insertions, 15 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt
index 7cd2409df..67bcf8491 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt
@@ -99,7 +99,7 @@ class HomeSettingsFragment : Fragment() {
R.drawable.ic_add
) { mainActivity.getGamesDirectory.launch(Intent(Intent.ACTION_OPEN_DOCUMENT_TREE).data) },
HomeSetting(
- R.string.import_export_saves,
+ R.string.manage_save_data,
R.string.import_export_saves_description,
R.drawable.ic_save
) { ImportExportSavesFragment().show(parentFragmentManager, ImportExportSavesFragment.TAG) },
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
index 6f5068bb5..7a990d0cc 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/ImportExportSavesFragment.kt
@@ -68,19 +68,21 @@ class ImportExportSavesFragment : DialogFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return if (savesFolderRoot == "") {
MaterialAlertDialogBuilder(requireContext())
- .setTitle(R.string.import_export_saves)
+ .setTitle(R.string.manage_save_data)
.setMessage(R.string.import_export_saves_no_profile)
.setPositiveButton(android.R.string.ok, null)
.show()
} else {
MaterialAlertDialogBuilder(requireContext())
- .setTitle(R.string.import_export_saves)
- .setPositiveButton(R.string.export_saves) { _, _ ->
+ .setTitle(R.string.manage_save_data)
+ .setMessage(R.string.manage_save_data_description)
+ .setNegativeButton(R.string.export_saves) { _, _ ->
exportSave()
}
- .setNeutralButton(R.string.import_saves) { _, _ ->
+ .setPositiveButton(R.string.import_saves) { _, _ ->
documentPicker.launch(arrayOf("application/zip"))
}
+ .setNeutralButton(android.R.string.cancel, null)
.show()
}
}
@@ -95,7 +97,10 @@ class ImportExportSavesFragment : DialogFragment() {
tempFolder.mkdirs()
val saveFolder = File(savesFolderRoot)
val outputZipFile = File(
- tempFolder, "yuzu saves - ${LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))}.zip"
+ tempFolder,
+ "yuzu saves - ${
+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))
+ }.zip"
)
outputZipFile.createNewFile()
ZipOutputStream(BufferedOutputStream(FileOutputStream(outputZipFile))).use { zos ->
@@ -206,11 +211,10 @@ class ImportExportSavesFragment : DialogFragment() {
withContext(Dispatchers.Main) {
if (!validZip) {
- Toast.makeText(
- context,
- context.getString(R.string.save_file_invalid_zip_structure),
- Toast.LENGTH_LONG
- ).show()
+ MessageDialogFragment.newInstance(
+ R.string.save_file_invalid_zip_structure,
+ R.string.save_file_invalid_zip_structure_description
+ ).show(childFragmentManager, MessageDialogFragment.TAG)
return@withContext
}
Toast.makeText(
diff --git a/src/android/app/src/main/res/values/strings.xml b/src/android/app/src/main/res/values/strings.xml
index afc681fed..5fd9aa8f8 100644
--- a/src/android/app/src/main/res/values/strings.xml
+++ b/src/android/app/src/main/res/values/strings.xml
@@ -87,11 +87,13 @@
<string name="no_file_manager">No file manager found</string>
<string name="notification_no_directory_link">Could not open yuzu directory</string>
<string name="notification_no_directory_link_description">Please locate the user folder with the file manager\'s side panel manually.</string>
- <string name="import_export_saves">Import/export saves</string>
+ <string name="manage_save_data">Manage save data</string>
+ <string name="manage_save_data_description">Save data found. Please select an option below.</string>
<string name="import_export_saves_description">Import or export save files</string>
- <string name="import_export_saves_no_profile">No user profile found. Please launch a game first and retry.</string>
- <string name="save_file_imported_success">Save files were imported successfully</string>
- <string name="save_file_invalid_zip_structure">Invalid save directory structure: The first subfolder name must be the title ID of the game.</string>
+ <string name="import_export_saves_no_profile">No save data found. Please launch a game and retry.</string>
+ <string name="save_file_imported_success">Imported successfully</string>
+ <string name="save_file_invalid_zip_structure">Invalid save directory structure</string>
+ <string name="save_file_invalid_zip_structure_description">The first subfolder name must be the title ID of the game.</string>
<string name="import_saves">Import</string>
<string name="export_saves">Export</string>