earlier error on empty clipboard
This commit is contained in:
@@ -37,6 +37,7 @@ import org.sufficientlysecure.keychain.R;
|
|||||||
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
|
||||||
import org.sufficientlysecure.keychain.pgp.PgpHelper;
|
import org.sufficientlysecure.keychain.pgp.PgpHelper;
|
||||||
import org.sufficientlysecure.keychain.ui.util.Notify;
|
import org.sufficientlysecure.keychain.ui.util.Notify;
|
||||||
|
import org.sufficientlysecure.keychain.ui.util.Notify.Style;
|
||||||
import org.sufficientlysecure.keychain.ui.util.SubtleAttentionSeeker;
|
import org.sufficientlysecure.keychain.ui.util.SubtleAttentionSeeker;
|
||||||
import org.sufficientlysecure.keychain.util.FileHelper;
|
import org.sufficientlysecure.keychain.util.FileHelper;
|
||||||
|
|
||||||
@@ -92,15 +93,30 @@ public class EncryptDecryptOverviewFragment extends Fragment {
|
|||||||
mDecryptFromClipboard.setOnClickListener(new View.OnClickListener() {
|
mDecryptFromClipboard.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent clipboardDecrypt = new Intent(getActivity(), DecryptActivity.class);
|
decryptFromClipboard();
|
||||||
clipboardDecrypt.setAction(DecryptActivity.ACTION_DECRYPT_FROM_CLIPBOARD);
|
|
||||||
startActivityForResult(clipboardDecrypt, 0);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void decryptFromClipboard() {
|
||||||
|
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
final CharSequence clipboardText = ClipboardReflection.getClipboardText(activity);
|
||||||
|
if (clipboardText == null) {
|
||||||
|
Notify.create(activity, R.string.error_clipboard_empty, Style.ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
Intent clipboardDecrypt = new Intent(getActivity(), DecryptActivity.class);
|
||||||
|
clipboardDecrypt.setAction(DecryptActivity.ACTION_DECRYPT_FROM_CLIPBOARD);
|
||||||
|
startActivityForResult(clipboardDecrypt, 0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|||||||
@@ -1352,5 +1352,6 @@
|
|||||||
<string name="file_delete_ok">"Original file deleted."</string>
|
<string name="file_delete_ok">"Original file deleted."</string>
|
||||||
<string name="file_delete_none">"No file deleted! (Already deleted?)"</string>
|
<string name="file_delete_none">"No file deleted! (Already deleted?)"</string>
|
||||||
<string name="file_delete_exception">"Original file could not be deleted!"</string>
|
<string name="file_delete_exception">"Original file could not be deleted!"</string>
|
||||||
|
<string name="error_clipboard_empty">"Clipboard is empty!"</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user