diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml index eb86251e1..5ab838195 100644 --- a/res/values-da/strings.xml +++ b/res/values-da/strings.xml @@ -48,7 +48,7 @@ Kryptér Til Clipboard - Kryptér Og Mail + Kryptér Og Mail Kryptér Afkryptér Bekræft diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml index c3e35d1e5..cd38204b6 100644 --- a/res/values-de/strings.xml +++ b/res/values-de/strings.xml @@ -51,7 +51,7 @@ In die Zwischenablage verschlüsseln - Verschlüsseln und per Mail senden + Verschlüsseln und per Mail senden Verschlüsseln Entschlüsseln Verifizieren diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index 0513ed7d7..642b7c630 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -50,7 +50,7 @@ Critta su Clipboard - Critta ed invia per mail + Critta ed invia per mail Critta Decritta Verifica diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml index 2e6571dd7..4d7c0f652 100644 --- a/res/values-sl/strings.xml +++ b/res/values-sl/strings.xml @@ -50,7 +50,7 @@ Šifriraj v odložišče - Šifriraj in pošlji + Šifriraj in pošlji Šifriraj Dešifriraj Overi diff --git a/res/values/strings.xml b/res/values/strings.xml index 67daac710..8c08b7ec3 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -48,9 +48,12 @@ Defaults + Sign To Clipboard Encrypt To Clipboard - Encrypt And Email + Encrypt And Email + Sign And Email Encrypt + Sign Decrypt Verify Select Recipients diff --git a/src/org/thialfihar/android/apg/EncryptActivity.java b/src/org/thialfihar/android/apg/EncryptActivity.java index 5d69d8563..a42cc66c1 100644 --- a/src/org/thialfihar/android/apg/EncryptActivity.java +++ b/src/org/thialfihar/android/apg/EncryptActivity.java @@ -376,12 +376,10 @@ public class EncryptActivity extends BaseActivity { mSourceLabel.setClickable(false); mSourceLabel.setEnabled(false); - - mEncryptToClipboardButton.setEnabled(false); - mEncryptToClipboardButton.setVisibility(View.INVISIBLE); - mEncryptButton.setText(R.string.btn_encrypt); } + updateButtons(); + if (mReturnResult && mMessage.getText().length() > 0 && ((mEncryptionKeyIds != null && @@ -419,17 +417,77 @@ public class EncryptActivity extends BaseActivity { switch (mSource.getCurrentView().getId()) { case R.id.sourceFile: { mSourceLabel.setText(R.string.label_file); - mEncryptButton.setText(R.string.btn_encrypt); - mEncryptToClipboardButton.setEnabled(false); - mEncryptToClipboardButton.setVisibility(View.INVISIBLE); break; } case R.id.sourceMessage: { mSourceLabel.setText(R.string.label_message); - mEncryptButton.setText(R.string.btn_send); - mEncryptToClipboardButton.setEnabled(true); - mEncryptToClipboardButton.setVisibility(View.VISIBLE); + break; + } + + default: { + break; + } + } + updateButtons(); + } + + private void updateButtons() { + switch (mSource.getCurrentView().getId()) { + case R.id.sourceFile: { + mEncryptToClipboardButton.setVisibility(View.INVISIBLE); + mEncryptButton.setText(R.string.btn_encrypt); + break; + } + + case R.id.sourceMessage: { + mSourceLabel.setText(R.string.label_message); + if (mReturnResult) { + mEncryptToClipboardButton.setVisibility(View.INVISIBLE); + } else { + mEncryptToClipboardButton.setVisibility(View.VISIBLE); + } + if (mMode.getCurrentView().getId() == R.id.modeSymmetric) { + if (mReturnResult) { + mEncryptButton.setText(R.string.btn_encrypt); + } else { + mEncryptButton.setText(R.string.btn_encryptAndEmail); + } + mEncryptButton.setEnabled(true); + mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard); + mEncryptToClipboardButton.setEnabled(true); + } else { + if (mEncryptionKeyIds == null || mEncryptionKeyIds.length == 0) { + if (getSecretKeyId() == 0) { + if (mReturnResult) { + mEncryptButton.setText(R.string.btn_encrypt); + } else { + mEncryptButton.setText(R.string.btn_encryptAndEmail); + } + mEncryptButton.setEnabled(false); + mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard); + mEncryptToClipboardButton.setEnabled(false); + } else { + if (mReturnResult) { + mEncryptButton.setText(R.string.btn_sign); + } else { + mEncryptButton.setText(R.string.btn_signAndEmail); + } + mEncryptButton.setEnabled(true); + mEncryptToClipboardButton.setText(R.string.btn_signToClipboard); + mEncryptToClipboardButton.setEnabled(true); + } + } else { + if (mReturnResult) { + mEncryptButton.setText(R.string.btn_encrypt); + } else { + mEncryptButton.setText(R.string.btn_encryptAndEmail); + } + mEncryptButton.setEnabled(true); + mEncryptToClipboardButton.setText(R.string.btn_encryptToClipboard); + mEncryptToClipboardButton.setEnabled(true); + } + } break; } @@ -455,6 +513,7 @@ public class EncryptActivity extends BaseActivity { break; } } + updateButtons(); } private void encryptToClipboardClicked() { @@ -679,6 +738,8 @@ public class EncryptActivity extends BaseActivity { mMainUserIdRest.setText(uidExtra); mSign.setChecked(true); } + + updateButtons(); } private void selectPublicKeys() {