mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 19:22:14 -05:00
new Ids need to be saved
This commit is contained in:
parent
83514b82c0
commit
603665976a
@ -166,9 +166,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
||||
UserIdEditor view = (UserIdEditor) mInflater.inflate(
|
||||
R.layout.edit_key_user_id_item, mEditors, false);
|
||||
view.setEditorListener(this);
|
||||
if (mEditors.getChildCount() == 0) {
|
||||
view.setIsMainUserId(true);
|
||||
}
|
||||
view.setValue("", mEditors.getChildCount() == 0, true);
|
||||
mEditors.addView(view);
|
||||
break;
|
||||
}
|
||||
@ -273,7 +271,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
||||
UserIdEditor view = (UserIdEditor) mInflater.inflate(R.layout.edit_key_user_id_item,
|
||||
mEditors, false);
|
||||
view.setEditorListener(this);
|
||||
view.setValue(userId, mEditors.getChildCount() == 0);
|
||||
view.setValue(userId, mEditors.getChildCount() == 0, false);
|
||||
view.setCanEdit(canEdit);
|
||||
mEditors.addView(view);
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
||||
private EditText mComment;
|
||||
private String mOriginalComment;
|
||||
private boolean mOriginallyMainUserID;
|
||||
private boolean mIsNewId;
|
||||
|
||||
// see http://www.regular-expressions.info/email.html
|
||||
// RFC 2822 if we omit the syntax using double quotes and square brackets
|
||||
@ -131,10 +132,11 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
||||
super.onFinishInflate();
|
||||
}
|
||||
|
||||
public void setValue(String userId, boolean isMainID) {
|
||||
public void setValue(String userId, boolean isMainID, boolean isNewId) {
|
||||
mName.setText("");
|
||||
mComment.setText("");
|
||||
mEmail.setText("");
|
||||
mIsNewId = isNewId;
|
||||
|
||||
//TODO: update this file for blank email/name?
|
||||
|
||||
@ -247,6 +249,7 @@ public class UserIdEditor extends LinearLayout implements Editor, OnClickListene
|
||||
retval |= (mOriginalName.equals( ("" + mName.getText()).trim() ) );
|
||||
retval |= (mOriginalEmail.equals( ("" + mEmail.getText()).trim() ) );
|
||||
retval |= (mOriginalComment.equals( ("" + mComment.getText()).trim() ) );
|
||||
retval |= mIsNewId;
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user