mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 03:32:16 -05:00
Cleaned up success message after settings import
This commit is contained in:
parent
f5e684310e
commit
effb45c463
@ -1041,6 +1041,7 @@ Welcome to K-9 Mail setup. K-9 is an open source mail client for Android origin
|
||||
<string name="settings_importing">Importing settings...</string>
|
||||
<string name="settings_import_scanning_file">Scanning file...</string>
|
||||
<string name="settings_export_success">Saved exported settings to <xliff:g id="filename">%s</xliff:g></string>
|
||||
<string name="settings_import_global_settings_success">Imported global settings from <xliff:g id="filename">%s</xliff:g></string>
|
||||
<string name="settings_import_success">Imported <xliff:g id="accounts">%s</xliff:g> from <xliff:g id="filename">%s</xliff:g></string>
|
||||
<plurals name="settings_import_success">
|
||||
<item quantity="one">1 account</item>
|
||||
|
@ -1410,13 +1410,22 @@ public class Accounts extends K9ListActivity implements OnItemClickListener, OnC
|
||||
removeProgressDialog();
|
||||
|
||||
String filename = mUri.getLastPathSegment();
|
||||
if (success) {
|
||||
int imported = mImportResults.importedAccounts.size();
|
||||
boolean globalSettings = mImportResults.globalSettings;
|
||||
int imported = mImportResults.importedAccounts.size();
|
||||
if (success && (globalSettings || imported > 0)) {
|
||||
|
||||
//TODO: display names of imported accounts (name from file *and* possibly new name)
|
||||
|
||||
activity.showSimpleDialog(R.string.settings_import_success_header,
|
||||
R.string.settings_import_success, imported, filename);
|
||||
if (imported == 0) {
|
||||
activity.showSimpleDialog(R.string.settings_import_success_header,
|
||||
R.string.settings_import_global_settings_success, filename);
|
||||
} else {
|
||||
String importedAccounts = activity.getResources().getQuantityString(
|
||||
R.plurals.settings_import_success, imported);
|
||||
activity.showSimpleDialog(R.string.settings_import_success_header,
|
||||
R.string.settings_import_success, importedAccounts, filename);
|
||||
}
|
||||
|
||||
activity.refresh();
|
||||
} else {
|
||||
//TODO: better error messages
|
||||
|
Loading…
Reference in New Issue
Block a user