From e7ebbc5ef662ecfe4f43ae203731c6d25cc26e0d Mon Sep 17 00:00:00 2001 From: Ashley Hughes Date: Thu, 6 Feb 2014 13:56:34 +0000 Subject: final link in chain, fix compile --- .../org/sufficientlysecure/keychain/ui/EditKeyActivity.java | 12 ++++++------ .../org/sufficientlysecure/keychain/ui/widget/KeyEditor.java | 3 +-- .../keychain/ui/widget/KeyServerEditor.java | 5 +++++ 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui') diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java index b28ed8922..d8489ce65 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java @@ -96,6 +96,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener private String mNewPassPhrase = null; private String mSavedNewPassPhrase = null; private boolean mIsPassPhraseSet; + private boolean mNeedsSaving; private BootstrapButton mChangePassPhrase; @@ -114,7 +115,9 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener public void onEdited() { - + mNeedsSaving = mUserIdsView.needsSaving(); + mNeedsSaving |= mKeysView.needsSaving(); + Toast.makeText(this, "Needs saving: " + Boolean.toString(mNeedsSaving), Toast.LENGTH_LONG).show(); } @Override @@ -437,11 +440,13 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener mUserIdsView.setType(Id.type.user_id); mUserIdsView.setCanEdit(masterCanSign); mUserIdsView.setUserIds(mUserIds); + mUserIdsView.setEditorListener(this); container.addView(mUserIdsView); mKeysView = (SectionView) inflater.inflate(R.layout.edit_key_section, container, false); mKeysView.setType(Id.type.key); mKeysView.setCanEdit(masterCanSign); mKeysView.setKeys(mKeys, mKeysUsages); + mKeysView.setEditorListener(this); container.addView(mKeysView); updatePassPhraseButtonText(); @@ -597,11 +602,6 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener String userId = null; try { userId = editor.getValue(); - } catch (UserIdEditor.NoNameException e) { - throw new PgpGeneralException(this.getString(R.string.error_user_id_needs_a_name)); - } catch (UserIdEditor.NoEmailException e) { - throw new PgpGeneralException( - this.getString(R.string.error_user_id_needs_an_email_address)); } catch (UserIdEditor.InvalidEmailException e) { throw new PgpGeneralException(e.getMessage()); } diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java index 0ec1bad92..009b0cb10 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyEditor.java @@ -78,8 +78,7 @@ public class KeyEditor extends LinearLayout implements Editor, OnClickListener { mEditorListener.onEdited(); } } - - } + }; private int mDatePickerResultCount = 0; diff --git a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyServerEditor.java b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyServerEditor.java index a75aafc11..47238cd56 100644 --- a/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyServerEditor.java +++ b/OpenPGP-Keychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeyServerEditor.java @@ -73,6 +73,11 @@ public class KeyServerEditor extends LinearLayout implements Editor, OnClickList } } + @Override + public boolean needsSaving() { + return false; + } + public void setEditorListener(EditorListener listener) { mEditorListener = listener; } -- cgit v1.2.3