Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e982690 authored by Vincent Breitmoser's avatar Vincent Breitmoser
Browse files

move sign-only support settings to global

parent 46046f89
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -220,7 +220,6 @@ public class Account implements BaseAccount, StoreConfig {
    private boolean mStripSignature;
    private boolean mSyncRemoteDeletions;
    private long mCryptoKey;
    private boolean mCryptoSupportSignOnly;
    private boolean mMarkMessageAsReadOnView;
    private boolean mAlwaysShowCcBcc;
    private boolean mAllowRemoteSearch;
@@ -316,7 +315,6 @@ public class Account implements BaseAccount, StoreConfig {
        mStripSignature = DEFAULT_STRIP_SIGNATURE;
        mSyncRemoteDeletions = true;
        mCryptoKey = NO_OPENPGP_KEY;
        mCryptoSupportSignOnly = false;
        mAllowRemoteSearch = false;
        mRemoteSearchFullText = false;
        mRemoteSearchNumResults = DEFAULT_REMOTE_SEARCH_NUM_RESULTS;
@@ -465,7 +463,6 @@ public class Account implements BaseAccount, StoreConfig {
        identities = loadIdentities(storage);

        mCryptoKey = storage.getLong(mUuid + ".cryptoKey", NO_OPENPGP_KEY);
        mCryptoSupportSignOnly = storage.getBoolean(mUuid + ".cryptoSupportSignOnly", false);
        mAllowRemoteSearch = storage.getBoolean(mUuid + ".allowRemoteSearch", false);
        mRemoteSearchFullText = storage.getBoolean(mUuid + ".remoteSearchFullText", false);
        mRemoteSearchNumResults = storage.getInt(mUuid + ".remoteSearchNumResults", DEFAULT_REMOTE_SEARCH_NUM_RESULTS);
@@ -732,7 +729,6 @@ public class Account implements BaseAccount, StoreConfig {
        editor.putBoolean(mUuid + ".replyAfterQuote", mReplyAfterQuote);
        editor.putBoolean(mUuid + ".stripSignature", mStripSignature);
        editor.putLong(mUuid + ".cryptoKey", mCryptoKey);
        editor.putBoolean(mUuid + ".cryptoSupportSignOnly", mCryptoSupportSignOnly);
        editor.putBoolean(mUuid + ".allowRemoteSearch", mAllowRemoteSearch);
        editor.putBoolean(mUuid + ".remoteSearchFullText", mRemoteSearchFullText);
        editor.putInt(mUuid + ".remoteSearchNumResults", mRemoteSearchNumResults);
@@ -1604,14 +1600,6 @@ public class Account implements BaseAccount, StoreConfig {
        mCryptoKey = keyId;
    }

    public boolean getCryptoSupportSignOnly() {
        return mCryptoSupportSignOnly;
    }

    public void setCryptoSupportSignOnly(boolean cryptoSupportSignOnly) {
        mCryptoSupportSignOnly = cryptoSupportSignOnly;
    }

    public boolean allowRemoteSearch() {
        return mAllowRemoteSearch;
    }
+11 −0
Original line number Diff line number Diff line
@@ -243,6 +243,7 @@ public class K9 extends Application {
    private static boolean mHideTimeZone = false;

    private static String sCryptoProvider = "";
    private static boolean sCryptoSupportSignOnly = false;

    private static SortType mSortType;
    private static Map<SortType, Boolean> mSortAscending = new HashMap<SortType, Boolean>();
@@ -469,6 +470,7 @@ public class K9 extends Application {
        editor.putBoolean("hideTimeZone", mHideTimeZone);

        editor.putString("cryptoProvider", sCryptoProvider);
        editor.putBoolean("cryptoSupportSignOnly", sCryptoSupportSignOnly);

        editor.putString("language", language);
        editor.putInt("theme", theme.ordinal());
@@ -689,6 +691,7 @@ public class K9 extends Application {
        mHideTimeZone = storage.getBoolean("hideTimeZone", false);

        sCryptoProvider = storage.getString("cryptoProvider", NO_CRYPTO_PROVIDER);
        sCryptoSupportSignOnly = storage.getBoolean("cryptoSupportSignOnly", false);

        mConfirmDelete = storage.getBoolean("confirmDelete", false);
        mConfirmDiscardMessage = storage.getBoolean("confirmDiscardMessage", true);
@@ -1247,6 +1250,14 @@ public class K9 extends Application {
        sCryptoProvider = cryptoProvider;
    }

    public static boolean getCryptoSupportSignOnly() {
        return sCryptoSupportSignOnly;
    }

    public static void setCryptoSupportSignOnly(boolean supportSignOnly) {
        sCryptoSupportSignOnly = supportSignOnly;
    }

    public static String getAttachmentDefaultPath() {
        return mAttachmentDefaultPath;
    }
+1 −1
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ public class RecipientPresenter implements PermissionPingCallback {
        menu.findItem(R.id.openpgp_inline_enable).setVisible(isCryptoConfigured && !cryptoEnablePgpInline);
        menu.findItem(R.id.openpgp_inline_disable).setVisible(isCryptoConfigured && cryptoEnablePgpInline);

        boolean showSignOnly = isCryptoConfigured && account.getCryptoSupportSignOnly();
        boolean showSignOnly = isCryptoConfigured && K9.getCryptoSupportSignOnly();
        boolean isSignOnly = cachedCryptoStatus.isSignOnly();
        menu.findItem(R.id.openpgp_sign_only).setVisible(showSignOnly && !isSignOnly);
        menu.findItem(R.id.openpgp_sign_only_disable).setVisible(showSignOnly && isSignOnly);
+0 −5
Original line number Diff line number Diff line
@@ -113,7 +113,6 @@ public class AccountSettings extends K9PreferenceActivity {
    private static final String PREFERENCE_SYNC_REMOTE_DELETIONS = "account_sync_remote_deletetions";
    private static final String PREFERENCE_CRYPTO = "crypto";
    private static final String PREFERENCE_CRYPTO_KEY = "crypto_key";
    private static final String PREFERENCE_CRYPTO_SUPPORT_SIGN_ONLY = "crypto_support_sign_only";
    private static final String PREFERENCE_CLOUD_SEARCH_ENABLED = "remote_search_enabled";
    private static final String PREFERENCE_REMOTE_SEARCH_NUM_RESULTS = "account_remote_search_num_results";
    private static final String PREFERENCE_REMOTE_SEARCH_FULL_TEXT = "account_remote_search_full_text";
@@ -698,7 +697,6 @@ public class AccountSettings extends K9PreferenceActivity {
        PreferenceScreen cryptoMenu = (PreferenceScreen) findPreference(PREFERENCE_CRYPTO);
        if (mHasCrypto) {
            mCryptoKey = (OpenPgpKeyPreference) findPreference(PREFERENCE_CRYPTO_KEY);
            mCryptoSupportSignOnly = (CheckBoxPreference) findPreference(PREFERENCE_CRYPTO_SUPPORT_SIGN_ONLY);

            mCryptoKey.setValue(mAccount.getCryptoKey());
            mCryptoKey.setOpenPgpProvider(K9.getCryptoProvider());
@@ -712,7 +710,6 @@ public class AccountSettings extends K9PreferenceActivity {
                }
            });

            mCryptoSupportSignOnly.setChecked(mAccount.getCryptoSupportSignOnly());
            cryptoMenu.setOnPreferenceClickListener(null);
        } else {
            cryptoMenu.setSummary(R.string.account_settings_no_openpgp_provider_configured);
@@ -791,10 +788,8 @@ public class AccountSettings extends K9PreferenceActivity {
        mAccount.setLocalStorageProviderId(mLocalStorageProvider.getValue());
        if (mHasCrypto) {
            mAccount.setCryptoKey(mCryptoKey.getValue());
            mAccount.setCryptoSupportSignOnly(mCryptoSupportSignOnly.isChecked());
        } else {
            mAccount.setCryptoKey(Account.NO_OPENPGP_KEY);
            mAccount.setCryptoSupportSignOnly(false);
        }

        // In webdav account we use the exact folder name also for inbox,
+6 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ public class Prefs extends K9PreferenceActivity {
    private static final String PREFERENCE_HIDE_TIMEZONE = "privacy_hide_timezone";

    private static final String PREFERENCE_CRYPTO_APP = "crypto_app";
    private static final String PREFERENCE_CRYPTO_SUPPORT_SIGN_ONLY = "crypto_support_sign_only";

    private static final String PREFERENCE_AUTOFIT_WIDTH = "messageview_autofit_width";
    private static final String PREFERENCE_BACKGROUND_OPS = "background_ops";
@@ -155,6 +156,7 @@ public class Prefs extends K9PreferenceActivity {
    private CheckBoxListPreference mVisibleRefileActions;

    private OpenPgpAppPreference mCryptoProvider;
    private CheckBoxPreference mCryptoSupportSignOnly;

    private CheckBoxPreference mQuietTimeEnabled;
    private CheckBoxPreference mDisableNotificationDuringQuietTime;
@@ -401,6 +403,9 @@ public class Prefs extends K9PreferenceActivity {
            }
        });

        mCryptoSupportSignOnly = (CheckBoxPreference) findPreference(PREFERENCE_CRYPTO_SUPPORT_SIGN_ONLY);
        mCryptoSupportSignOnly.setChecked(K9.getCryptoSupportSignOnly());

        mAttachmentPathPreference = findPreference(PREFERENCE_ATTACHMENT_DEF_PATH);
        mAttachmentPathPreference.setSummary(K9.getAttachmentDefaultPath());
        mAttachmentPathPreference
@@ -557,6 +562,7 @@ public class Prefs extends K9PreferenceActivity {
        K9.setHideTimeZone(mHideTimeZone.isChecked());

        K9.setCryptoProvider(mCryptoProvider.getValue());
        K9.setCryptoSupportSignOnly(mCryptoSupportSignOnly.isChecked());

        StorageEditor editor = storage.edit();
        K9.save(editor);
Loading