From 5def251e62d383f023c62fea1734977e11b0fa27 Mon Sep 17 00:00:00 2001 From: Ashley Hughes Date: Sat, 8 Feb 2014 15:59:44 +0000 Subject: keep track of brand new keys, they need saving --- .../java/org/sufficientlysecure/keychain/ui/EditKeyActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 802d29a44..9ddfadef1 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 @@ -100,6 +100,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener private String mSavedNewPassPhrase = null; private boolean mIsPassPhraseSet; private boolean mNeedsSaving; + private boolean mIsBrandNewKeyring = false; private MenuItem mSaveButton; private BootstrapButton mChangePassPhrase; @@ -118,6 +119,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener mNeedsSaving = (mUserIdsView == null) ? false : mUserIdsView.needsSaving(); mNeedsSaving |= (mKeysView == null) ? false : mKeysView.needsSaving(); mNeedsSaving |= hasPassphraseChanged(); + mNeedsSaving |= mIsBrandNewKeyring; return mNeedsSaving; } @@ -171,6 +173,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener Bundle extras = intent.getExtras(); mCurrentPassPhrase = ""; + mIsBrandNewKeyring = true; if (extras != null) { // if userId is given, prefill the fields @@ -616,7 +619,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener } private void cancelClicked() { - if (mNeedsSaving) { //ask if we want to save + if (needsSaving()) { //ask if we want to save AlertDialog.Builder alert = new AlertDialog.Builder( EditKeyActivity.this); -- cgit v1.2.3