Merge pull request #4322 from k9mail/account_defaults

Change some account defaults
This commit is contained in:
cketti 2019-12-02 01:57:06 +01:00 committed by GitHub
commit dad7f1963b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 18 deletions

View file

@ -111,6 +111,7 @@ public class Account implements BaseAccount, StoreConfig {
public static final int UNASSIGNED_ACCOUNT_NUMBER = -1;
public static final int INTERVAL_MINUTES_NEVER = -1;
public static final int DEFAULT_SYNC_INTERVAL = 60;
private DeletePolicy deletePolicy = DeletePolicy.NEVER;

View file

@ -2,11 +2,11 @@ package com.fsck.k9
import com.fsck.k9.Account.DEFAULT_SORT_ASCENDING
import com.fsck.k9.Account.DEFAULT_SORT_TYPE
import com.fsck.k9.Account.DEFAULT_SYNC_INTERVAL
import com.fsck.k9.Account.DeletePolicy
import com.fsck.k9.Account.Expunge
import com.fsck.k9.Account.FolderMode
import com.fsck.k9.Account.INBOX
import com.fsck.k9.Account.INTERVAL_MINUTES_NEVER
import com.fsck.k9.Account.MessageFormat
import com.fsck.k9.Account.NO_OPENPGP_KEY
import com.fsck.k9.Account.QuoteStyle
@ -37,7 +37,7 @@ class AccountPreferenceSerializer(
transportUri = Base64.decode(storage.getString("$accountUuid.transportUri", null))
description = storage.getString("$accountUuid.description", null)
alwaysBcc = storage.getString("$accountUuid.alwaysBcc", alwaysBcc)
automaticCheckIntervalMinutes = storage.getInt("$accountUuid.automaticCheckIntervalMinutes", INTERVAL_MINUTES_NEVER)
automaticCheckIntervalMinutes = storage.getInt("$accountUuid.automaticCheckIntervalMinutes", DEFAULT_SYNC_INTERVAL)
idleRefreshMinutes = storage.getInt("$accountUuid.idleRefreshMinutes", 24)
isPushPollOnConnect = storage.getBoolean("$accountUuid.pushPollOnConnect", true)
displayCount = storage.getInt("$accountUuid.displayCount", K9.DEFAULT_VISIBLE_LIMIT)
@ -506,14 +506,14 @@ class AccountPreferenceSerializer(
fun loadDefaults(account: Account) {
with(account) {
localStorageProviderId = storageManager.defaultProviderId
automaticCheckIntervalMinutes = INTERVAL_MINUTES_NEVER
automaticCheckIntervalMinutes = DEFAULT_SYNC_INTERVAL
idleRefreshMinutes = 24
isPushPollOnConnect = true
displayCount = K9.DEFAULT_VISIBLE_LIMIT
accountNumber = UNASSIGNED_ACCOUNT_NUMBER
isNotifyNewMail = true
folderNotifyNewMailMode = FolderMode.ALL
isNotifySync = true
isNotifySync = false
isNotifySelfNewMail = true
isNotifyContactsMailOnly = false
folderDisplayMode = FolderMode.NOT_SECOND_CLASS

View file

@ -63,7 +63,8 @@ public class AccountSettings {
new V(1, new StringSetting("INBOX"))
));
s.put("automaticCheckIntervalMinutes", Settings.versions(
new V(1, new IntegerResourceSetting(-1, R.array.check_frequency_values))
new V(1, new IntegerResourceSetting(-1, R.array.check_frequency_values)),
new V(61, new IntegerResourceSetting(60, R.array.check_frequency_values))
));
s.put("chipColor", Settings.versions(
new V(1, new ColorSetting(0xFF0000FF))

View file

@ -36,7 +36,7 @@ public class Settings {
*
* @see SettingsExporter
*/
public static final int VERSION = 60;
public static final int VERSION = 61;
static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription>> settings,
Map<String, String> importedSettings, boolean useDefaultValues) {

View file

@ -29,7 +29,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
private CheckBox mNotifyView;
private CheckBox mNotifySyncView;
private Account mAccount;
@ -48,7 +47,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
mCheckFrequencyView = findViewById(R.id.account_check_frequency);
mDisplayCountView = findViewById(R.id.account_display_count);
mNotifyView = findViewById(R.id.account_notify);
mNotifySyncView = findViewById(R.id.account_notify_sync);
findViewById(R.id.next).setOnClickListener(this);
@ -99,7 +97,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
mAccount = Preferences.getPreferences(this).getAccount(accountUuid);
mNotifyView.setChecked(mAccount.isNotifyNewMail());
mNotifySyncView.setChecked(mAccount.isNotifySync());
SpinnerOption.setSpinnerOptionValue(mCheckFrequencyView, mAccount
.getAutomaticCheckIntervalMinutes());
SpinnerOption.setSpinnerOptionValue(mDisplayCountView, mAccount
@ -109,7 +106,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
private void onDone() {
mAccount.setDescription(mAccount.getEmail());
mAccount.setNotifyNewMail(mNotifyView.isChecked());
mAccount.setNotifySync(mNotifySyncView.isChecked());
mAccount.setAutomaticCheckIntervalMinutes((Integer)((SpinnerOption)mCheckFrequencyView
.getSelectedItem()).value);
mAccount.setDisplayCount((Integer)((SpinnerOption)mDisplayCountView

View file

@ -55,14 +55,6 @@
android:text="@string/account_setup_options_notify_label"
android:textColor="?android:attr/textColorPrimary" />
<CheckBox
android:id="@+id/account_notify_sync"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/account_setup_options_notify_sync_label"
android:textColor="?android:attr/textColorPrimary" />
<View
android:layout_width="fill_parent"
android:layout_height="0dp"