Merge logs in create key

This commit is contained in:
Dominik Schürmann 2015-07-01 14:39:47 +02:00
parent 79f37d3267
commit d41c5bbbc1

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de> * Copyright (C) 2014-2015 Dominik Schürmann <dominik@dominikschuermann.de>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -263,7 +263,6 @@ public class CreateKeyFinalFragment extends Fragment {
mCreateOpHelper = new CryptoOperationHelper<>(this, createKeyCallback, mCreateOpHelper = new CryptoOperationHelper<>(this, createKeyCallback,
R.string.progress_building_key); R.string.progress_building_key);
mCreateOpHelper.cryptoOperation(); mCreateOpHelper.cryptoOperation();
} }
@ -318,14 +317,17 @@ public class CreateKeyFinalFragment extends Fragment {
} }
public void handleResult(EditKeyResult result) { public void handleResult(EditKeyResult result) {
// merge logs of createKey with moveToCard
saveKeyResult.getLog().add(result, 0);
if (result.mMasterKeyId != null && mUploadCheckbox.isChecked()) { if (result.mMasterKeyId != null && mUploadCheckbox.isChecked()) {
// result will be displayed after upload // result will be displayed after upload
uploadKey(result); uploadKey(saveKeyResult);
return; return;
} }
Intent data = new Intent(); Intent data = new Intent();
data.putExtra(OperationResult.EXTRA_RESULT, result); data.putExtra(OperationResult.EXTRA_RESULT, saveKeyResult);
getActivity().setResult(Activity.RESULT_OK, data); getActivity().setResult(Activity.RESULT_OK, data);
getActivity().finish(); getActivity().finish();
} }
@ -372,11 +374,9 @@ public class CreateKeyFinalFragment extends Fragment {
} }
public void handleResult(ExportResult result) { public void handleResult(ExportResult result) {
// TODO: upload operation needs a result! "result" is not currenlty used // TODO: ExportOperation UPLOAD_KEYSERVER needs logs!
// TODO: then combine these results (saveKeyResult and update op result) // TODO: then merge logs here!
//if (result.getResult() == OperationResultParcel.RESULT_OK) { //saveKeyResult.getLog().add(result, 0);
//Notify.create(getActivity(), R.string.key_send_success,
//Notify.Style.OK).show();
Intent data = new Intent(); Intent data = new Intent();
data.putExtra(OperationResult.EXTRA_RESULT, saveKeyResult); data.putExtra(OperationResult.EXTRA_RESULT, saveKeyResult);