diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2014-04-04 18:49:45 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2014-04-04 18:49:45 +0200 |
commit | d7c2488a0f08c8314706f76c22b53166309bcdf0 (patch) | |
tree | 5a5bccfd9c60d01a6c8534cf2d131ca9c19bb7ad /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java | |
parent | cf76a8553a686e1e9c8757b39b6b4e3c4b05bb0c (diff) | |
download | open-keychain-d7c2488a0f08c8314706f76c22b53166309bcdf0.tar.gz open-keychain-d7c2488a0f08c8314706f76c22b53166309bcdf0.tar.bz2 open-keychain-d7c2488a0f08c8314706f76c22b53166309bcdf0.zip |
db-overhaul: fix key export (and some export-related ui changes)
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java index 3c6ae514e..830c5fcae 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/ViewKeyMainFragment.java @@ -81,6 +81,9 @@ public class ViewKeyMainFragment extends Fragment implements private Uri mDataUri; + // for activity + private boolean mSecretAvailable = false; + @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.view_key_main_fragment, container, false); @@ -227,9 +230,9 @@ public class ViewKeyMainFragment extends Fragment implements mEmail.setText(mainUserId[1]); mComment.setText(mainUserId[2]); - if (data.getInt(INDEX_UNIFIED_HAS_SECRET) > 0) { - // set this attribute. this is a LITTLE unclean, but we have the info available - // right here, so why not. + if (data.getInt(INDEX_UNIFIED_HAS_SECRET) != 0) { + mSecretAvailable = true; + mSecretKey.setTextColor(getResources().getColor(R.color.emphasis)); mSecretKey.setText(R.string.secret_key_yes); @@ -244,6 +247,8 @@ public class ViewKeyMainFragment extends Fragment implements } }); } else { + mSecretAvailable = false; + mSecretKey.setTextColor(Color.BLACK); mSecretKey.setText(getResources().getString(R.string.secret_key_no)); @@ -332,6 +337,11 @@ public class ViewKeyMainFragment extends Fragment implements } } + /** Returns true if the key current displayed is known to have a secret key. */ + public boolean isSecretAvailable() { + return mSecretAvailable; + } + private void encryptToContact(Uri dataUri) { // TODO preselect from uri? should be feasible without trivial query long keyId = ProviderHelper.getMasterKeyId(getActivity(), dataUri); |