Merge pull request #368 from ajit766/master

progress is shown when creating the default key based on number of keys created till then
This commit is contained in:
Dominik Schürmann 2014-03-09 23:39:53 +01:00
commit dd28303dc1
3 changed files with 14 additions and 1 deletions

View File

@ -596,13 +596,21 @@ public class KeychainIntentService extends IntentService implements ProgressDial
String passphrase = data.getString(GENERATE_KEY_SYMMETRIC_PASSPHRASE);
/* Operation */
int keysTotal = 2;
int keysCreated =0;
setProgress(getApplicationContext().getResources().getQuantityString(R.plurals.progress_generating,keysTotal),
keysCreated, keysTotal);
PgpKeyOperation keyOperations = new PgpKeyOperation(this, this);
PGPSecretKey masterKey = keyOperations.createKey(Id.choice.algorithm.rsa,
4096, passphrase, true);
keysCreated++;
setProgress(keysCreated, keysTotal);
PGPSecretKey subKey = keyOperations.createKey(Id.choice.algorithm.rsa,
4096, passphrase, false);
keysCreated++;
setProgress(keysCreated, keysTotal );
// TODO: default to one master for cert, one sub for encrypt and one sub
// for sign

View File

@ -187,7 +187,7 @@ public class EditKeyActivity extends ActionBarActivity {
// Message is received after generating is done in ApgService
KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(
this, R.string.progress_generating, ProgressDialog.STYLE_SPINNER, true,
this, R.string.progress_generating, ProgressDialog.STYLE_HORIZONTAL, true,
new DialogInterface.OnCancelListener() {
@Override

View File

@ -328,6 +328,11 @@
<item quantity="other">exporting keys…</item>
</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_key">extracting key…</string>
<string name="progress_preparing_streams">preparing streams…</string>