From 97209f9d3d5a184f30dbde5b58e7d47703a17ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 31 Jul 2014 23:31:09 +0200 Subject: [PATCH] Fixes for upload --- .../keychain/ui/CertifyKeyActivity.java | 2 +- .../keychain/ui/CreateKeyFinalFragment.java | 30 +++++++++++-------- .../keychain/ui/UploadKeyActivity.java | 2 +- OpenKeychain/src/main/res/values/strings.xml | 1 + 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java index 3c69fb071..74ce936d5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CertifyKeyActivity.java @@ -333,7 +333,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements // Message is received after uploading is done in KeychainIntentService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this, - getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { + getString(R.string.progress_uploading), ProgressDialog.STYLE_HORIZONTAL) { public void handleMessage(Message message) { // handle messages by standard KeychainIntentServiceHandler first super.handleMessage(message); diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java index b64480087..f9ed16cba 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/CreateKeyFinalFragment.java @@ -145,20 +145,20 @@ public class CreateKeyFinalFragment extends Fragment { return; } - if (mUploadCheckbox.isChecked()) { - if (result.getResult() == OperationResultParcel.RESULT_OK) { + if (result.getResult() == OperationResultParcel.RESULT_OK) { + if (mUploadCheckbox.isChecked()) { // result will be displayed after upload uploadKey(result); } else { - // display result on error without finishing activity + // TODO: return result result.createNotify(getActivity()); + + getActivity().setResult(Activity.RESULT_OK); + getActivity().finish(); } } else { - // TODO: return result + // display result on error without finishing activity result.createNotify(getActivity()); - - getActivity().setResult(Activity.RESULT_OK); - getActivity().finish(); } } } @@ -196,9 +196,8 @@ public class CreateKeyFinalFragment extends Fragment { intent.setAction(KeychainIntentService.ACTION_UPLOAD_KEYRING); // set data uri as path to keyring - Uri blobUri = KeychainContract.KeyRingData.buildPublicKeyRingUri( - Long.toString(editKeyResult.mRingMasterKeyId) - ); + Uri blobUri = KeychainContract.KeyRings.buildUnifiedKeyRingUri( + editKeyResult.mRingMasterKeyId); intent.setData(blobUri); // fill values for this action @@ -212,14 +211,15 @@ public class CreateKeyFinalFragment extends Fragment { // Message is received after uploading is done in KeychainIntentService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(getActivity(), - getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { + getString(R.string.progress_uploading), ProgressDialog.STYLE_HORIZONTAL) { public void handleMessage(Message message) { // handle messages by standard KeychainIntentServiceHandler first super.handleMessage(message); if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { - // TODO: return results - + // TODO: not supported by upload? +// if (result.getResult() == OperationResultParcel.RESULT_OK) { + // TODO: return result editKeyResult.createNotify(getActivity()); Notify.showNotify(getActivity(), R.string.key_send_success, @@ -227,6 +227,10 @@ public class CreateKeyFinalFragment extends Fragment { getActivity().setResult(Activity.RESULT_OK); getActivity().finish(); +// } else { +// // display result on error without finishing activity +// editKeyResult.createNotify(getActivity()); +// } } } }; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java index a2c5a0d90..57bfc7bd5 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/UploadKeyActivity.java @@ -106,7 +106,7 @@ public class UploadKeyActivity extends ActionBarActivity { // Message is received after uploading is done in KeychainIntentService KeychainIntentServiceHandler saveHandler = new KeychainIntentServiceHandler(this, - getString(R.string.progress_exporting), ProgressDialog.STYLE_HORIZONTAL) { + getString(R.string.progress_uploading), ProgressDialog.STYLE_HORIZONTAL) { public void handleMessage(Message message) { // handle messages by standard KeychainIntentServiceHandler first super.handleMessage(message); diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 5e3001201..d5e6fc298 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -300,6 +300,7 @@ saving… importing… exporting… + uploading… building key… certifying master key… building master ring…