Merge pull request #4322 from k9mail/account_defaults
Change some account defaults
This commit is contained in:
commit
dad7f1963b
6 changed files with 8 additions and 18 deletions
|
@ -111,6 +111,7 @@ public class Account implements BaseAccount, StoreConfig {
|
||||||
public static final int UNASSIGNED_ACCOUNT_NUMBER = -1;
|
public static final int UNASSIGNED_ACCOUNT_NUMBER = -1;
|
||||||
|
|
||||||
public static final int INTERVAL_MINUTES_NEVER = -1;
|
public static final int INTERVAL_MINUTES_NEVER = -1;
|
||||||
|
public static final int DEFAULT_SYNC_INTERVAL = 60;
|
||||||
|
|
||||||
private DeletePolicy deletePolicy = DeletePolicy.NEVER;
|
private DeletePolicy deletePolicy = DeletePolicy.NEVER;
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,11 @@ package com.fsck.k9
|
||||||
|
|
||||||
import com.fsck.k9.Account.DEFAULT_SORT_ASCENDING
|
import com.fsck.k9.Account.DEFAULT_SORT_ASCENDING
|
||||||
import com.fsck.k9.Account.DEFAULT_SORT_TYPE
|
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.DeletePolicy
|
||||||
import com.fsck.k9.Account.Expunge
|
import com.fsck.k9.Account.Expunge
|
||||||
import com.fsck.k9.Account.FolderMode
|
import com.fsck.k9.Account.FolderMode
|
||||||
import com.fsck.k9.Account.INBOX
|
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.MessageFormat
|
||||||
import com.fsck.k9.Account.NO_OPENPGP_KEY
|
import com.fsck.k9.Account.NO_OPENPGP_KEY
|
||||||
import com.fsck.k9.Account.QuoteStyle
|
import com.fsck.k9.Account.QuoteStyle
|
||||||
|
@ -37,7 +37,7 @@ class AccountPreferenceSerializer(
|
||||||
transportUri = Base64.decode(storage.getString("$accountUuid.transportUri", null))
|
transportUri = Base64.decode(storage.getString("$accountUuid.transportUri", null))
|
||||||
description = storage.getString("$accountUuid.description", null)
|
description = storage.getString("$accountUuid.description", null)
|
||||||
alwaysBcc = storage.getString("$accountUuid.alwaysBcc", alwaysBcc)
|
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)
|
idleRefreshMinutes = storage.getInt("$accountUuid.idleRefreshMinutes", 24)
|
||||||
isPushPollOnConnect = storage.getBoolean("$accountUuid.pushPollOnConnect", true)
|
isPushPollOnConnect = storage.getBoolean("$accountUuid.pushPollOnConnect", true)
|
||||||
displayCount = storage.getInt("$accountUuid.displayCount", K9.DEFAULT_VISIBLE_LIMIT)
|
displayCount = storage.getInt("$accountUuid.displayCount", K9.DEFAULT_VISIBLE_LIMIT)
|
||||||
|
@ -506,14 +506,14 @@ class AccountPreferenceSerializer(
|
||||||
fun loadDefaults(account: Account) {
|
fun loadDefaults(account: Account) {
|
||||||
with(account) {
|
with(account) {
|
||||||
localStorageProviderId = storageManager.defaultProviderId
|
localStorageProviderId = storageManager.defaultProviderId
|
||||||
automaticCheckIntervalMinutes = INTERVAL_MINUTES_NEVER
|
automaticCheckIntervalMinutes = DEFAULT_SYNC_INTERVAL
|
||||||
idleRefreshMinutes = 24
|
idleRefreshMinutes = 24
|
||||||
isPushPollOnConnect = true
|
isPushPollOnConnect = true
|
||||||
displayCount = K9.DEFAULT_VISIBLE_LIMIT
|
displayCount = K9.DEFAULT_VISIBLE_LIMIT
|
||||||
accountNumber = UNASSIGNED_ACCOUNT_NUMBER
|
accountNumber = UNASSIGNED_ACCOUNT_NUMBER
|
||||||
isNotifyNewMail = true
|
isNotifyNewMail = true
|
||||||
folderNotifyNewMailMode = FolderMode.ALL
|
folderNotifyNewMailMode = FolderMode.ALL
|
||||||
isNotifySync = true
|
isNotifySync = false
|
||||||
isNotifySelfNewMail = true
|
isNotifySelfNewMail = true
|
||||||
isNotifyContactsMailOnly = false
|
isNotifyContactsMailOnly = false
|
||||||
folderDisplayMode = FolderMode.NOT_SECOND_CLASS
|
folderDisplayMode = FolderMode.NOT_SECOND_CLASS
|
||||||
|
|
|
@ -63,7 +63,8 @@ public class AccountSettings {
|
||||||
new V(1, new StringSetting("INBOX"))
|
new V(1, new StringSetting("INBOX"))
|
||||||
));
|
));
|
||||||
s.put("automaticCheckIntervalMinutes", Settings.versions(
|
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(
|
s.put("chipColor", Settings.versions(
|
||||||
new V(1, new ColorSetting(0xFF0000FF))
|
new V(1, new ColorSetting(0xFF0000FF))
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class Settings {
|
||||||
*
|
*
|
||||||
* @see SettingsExporter
|
* @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,
|
static Map<String, Object> validate(int version, Map<String, TreeMap<Integer, SettingsDescription>> settings,
|
||||||
Map<String, String> importedSettings, boolean useDefaultValues) {
|
Map<String, String> importedSettings, boolean useDefaultValues) {
|
||||||
|
|
|
@ -29,7 +29,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
|
||||||
|
|
||||||
|
|
||||||
private CheckBox mNotifyView;
|
private CheckBox mNotifyView;
|
||||||
private CheckBox mNotifySyncView;
|
|
||||||
|
|
||||||
private Account mAccount;
|
private Account mAccount;
|
||||||
|
|
||||||
|
@ -48,7 +47,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
|
||||||
mCheckFrequencyView = findViewById(R.id.account_check_frequency);
|
mCheckFrequencyView = findViewById(R.id.account_check_frequency);
|
||||||
mDisplayCountView = findViewById(R.id.account_display_count);
|
mDisplayCountView = findViewById(R.id.account_display_count);
|
||||||
mNotifyView = findViewById(R.id.account_notify);
|
mNotifyView = findViewById(R.id.account_notify);
|
||||||
mNotifySyncView = findViewById(R.id.account_notify_sync);
|
|
||||||
|
|
||||||
findViewById(R.id.next).setOnClickListener(this);
|
findViewById(R.id.next).setOnClickListener(this);
|
||||||
|
|
||||||
|
@ -99,7 +97,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
|
||||||
mAccount = Preferences.getPreferences(this).getAccount(accountUuid);
|
mAccount = Preferences.getPreferences(this).getAccount(accountUuid);
|
||||||
|
|
||||||
mNotifyView.setChecked(mAccount.isNotifyNewMail());
|
mNotifyView.setChecked(mAccount.isNotifyNewMail());
|
||||||
mNotifySyncView.setChecked(mAccount.isNotifySync());
|
|
||||||
SpinnerOption.setSpinnerOptionValue(mCheckFrequencyView, mAccount
|
SpinnerOption.setSpinnerOptionValue(mCheckFrequencyView, mAccount
|
||||||
.getAutomaticCheckIntervalMinutes());
|
.getAutomaticCheckIntervalMinutes());
|
||||||
SpinnerOption.setSpinnerOptionValue(mDisplayCountView, mAccount
|
SpinnerOption.setSpinnerOptionValue(mDisplayCountView, mAccount
|
||||||
|
@ -109,7 +106,6 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener {
|
||||||
private void onDone() {
|
private void onDone() {
|
||||||
mAccount.setDescription(mAccount.getEmail());
|
mAccount.setDescription(mAccount.getEmail());
|
||||||
mAccount.setNotifyNewMail(mNotifyView.isChecked());
|
mAccount.setNotifyNewMail(mNotifyView.isChecked());
|
||||||
mAccount.setNotifySync(mNotifySyncView.isChecked());
|
|
||||||
mAccount.setAutomaticCheckIntervalMinutes((Integer)((SpinnerOption)mCheckFrequencyView
|
mAccount.setAutomaticCheckIntervalMinutes((Integer)((SpinnerOption)mCheckFrequencyView
|
||||||
.getSelectedItem()).value);
|
.getSelectedItem()).value);
|
||||||
mAccount.setDisplayCount((Integer)((SpinnerOption)mDisplayCountView
|
mAccount.setDisplayCount((Integer)((SpinnerOption)mDisplayCountView
|
||||||
|
|
|
@ -55,14 +55,6 @@
|
||||||
android:text="@string/account_setup_options_notify_label"
|
android:text="@string/account_setup_options_notify_label"
|
||||||
android:textColor="?android:attr/textColorPrimary" />
|
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
|
<View
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
|
Loading…
Reference in a new issue