diff options
-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> |