From 312598290bfc453e16dfccdc5e9875e8fa5d0978 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Wed, 24 Sep 2014 15:36:34 +0200 Subject: [PATCH] fix save button when no file is selected --- .../sufficientlysecure/keychain/ui/EncryptFilesFragment.java | 4 ++++ OpenKeychain/src/main/res/values/strings.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java index 8569877af..fc4c9ed75 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/EncryptFilesFragment.java @@ -158,6 +158,10 @@ public class EncryptFilesFragment extends Fragment implements EncryptActivityInt } private void encryptClicked(boolean share) { + if (mEncryptInterface.getInputUris().isEmpty()) { + Notify.showNotify(getActivity(), R.string.error_no_file_selected, Notify.Style.ERROR); + return; + } if (share) { mEncryptInterface.getOutputUris().clear(); for (Uri uri : mEncryptInterface.getInputUris()) { diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index b17196587..14d0eba9b 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -910,6 +910,7 @@ "Do not create OpenKeychain-Accounts manually.\nFor more information, see Help." "Show key (%s)" "Swipe down to update from keyserver" + "Select at least one file to encrypt!" "Saving of multiple files not supported. This is a limitation on current Android."