1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-15 14:05:05 -05:00

Don't try to save crypto settings if they weren't enabled.

This commit is contained in:
Andrew Chen 2012-12-18 16:26:53 -08:00
parent bcc29632e9
commit 3462532f7c

View File

@ -174,6 +174,7 @@ public class AccountSettings extends K9PreferenceActivity {
private CheckBoxPreference mPushPollOnConnect; private CheckBoxPreference mPushPollOnConnect;
private ListPreference mIdleRefreshPeriod; private ListPreference mIdleRefreshPeriod;
private ListPreference mMaxPushFolders; private ListPreference mMaxPushFolders;
private boolean mHasCrypto = false;
private ListPreference mCryptoApp; private ListPreference mCryptoApp;
private CheckBoxPreference mCryptoAutoSignature; private CheckBoxPreference mCryptoAutoSignature;
private CheckBoxPreference mCryptoAutoEncrypt; private CheckBoxPreference mCryptoAutoEncrypt;
@ -683,8 +684,8 @@ public class AccountSettings extends K9PreferenceActivity {
} }
}); });
final boolean hasCryptoAvailable = new Apg().isAvailable(this); mHasCrypto = new Apg().isAvailable(this);
if (hasCryptoAvailable) { if (mHasCrypto) {
mCryptoApp = (ListPreference) findPreference(PREFERENCE_CRYPTO_APP); mCryptoApp = (ListPreference) findPreference(PREFERENCE_CRYPTO_APP);
mCryptoApp.setValue(String.valueOf(mAccount.getCryptoApp())); mCryptoApp.setValue(String.valueOf(mAccount.getCryptoApp()));
mCryptoApp.setSummary(mCryptoApp.getEntry()); mCryptoApp.setSummary(mCryptoApp.getEntry());
@ -764,10 +765,12 @@ public class AccountSettings extends K9PreferenceActivity {
mAccount.setDefaultQuotedTextShown(mAccountDefaultQuotedTextShown.isChecked()); mAccount.setDefaultQuotedTextShown(mAccountDefaultQuotedTextShown.isChecked());
mAccount.setReplyAfterQuote(mReplyAfterQuote.isChecked()); mAccount.setReplyAfterQuote(mReplyAfterQuote.isChecked());
mAccount.setStripSignature(mStripSignature.isChecked()); mAccount.setStripSignature(mStripSignature.isChecked());
mAccount.setCryptoApp(mCryptoApp.getValue());
mAccount.setCryptoAutoSignature(mCryptoAutoSignature.isChecked());
mAccount.setCryptoAutoEncrypt(mCryptoAutoEncrypt.isChecked());
mAccount.setLocalStorageProviderId(mLocalStorageProvider.getValue()); mAccount.setLocalStorageProviderId(mLocalStorageProvider.getValue());
if (mHasCrypto) {
mAccount.setCryptoApp(mCryptoApp.getValue());
mAccount.setCryptoAutoSignature(mCryptoAutoSignature.isChecked());
mAccount.setCryptoAutoEncrypt(mCryptoAutoEncrypt.isChecked());
}
// In webdav account we use the exact folder name also for inbox, // In webdav account we use the exact folder name also for inbox,
// since it varies because of internationalization // since it varies because of internationalization