mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-06 17:25:05 -05:00
passphrase changes update need to save
This commit is contained in:
parent
53dc044ab4
commit
6dbf482755
@ -109,15 +109,22 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
||||
|
||||
ExportHelper mExportHelper;
|
||||
|
||||
public void somethingChanged()
|
||||
{
|
||||
mNeedsSaving = mUserIdsView.needsSaving();
|
||||
mNeedsSaving |= mKeysView.needsSaving();
|
||||
mNeedsSaving |= hasPassphraseChanged();
|
||||
Toast.makeText(this, "Needs saving: " + Boolean.toString(mNeedsSaving) + "(" + Boolean.toString(mUserIdsView.needsSaving()) + ", " + Boolean.toString(mKeysView.needsSaving()) + ")", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
public void onDeleted(Editor e, boolean wasNewItem)
|
||||
{
|
||||
somethingChanged();
|
||||
}
|
||||
|
||||
public void onEdited()
|
||||
{
|
||||
mNeedsSaving = mUserIdsView.needsSaving();
|
||||
mNeedsSaving |= mKeysView.needsSaving();
|
||||
Toast.makeText(this, "Needs saving: " + Boolean.toString(mNeedsSaving), Toast.LENGTH_LONG).show();
|
||||
somethingChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -400,6 +407,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
||||
.getString(SetPassphraseDialogFragment.MESSAGE_NEW_PASSPHRASE);
|
||||
|
||||
updatePassPhraseButtonText();
|
||||
somethingChanged();
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -471,6 +479,7 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
||||
mNewPassPhrase = mSavedNewPassPhrase;
|
||||
mChangePassPhrase.setVisibility(View.VISIBLE);
|
||||
}
|
||||
somethingChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -493,6 +502,15 @@ public class EditKeyActivity extends ActionBarActivity implements EditorListener
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasPassphraseChanged()
|
||||
{
|
||||
if (mNoPassphrase.isChecked()) {
|
||||
return mIsPassPhraseSet;
|
||||
} else {
|
||||
return (mNewPassPhrase != null && !mNewPassPhrase.equals(""));
|
||||
}
|
||||
}
|
||||
|
||||
private void saveClicked() {
|
||||
long masterKeyId = getMasterKeyId();
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user