diff options
author | cos <cos> | 2024-07-05 09:41:53 +0200 |
---|---|---|
committer | cos <cos> | 2024-10-12 17:29:20 +0200 |
commit | e41536783edab8145e9882dfbf3647e93707c509 (patch) | |
tree | 8cf2607e140e9d6f31131f23f6bad4afb3508272 | |
parent | 361c754eb92e020303f31ca4c75fa881e0f68131 (diff) | |
download | AntennaPod-fix/import_isnt_export.zip |
Fix import failure, should not say "export"fix/import_isnt_export
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/ui/screen/preferences/ImportExportPreferencesFragment.java | 18 | ||||
-rw-r--r-- | ui/i18n/src/main/res/values/strings.xml | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/ui/screen/preferences/ImportExportPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/ui/screen/preferences/ImportExportPreferencesFragment.java index 81da9c1ae..451dc0c1c 100644 --- a/app/src/main/java/de/danoeh/antennapod/ui/screen/preferences/ImportExportPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/ui/screen/preferences/ImportExportPreferencesFragment.java @@ -229,15 +229,27 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { .show(); } - private void showExportErrorDialog(final Throwable error) { + private void showImportExportErrorDialog(final Throwable error, boolean isImport) { progressDialog.dismiss(); final MaterialAlertDialogBuilder alert = new MaterialAlertDialogBuilder(getContext()); alert.setPositiveButton(android.R.string.ok, (dialog, which) -> dialog.dismiss()); - alert.setTitle(R.string.export_error_label); + if (isImport) { + alert.setTitle(R.string.import_error_label); + } else { + alert.setTitle(R.string.export_error_label); + } alert.setMessage(error.getMessage()); alert.show(); } + private void showExportErrorDialog(final Throwable error) { + showImportExportErrorDialog(error, false); + } + + private void showImportErrorDialog(final Throwable error) { + showImportExportErrorDialog(error, true); + } + private void restoreDatabaseResult(final ActivityResult result) { if (result.getResultCode() != Activity.RESULT_OK || result.getData() == null) { return; @@ -250,7 +262,7 @@ public class ImportExportPreferencesFragment extends PreferenceFragmentCompat { .subscribe(() -> { showDatabaseImportSuccessDialog(); progressDialog.dismiss(); - }, this::showExportErrorDialog); + }, this::showImportErrorDialog); } private void backupDatabaseResult(final Uri uri) { diff --git a/ui/i18n/src/main/res/values/strings.xml b/ui/i18n/src/main/res/values/strings.xml index 924421df8..ae6b3b743 100644 --- a/ui/i18n/src/main/res/values/strings.xml +++ b/ui/i18n/src/main/res/values/strings.xml @@ -601,6 +601,7 @@ <string name="database_import_warning">Importing a database will replace all of your current subscriptions and playing history. You should export your current database as a backup. Do you want to replace?</string> <string name="please_wait">Please wait…</string> <string name="export_error_label">Export error</string> + <string name="import_error_label">Import error</string> <string name="export_success_title">Export successful</string> <string name="opml_import_ask_read_permission">Access to external storage is required to read the OPML file</string> <string name="successful_import_label">Import successful</string> |