diff options
author | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-09-24 00:02:00 +0200 |
---|---|---|
committer | Dominik Schürmann <dominik@dominikschuermann.de> | 2014-09-24 00:02:00 +0200 |
commit | 7c82e1c72872e81ddc66f876d162cf2af66261e5 (patch) | |
tree | bb482e570dd9c01f109eed2f3681d9a27aac4fe2 /OpenKeychain/src | |
parent | 0143b54e9ec2453c47baaf9e9ad4a0a14ffc08c3 (diff) | |
download | open-keychain-7c82e1c72872e81ddc66f876d162cf2af66261e5.tar.gz open-keychain-7c82e1c72872e81ddc66f876d162cf2af66261e5.tar.bz2 open-keychain-7c82e1c72872e81ddc66f876d162cf2af66261e5.zip |
DecryptFilesActivity
Diffstat (limited to 'OpenKeychain/src')
3 files changed, 21 insertions, 14 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java index 255e1f2aa..dc76be2bf 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptFilesFragment.java @@ -348,12 +348,28 @@ public class DecryptFilesFragment extends DecryptFragment { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { + case REQUEST_CODE_PASSPHRASE: { + if (resultCode == Activity.RESULT_OK && data != null) { + String passphrase = data.getStringExtra(PassphraseDialogActivity.MESSAGE_DATA_PASSPHRASE); + decryptOriginalFilename(passphrase); + } + return; + } + + case REQUEST_CODE_NFC: { + if (resultCode == Activity.RESULT_OK && data != null) { + // TODO + } + return; + } + case REQUEST_CODE_INPUT: { if (resultCode == Activity.RESULT_OK && data != null) { setInputUri(data.getData()); } return; } + case REQUEST_CODE_OUTPUT: { // This happens after output file was selected, so start our operation if (resultCode == Activity.RESULT_OK && data != null) { @@ -365,8 +381,6 @@ public class DecryptFilesFragment extends DecryptFragment { default: { super.onActivityResult(requestCode, resultCode, data); - - break; } } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextFragment.java index c51b8b766..200876f10 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/DecryptTextFragment.java @@ -90,13 +90,13 @@ public class DecryptTextFragment extends DecryptFragment { } /** - * Create Intent Chooser but exclude OK's EncryptActivity. + * Create Intent Chooser but exclude decrypt activites */ private Intent sendWithChooserExcludingEncrypt(String text) { Intent prototype = createSendIntent(text); String title = getString(R.string.title_share_file); - // we don't want to encrypt the encrypted, no inception ;) + // we don't want to decrypt the decypted, no inception ;) String[] blacklist = new String[]{ Constants.PACKAGE_NAME + ".ui.DecryptTextActivity", "org.thialfihar.android.apg.ui.DecryptActivity" @@ -211,27 +211,23 @@ public class DecryptTextFragment extends DecryptFragment { if (resultCode == Activity.RESULT_OK && data != null) { String passphrase = data.getStringExtra(PassphraseDialogActivity.MESSAGE_DATA_PASSPHRASE); decryptStart(passphrase); - return; } else { getActivity().finish(); } - break; + return; } case REQUEST_CODE_NFC: { if (resultCode == Activity.RESULT_OK && data != null) { // TODO - return; } else { getActivity().finish(); } - break; + return; } default: { super.onActivityResult(requestCode, resultCode, data); - - break; } } } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesActivity.java index 9b97b6693..28fcb0b10 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesActivity.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesActivity.java @@ -191,8 +191,6 @@ public class EncryptFilesActivity extends EncryptActivity implements EncryptActi super.handleMessage(message); if (message.arg1 == KeychainIntentServiceHandler.MESSAGE_OKAY) { - Notify.showNotify(EncryptFilesActivity.this, R.string.encrypt_sign_successful, Notify.Style.INFO); - SignEncryptResult pgpResult = message.getData().getParcelable(SignEncryptResult.EXTRA_RESULT); @@ -224,8 +222,7 @@ public class EncryptFilesActivity extends EncryptActivity implements EncryptActi startActivity(sendWithChooserExcludingEncrypt(message)); } else { // Save encrypted file - Notify.showNotify(EncryptFilesActivity.this, - R.string.encrypt_sign_clipboard_successful, Notify.Style.INFO); + pgpResult.createNotify(EncryptFilesActivity.this).show(); } } else { pgpResult.createNotify(EncryptFilesActivity.this).show(); |