progress bar while key creation - added plurals based on no.of keys while key creation

This commit is contained in:
grait 2014-03-09 17:45:58 +05:30
parent e471560e25
commit 4874ea567a
2 changed files with 8 additions and 2 deletions

View File

@ -598,7 +598,8 @@ public class KeychainIntentService extends IntentService implements ProgressDial
/* Operation */ /* Operation */
int keysTotal = 2; int keysTotal = 2;
int keysCreated =0; int keysCreated =0;
this.setProgress(keysCreated, keysTotal); setProgress(getApplicationContext().getResources().getQuantityString(R.plurals.progress_generating,keysTotal),
keysCreated, keysTotal);
PgpKeyOperation keyOperations = new PgpKeyOperation(this, this); PgpKeyOperation keyOperations = new PgpKeyOperation(this, this);
PGPSecretKey masterKey = keyOperations.createKey(Id.choice.algorithm.rsa, PGPSecretKey masterKey = keyOperations.createKey(Id.choice.algorithm.rsa,

View File

@ -313,7 +313,7 @@
<string name="progress_saving">saving…</string> <string name="progress_saving">saving…</string>
<string name="progress_importing">importing…</string> <string name="progress_importing">importing…</string>
<string name="progress_exporting">exporting…</string> <string name="progress_exporting">exporting…</string>
<string name="progress_generating">generating keys, this can take up to 3 minutes…</string> <string name="progress_generating">generating key, this can take up to 3 minutes…</string>
<string name="progress_building_key">building key…</string> <string name="progress_building_key">building key…</string>
<string name="progress_preparing_master_key">preparing master key…</string> <string name="progress_preparing_master_key">preparing master key…</string>
<string name="progress_certifying_master_key">certifying master key…</string> <string name="progress_certifying_master_key">certifying master key…</string>
@ -326,6 +326,11 @@
<item quantity="other">exporting keys…</item> <item quantity="other">exporting keys…</item>
</plurals> </plurals>
<plurals name="progress_generating">
<item quantity="one">generating key, this can take up to 3 minutes…</item>
<item quantity="other">generating keys, this can take up to 3 minutes…</item>
</plurals>
<string name="progress_extracting_signature_key">extracting signature key…</string> <string name="progress_extracting_signature_key">extracting signature key…</string>
<string name="progress_extracting_key">extracting key…</string> <string name="progress_extracting_key">extracting key…</string>
<string name="progress_preparing_streams">preparing streams…</string> <string name="progress_preparing_streams">preparing streams…</string>