diff options
author | Ashley Hughes <spirit.returned@gmail.com> | 2014-02-08 21:04:38 +0000 |
---|---|---|
committer | Ashley Hughes <spirit.returned@gmail.com> | 2014-02-08 21:04:38 +0000 |
commit | 75640934a080d21113f501ed604b85de3eab6b51 (patch) | |
tree | 62ab684b3f29630aa688f71ba9792c19a9302e2b /OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java | |
parent | adc6a3ea64c00f35e881e856d2877c2ea88c7e51 (diff) | |
download | open-keychain-75640934a080d21113f501ed604b85de3eab6b51.tar.gz open-keychain-75640934a080d21113f501ed604b85de3eab6b51.tar.bz2 open-keychain-75640934a080d21113f501ed604b85de3eab6b51.zip |
saving fixes
Diffstat (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java')
-rw-r--r-- | OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java index 21ebff102..315a8faba 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/SectionView.java @@ -18,6 +18,7 @@ package org.sufficientlysecure.keychain.ui.widget; import java.util.Vector; +import org.spongycastle.openpgp.PGPKeyFlags; import org.spongycastle.openpgp.PGPSecretKey; import org.sufficientlysecure.keychain.Id; import org.sufficientlysecure.keychain.R; @@ -285,7 +286,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor this.updateEditorsVisible(); } - public void setKeys(Vector<PGPSecretKey> list, Vector<Integer> usages) { + public void setKeys(Vector<PGPSecretKey> list, Vector<Integer> usages, boolean newKeys) { if (mType != Id.type.key) { return; } @@ -298,7 +299,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor false); view.setEditorListener(this); boolean isMasterKey = (mEditors.getChildCount() == 0); - view.setValue(list.get(i), isMasterKey, usages.get(i), false); + view.setValue(list.get(i), isMasterKey, usages.get(i), newKeys); view.setCanEdit(canEdit); mEditors.addView(view); } @@ -370,7 +371,10 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor KeyEditor view = (KeyEditor) mInflater.inflate(R.layout.edit_key_key_item, mEditors, false); view.setEditorListener(SectionView.this); - view.setValue(newKey, newKey.isMasterKey(), -1, true); + int usage = 0; + if (mEditors.getChildCount() == 0) + usage = PGPKeyFlags.CAN_CERTIFY; + view.setValue(newKey, newKey.isMasterKey(), usage, true); mEditors.addView(view); SectionView.this.updateEditorsVisible(); if (mEditorListener != null) { |