mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-11 11:35:07 -05:00
use usage argument if needed
This commit is contained in:
parent
fe3db8f0e6
commit
6d40bc3c0c
@ -146,7 +146,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
||||
}
|
||||
}
|
||||
|
||||
public void setValue(PGPSecretKey key, boolean isMasterKey, int usage) {
|
||||
public void setValue(PGPSecretKey key, boolean isMasterKey, int usage, boolean isNewKey) {
|
||||
mKey = key;
|
||||
|
||||
mIsMasterKey = isMasterKey;
|
||||
@ -190,8 +190,10 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener {
|
||||
mChkSign.setChecked(PgpKeyHelper.isSigningKey(key));
|
||||
mChkEncrypt.setChecked(PgpKeyHelper.isEncryptionKey(key));
|
||||
mChkAuthenticate.setChecked(PgpKeyHelper.isAuthenticationKey(key));
|
||||
mUsage = PgpKeyHelper.getKeyUsage(key);
|
||||
// TODO: use usage argument?
|
||||
if (isNewKey)
|
||||
mUsage = usage;
|
||||
else
|
||||
mUsage = PgpKeyHelper.getKeyUsage(key);
|
||||
|
||||
GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
|
||||
cal.setTime(PgpKeyHelper.getCreationDate(key));
|
||||
|
@ -272,7 +272,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));
|
||||
view.setValue(list.get(i), isMasterKey, usages.get(i), false);
|
||||
view.setCanEdit(canEdit);
|
||||
mEditors.addView(view);
|
||||
}
|
||||
@ -344,7 +344,7 @@ 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);
|
||||
view.setValue(newKey, newKey.isMasterKey(), -1, true);
|
||||
mEditors.addView(view);
|
||||
SectionView.this.updateEditorsVisible();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user